If you have the following, how would you calculate the percentages of each.
Say you have 4 chances
75% chance to produce 1
75% chance to produce 1
25% chance to produce 1
25% chance to produce 1
What are the chances for 0,1,2,3,4 and how do you find them?
if anybody is wondering, I'm working an algorithm for genes from only 1 parent and I need to find the chances a parent will pass on said gene.
Edit (by a mathematician) hoping I've helped clarify the question:
I have four independent trials, two with probability of success $0.75$, two with probability $0.25$. What are the probabilities for each possible total number of successes?
The general problem: $n$ trials with success probability $p_k$ on the $k$th trial.
Edit (by OP) I don't know how to explain this so I'll just write it in the code I use. Maybe it will be easier to understand this way.
$x = 0;
if(rand(1,100) >= 75){
$x = $x+1;
}
if(rand(1,100) >= 75){
$x = $x+1;
}
if(rand(1,100) >= 25){
$x = $x+1;
}
if(rand(1,100) >= 25){
$x = $x+1;
}
What is the chance $x will be 0?
What is the chance $x will be 1?
What is the chance $x will be 2?
What is the chance $x will be 3?
What is the chance $x will be 4?
How did you find it?(so that I can figure it out myself for other cases)