I got 1 red ball, 1 blue, 2 yellow, 3 green, totally 7 balls. I wanna select 3 balls from them. How many ways I can do this?I counted manually 123,124,133,134,144,233,234,244,334,344,444, so 11 combinations.Is there a formula for it?

Angel Kline

Angel Kline

Answered question

2022-10-26

I got 1 red ball, 1 blue, 2 yellow, 3 green, totally 7 balls. I wanna select 3 balls from them. How many ways I can do this?I counted manually
123,124,133,134,144,233,234,244,334,344,444,
so 11 combinations.Is there a formula for it?

Answer & Explanation

ehedem26

ehedem26

Beginner2022-10-27Added 13 answers

Yes, you can do it with generating functions:
For the blue or red balls: 1 + x (either you take none or one).
For the yellow ball: 1 + x + x 2 (either you take none or one or two).
For the green ball: 1 + x + x 2 + x 3 (either you take none or one or two or three).
Hence the generating function for this problem would be:
( 1 + x ) 2 ( 1 + x + x 2 ) ( 1 + x + x 2 + x 3 ) = 1 + 4 x + 8 x 2 + 11 x 3 + 11 x 4 + 8 x 5 + 4 x 6 + x 7
The coefficient of x n is exactly the number of options to choose exactly n balls. Here, the coefficient of x 3 is 11, which is the number of options to choose 3 balls.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?