App that counts probabilities in c++

Click For Summary

Discussion Overview

The discussion revolves around calculating probabilities using C++ for a specific scenario involving rolling a die multiple times. Participants explore the application of the binomial distribution to determine the probability of rolling the number "5" exactly three times in six rolls.

Discussion Character

  • Technical explanation, Mathematical reasoning, Homework-related

Main Points Raised

  • One participant proposes using the binomial theorem to calculate the probability of rolling a specific number a certain number of times.
  • Another participant requests further explanation and resources to understand the binomial distribution better.
  • A link to the Wikipedia page on binomial distribution is provided as a resource for understanding the concept.
  • One participant mentions finding a resource called "Math is fun" and expresses a desire to understand how to apply the binomial distribution to their specific problem.
  • Another participant discusses the total number of possible sequences when rolling the die and questions how many of those sequences would include exactly three occurrences of the number "5".

Areas of Agreement / Disagreement

Participants generally agree on the use of the binomial distribution for the problem, but there is no consensus on the specific application or calculation methods, as some seek further clarification and resources.

Contextual Notes

Some participants express uncertainty regarding the application of the binomial distribution and the calculations involved, indicating a need for further exploration of the topic.

Hepic
Messages
118
Reaction score
0
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!
 
Technology news on Phys.org
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.
 
Can you explain more because I hear about that first time?

Or you could send me a tutorial??
 
Yea,I found an interesting site called "Math is fun",and I undestood it,but how I can count probabilities with that?
 
Hepic said:
Yea,I found an interesting 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?
 

Similar threads

Replies
3
Views
1K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 6 ·
Replies
6
Views
12K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 14 ·
Replies
14
Views
6K