# satitics and combinations

• Mar 23rd 2012, 09:52 AM
rt2121
satitics and combinations
Hi All,

I should say im dyslexic so my spelling will be awful. this is a problem for work. I have a set of 30 objects with known mass' if I randomly select a of 10 objects what are the total number of combinations I will get?. I have got 2 answers one of 2.3 x 10^15 the other 30 x10^6 aprox. what formular should I use ? selcondly for every combination im needing to know the standard deviation of every group this will invlove some code can people advise on formulars for calcs of the combinations and the code I would need to produce the std of each indiviudal group.

Regards

Ross
• Apr 17th 2012, 01:11 AM
Bingk
Re: satitics and combinations
I believe you should use nCr, not nPr. Say you have 10 of the objects labelled 1,2,3,...,10. nPr will count each possible arrangement of those 10 objects (i.e., if you picked object 1 first, 2 second, etc. it will be different from if you picked 10 first, 9 second, etc. even though you have the same 10 objects). So the approximately 30 million combinations would be correct.
I can't think of any "shortcut" for the standard deviation part, but there's a way to get all 30+ million combinations. If you label the objects from 1 to 30, then the combinations will be $\left\{ \left$$i_1, i_2, \dots, i_{10} \right$$ : 1 \leq i_1, i_2, \dots, i_{10} \leq 30 \ \text{and} \ i_1 < i_2 < \dots < i_{10} \right\}$.

You can think of it this way, your first combination is 1,2,3,4,5,6,7,8,9,10. Increase the right most (number 10) by 1. That's another combination. Keep increasing the right most number by 1 (each time you do so will be another combination) until you can't (i.e. the right most number cannot exceed 30). When you can't increase the right most number, increase the number to its left by 1 and the right most number will be 1 more than that (i.e. after 1,2,3,4,5,6,7,8,9,30 is 1,2,3,4,5,6,7,8,10,11). It's kind of tedious, but basically you keep increasing the right most number until it's 30, when you reach that, increase the number to its left by 1, and it will be 1 more than the number to its left. Eventually you'll come to a point where you can't increase the two right most numbers, but you follow the same thing, increase the number to the left of those two by 1, then the number next to it will be one more, and each succeeding number to the right will be 1 more. Once you do that, you go back to increasing the right most number by 1. Example: When you're at 1,2,3,4,5,6,7,8,29,30 you can't increase the two right most numbers, so the next number is 1,2,3,4,5,6,7,9,10,11. You'll eventually get something like 5,22,23,24,25,26,27,28,29,30 which will be followed by 6,7,8,9,10,11,12,13,14,15. The last one will be 21,22,23,24,25,26,27,28,29,30, where the left most number can't be increased any more, so you stop.