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 .

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.