app that counts probabilities in c++


by Hepic
Tags: counts, probabilities
Hepic
Hepic is offline
#1
Jan8-14, 03:45 PM
P: 99
Hey,I am making an app that counts probabilities in c++(win32){for those who knows}.
I have found three formulas of equation,but I need some help for one.

For example we have a die,and we hit it 6 times.
Can we count with an formula,the probabilities to have the number "5",three times exactly?(no less,no more)

Thanks!!!
Phys.Org News Partner Mathematics news on Phys.org
Math modeling handbook now available
Hyperbolic homogeneous polynomials, oh my!
Researchers help Boston Marathon organizers plan for 2014 race
mathman
mathman is offline
#2
Jan8-14, 04:27 PM
Sci Advisor
P: 5,941
Use the binomial theorem.
k out of n with probability p of success on one roll (q=1-p), is pkq(n-k)n!/{k!(n-k)!}.
Your example: n = 6, k = 3, p = 1/6.
Hepic
Hepic is offline
#3
Jan9-14, 06:45 AM
P: 99
Can you explain more because I hear about that first time?

Or you could send me a tutorial??

mathman
mathman is offline
#4
Jan9-14, 03:21 PM
Sci Advisor
P: 5,941

app that counts probabilities in c++


http://en.wikipedia.org/wiki/Binomial_distribution

Start here. Google "binomial distribution" to get more links.
Hepic
Hepic is offline
#5
Jan9-14, 03:30 PM
P: 99
Yea,I found an intersting site called "Math is fun",and I undestood it,but how I can count probabilities with that?
Nugatory
Nugatory is offline
#6
Jan9-14, 04:08 PM
Sci Advisor
Thanks
P: 2,972
Quote Quote by Hepic View Post
Yea,I found an intersting site called "Math is fun",and I undestood it,but how I can count probabilities with that?
For the example in your original post:

You cast the die six times, so there are ##6^6## equally likely sequences of results. Because they are equally likely, the probability of getting any given sequence is one in ##6^6##. How many of these sequences include exactly three fives?


Register to reply

Related Discussions
C,C++,C#:System programming and Application programming Programming & Computer Science 9
Recommended programming language (and texts) for middle-school beginner programming Programming & Computer Science 9
Help with probabilities Precalculus Mathematics Homework 0
Probabilities Precalculus Mathematics Homework 3
probabilities Precalculus Mathematics Homework 5