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

Write a Java program that has the following inputs and outputs: Given 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

a positive integer n and a nonnegative integer r not exceeding n:

Example

1.Find the number of r-permutations and r-combinations of a set with n

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

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)

40 - 6= 34

= 1, since there is only one way to order zero elements.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!