programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Paul Clapham
• Ron McLeod
• Jeanne Boyarsky
• Tim Cooke
Sheriffs:
• Liutauras Vilda
• paul wheaton
• Henry Wong
Saloon Keepers:
• Tim Moores
• Tim Holloway
• Stephan van Hulst
• Carey Brown
• Frits Walraven
Bartenders:
• Piet Souris
• Himai Minh

posibility

Ranch Hand
Posts: 43
• Number of slices to send:
Optional 'thank-you' note:
Hi,
Does anybody know the formula to claculate the posibility

ex. I have 10 numbers and i wanna choose 5 numbers randomly.
What is the formula to find out how many different group of 5 numbers I can choose.

Bartender
Posts: 6663
5
• Number of slices to send:
Optional 'thank-you' note:
You are talking about probability theory. Go through some math books

lowercase baba
Posts: 13050
67
• Number of slices to send:
Optional 'thank-you' note:
That depends. is the subset (1,2,3,4,5) considered the same as (5,4,3,2,1) or not?

is the subset (1,1,1,1,1) valid?

the formula is different for each of these, but try googling "Permutations" and "Combinations".

Ranch Hand
Posts: 63
• Number of slices to send:
Optional 'thank-you' note:
Look for the combinatory number:
C(n,m)=n!/(m!(n-m)!)
I think this can be what you're looking for.

Ranch Hand
Posts: 2108
• Number of slices to send:
Optional 'thank-you' note:
Umut, as previously suggested, you need to look at the theories behind it. After you know the theory, you will know what to program. There are a lot of factors on probabilities, e.g. repetitions allowed or not, etc.

umut uzumcu
Ranch Hand
Posts: 43
• Number of slices to send:
Optional 'thank-you' note:
I m looking for all different possibilities,
Not less or more than 5 numbers.
no repetition of the same number in the group. (1,2,1,3,5) is not valid
order doesnt make difference (1,2,3,4,5) and (5,4,3,2,1) are same

Pablo Muller
The formula you send
C(n,m)=n!/(m!(n-m)!)
I think this is what i was looking for.

thank you all

 Doody calls. I would really rather that it didn't. Comfort me wise and sterile tiny ad: Free, earth friendly heat - from the CodeRanch trailboss https://www.kickstarter.com/projects/paulwheaton/free-heat