Question: Write a Java program that has the following inputs and outputs: Given a positive integer n and a nonnegative integer r not exceeding n: 1.Find
Write a Java program that has the following inputs and outputs: Given a positive integer n and a nonnegative integer r not exceeding n:
1.Find the number of r-permutations and r-combinations of a set with n elements.
* r-permutations
If n is a positive integer and r is an integer with 1 r n,
then there are
Note that P(n,0) = 1, since there is only one way to order zero elements.
Example
P(100,3) = 970,200
* r-combinations
n r 0

Example

r = 52 - 5 = 47 or r = 5
2.Find the probability of selecting the six integers from the set {1, 2, . . . , n} that were mechanically selected in a lottery.
Example


40 - 6= 34

Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
