- Thread starter Lue76
- Start date

- Joined
- Feb 4, 2004

- Messages
- 15,945

Are you sure you're supposed to be finding "combinations", and not "permutations"?Hi, I have 33 checkboxes that can be ticked.

If you can tick any number of boxes on each turn 1, 2, 3, up to 33. How many combinations can there be?

When you reply, please include the full and exact text of the exercise, the complete instructions, and a clear listing of your thoughts and efforts so far. Thank you!

Are you sure you're supposed to be finding "combinations", and not "permutations"?

When you reply, please include the full and exact text of the exercise, the complete instructions, and a clear listing of your thoughts and efforts so far. Thank you!

Yes I think you could be right. One thing I don't want counted is the same boxes ticked just in a different order.

example:

Box 1: red

Box 2: green

Box 3. Yellow

Box 4. Blue

Box 5. Orange

These checkboxes will show all products that are that colour. I want to know (out of the 33 checkboxes I have), how many different reports can be ran, if I can choose any number of boxes in one report.

e.g. report 1. red

report 2. red and green

report 3. red and green and yellow

What I

e.g. report 4. green red and yellow (same boxes as report 3 but in a different order).

- Joined
- Oct 6, 2005

- Messages
- 10,257

Oops. Based on what you wrote first, I think you intended to say "combination over permutation".Yes I think you could be right …Are you sure you're supposed to be finding "combinations", and not "permutations"?

What Idon't wantto count is the same boxes but in a different order, (so I think you're right, it would be permutation over combination).

With combinations, order does not matter.

Red,Blue,Green,Yellow,Orange is the same combination as Green,Blue,Red,Yellow,Orange. We would not count both of them, if counting combinations. (However, they are two different "permutations".)

Is this exercise from a math class?

Are you familiar with any of the notations below?

nCr

n Choose r

C(n,r)

They're all different ways of representing the same thing: number of combinations (subsets) that can be formed by picking r objects from a set of n objects.

Are you familiar with factorials? There's a formula for calculating nCr (combinations); it uses factorials.

\(\displaystyle C(n,r) = \dfrac{n!}{r! (n-r)!}\)

You could do this calculation for every possible value of r (from zero through 33), and add the results. In other words:

How many ways to choose 0 boxes from 33 boxes? C(33,0) = 1

How many ways to choose 1 boxes from 33 boxes? C(33,1) = 33

How many ways to choose 2 boxes from 33 boxes? C(33,2) = 528

How many ways to choose 3 boxes from 33 boxes? C(33,3) = 5456

… et cetera …

How many ways to choose 30 boxes from 33 boxes? C(33,30) = 5456

How many ways to choose 31 boxes from 33 boxes? C(33,31) = 528

How many ways to choose 32 boxes from 33 boxes? C(33,32) = 33

How many ways to choose 33 boxes from 33 boxes? C(33,33) = 1

Oh look! A pattern. Perhaps there's a way to cut your work in half? Think about that!

There's also an overall shortcut, to get the grand total without using C(n,r), but I hesitate to discuss it without knowing whether you're doing homework. (The shortcut has to do with Pascal's Triangle and powers of two.)

PS: The total you're looking for is more than 8.5 billion.

Wow I didn't realise how many it would be. You're definitely right it is combinations.Oops. Based on what you wrote first, I think you intended to say "combination over permutation".

With combinations, order does not matter.

Red,Blue,Green,Yellow,Orange is the same combination as Green,Blue,Red,Yellow,Orange. We would not count both of them, if counting combinations. (However, they are two different "permutations".)

Is this exercise from a math class?

Are you familiar with any of the notations below?

nCr

n Choose r

C(n,r)

They're all different ways of representing the same thing: number of combinations (subsets) that can be formed by picking r objects from a set of n objects.

Are you familiar with factorials? There's a formula for calculating nCr (combinations); it uses factorials.

\(\displaystyle C(n,r) = \dfrac{n!}{r! (n-r)!}\)

You could do this calculation for every possible value of r (from zero through 33), and add the results. In other words:

How many ways to choose 0 boxes from 33 boxes? C(33,0) = 1

How many ways to choose 1 boxes from 33 boxes? C(33,1) = 33

How many ways to choose 2 boxes from 33 boxes? C(33,2) = 528

How many ways to choose 3 boxes from 33 boxes? C(33,3) = 5456

… et cetera …

How many ways to choose 30 boxes from 33 boxes? C(33,30) = 5456

How many ways to choose 31 boxes from 33 boxes? C(33,31) = 528

How many ways to choose 32 boxes from 33 boxes? C(33,32) = 33

How many ways to choose 33 boxes from 33 boxes? C(33,33) = 1

Oh look! A pattern. Perhaps there's a way to cut your work in half? Think about that!

There's also an overall shortcut, to get the grand total without using C(n,r), but I hesitate to discuss it without knowing whether you're doing homework. (The shortcut has to do with Pascal's Triangle and powers of two.)

PS: The total you're looking for is more than 8.5 billion.

No don't worry it is not for homework (although I'm thinking I should have done more of my maths homework in the first place and I would have been able to work this out myself).

It's for an unrealistic request to write a test for every possible combination for these check boxes for work... I now know my answer will be **** no!

- Joined
- Oct 6, 2005

- Messages
- 10,257

Ah. Well, the shortcut is 2Wow I didn't realise how many it would be.

… it is not for homework … It's for an unrealistic request to write a test for every possible combination for these check boxes for work …

2

Sounds like a job for a computer to test, not you. Cheers :cool: