Probabilities of set number of events happening from multiple different probability events












0












$begingroup$


I have 10 independent events and I would like to be able to work out the probability of EXACTLY 2,3,4,5 etc. happening, I can gain the probability of 1 happening by taking the probability of the sum of any happening and I can get the probability of more than 1 happening by taking away the probability of 0 happening, I can also get chances of 2 happening by taking away the chance of just 1 happening from the chance of 0, but I am struggling with how I can do this with exactly 2 without individually calculating the chances of event 1 & 2, chances of event 1 & 3, so on and so forth. Is there a way to do this with Excel/Google Sheets? I looked into binomial distribution but I think this requires the probability of each event to be the same.



Not a hugely maths savvy person, so your patience (and simplicity) in answering would be much appreciated.



The table shows the probabilities I have for the 10 events.



table










share|cite|improve this question











$endgroup$












  • $begingroup$
    What does the "1 Winning" column represent?
    $endgroup$
    – saulspatz
    Jan 8 at 13:13










  • $begingroup$
    Ah, sorry, that is the chance of that event winning and all others losing.
    $endgroup$
    – N App
    Jan 8 at 13:28










  • $begingroup$
    I thought that's what you meant, but I don't get the same answers. For the probability that the first event wins and the others lose, for example, I get $4.36%$
    $endgroup$
    – saulspatz
    Jan 8 at 13:30












  • $begingroup$
    Hmm, my numbers are rounded, could that be the difference, here is the link to the Google Sheet if that helps.. docs.google.com/spreadsheets/d/…
    $endgroup$
    – N App
    Jan 8 at 13:33










  • $begingroup$
    The difference is too large to be explained by rounding, and I can't follow the spreadsheet. The first entry in the "1 winning" column should be computed as $$.2714cdot.6241cdot.5327cdots.7368$$ Is that what you did?
    $endgroup$
    – saulspatz
    Jan 8 at 13:38


















0












$begingroup$


I have 10 independent events and I would like to be able to work out the probability of EXACTLY 2,3,4,5 etc. happening, I can gain the probability of 1 happening by taking the probability of the sum of any happening and I can get the probability of more than 1 happening by taking away the probability of 0 happening, I can also get chances of 2 happening by taking away the chance of just 1 happening from the chance of 0, but I am struggling with how I can do this with exactly 2 without individually calculating the chances of event 1 & 2, chances of event 1 & 3, so on and so forth. Is there a way to do this with Excel/Google Sheets? I looked into binomial distribution but I think this requires the probability of each event to be the same.



Not a hugely maths savvy person, so your patience (and simplicity) in answering would be much appreciated.



The table shows the probabilities I have for the 10 events.



table










share|cite|improve this question











$endgroup$












  • $begingroup$
    What does the "1 Winning" column represent?
    $endgroup$
    – saulspatz
    Jan 8 at 13:13










  • $begingroup$
    Ah, sorry, that is the chance of that event winning and all others losing.
    $endgroup$
    – N App
    Jan 8 at 13:28










  • $begingroup$
    I thought that's what you meant, but I don't get the same answers. For the probability that the first event wins and the others lose, for example, I get $4.36%$
    $endgroup$
    – saulspatz
    Jan 8 at 13:30












  • $begingroup$
    Hmm, my numbers are rounded, could that be the difference, here is the link to the Google Sheet if that helps.. docs.google.com/spreadsheets/d/…
    $endgroup$
    – N App
    Jan 8 at 13:33










  • $begingroup$
    The difference is too large to be explained by rounding, and I can't follow the spreadsheet. The first entry in the "1 winning" column should be computed as $$.2714cdot.6241cdot.5327cdots.7368$$ Is that what you did?
    $endgroup$
    – saulspatz
    Jan 8 at 13:38
















0












0








0





$begingroup$


I have 10 independent events and I would like to be able to work out the probability of EXACTLY 2,3,4,5 etc. happening, I can gain the probability of 1 happening by taking the probability of the sum of any happening and I can get the probability of more than 1 happening by taking away the probability of 0 happening, I can also get chances of 2 happening by taking away the chance of just 1 happening from the chance of 0, but I am struggling with how I can do this with exactly 2 without individually calculating the chances of event 1 & 2, chances of event 1 & 3, so on and so forth. Is there a way to do this with Excel/Google Sheets? I looked into binomial distribution but I think this requires the probability of each event to be the same.



Not a hugely maths savvy person, so your patience (and simplicity) in answering would be much appreciated.



The table shows the probabilities I have for the 10 events.



table










share|cite|improve this question











$endgroup$




I have 10 independent events and I would like to be able to work out the probability of EXACTLY 2,3,4,5 etc. happening, I can gain the probability of 1 happening by taking the probability of the sum of any happening and I can get the probability of more than 1 happening by taking away the probability of 0 happening, I can also get chances of 2 happening by taking away the chance of just 1 happening from the chance of 0, but I am struggling with how I can do this with exactly 2 without individually calculating the chances of event 1 & 2, chances of event 1 & 3, so on and so forth. Is there a way to do this with Excel/Google Sheets? I looked into binomial distribution but I think this requires the probability of each event to be the same.



Not a hugely maths savvy person, so your patience (and simplicity) in answering would be much appreciated.



The table shows the probabilities I have for the 10 events.



table







probability






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Jan 8 at 12:54









N. F. Taussig

44k93356




44k93356










asked Jan 8 at 12:51









N AppN App

31




31












  • $begingroup$
    What does the "1 Winning" column represent?
    $endgroup$
    – saulspatz
    Jan 8 at 13:13










  • $begingroup$
    Ah, sorry, that is the chance of that event winning and all others losing.
    $endgroup$
    – N App
    Jan 8 at 13:28










  • $begingroup$
    I thought that's what you meant, but I don't get the same answers. For the probability that the first event wins and the others lose, for example, I get $4.36%$
    $endgroup$
    – saulspatz
    Jan 8 at 13:30












  • $begingroup$
    Hmm, my numbers are rounded, could that be the difference, here is the link to the Google Sheet if that helps.. docs.google.com/spreadsheets/d/…
    $endgroup$
    – N App
    Jan 8 at 13:33










  • $begingroup$
    The difference is too large to be explained by rounding, and I can't follow the spreadsheet. The first entry in the "1 winning" column should be computed as $$.2714cdot.6241cdot.5327cdots.7368$$ Is that what you did?
    $endgroup$
    – saulspatz
    Jan 8 at 13:38




















  • $begingroup$
    What does the "1 Winning" column represent?
    $endgroup$
    – saulspatz
    Jan 8 at 13:13










  • $begingroup$
    Ah, sorry, that is the chance of that event winning and all others losing.
    $endgroup$
    – N App
    Jan 8 at 13:28










  • $begingroup$
    I thought that's what you meant, but I don't get the same answers. For the probability that the first event wins and the others lose, for example, I get $4.36%$
    $endgroup$
    – saulspatz
    Jan 8 at 13:30












  • $begingroup$
    Hmm, my numbers are rounded, could that be the difference, here is the link to the Google Sheet if that helps.. docs.google.com/spreadsheets/d/…
    $endgroup$
    – N App
    Jan 8 at 13:33










  • $begingroup$
    The difference is too large to be explained by rounding, and I can't follow the spreadsheet. The first entry in the "1 winning" column should be computed as $$.2714cdot.6241cdot.5327cdots.7368$$ Is that what you did?
    $endgroup$
    – saulspatz
    Jan 8 at 13:38


















$begingroup$
What does the "1 Winning" column represent?
$endgroup$
– saulspatz
Jan 8 at 13:13




$begingroup$
What does the "1 Winning" column represent?
$endgroup$
– saulspatz
Jan 8 at 13:13












$begingroup$
Ah, sorry, that is the chance of that event winning and all others losing.
$endgroup$
– N App
Jan 8 at 13:28




$begingroup$
Ah, sorry, that is the chance of that event winning and all others losing.
$endgroup$
– N App
Jan 8 at 13:28












$begingroup$
I thought that's what you meant, but I don't get the same answers. For the probability that the first event wins and the others lose, for example, I get $4.36%$
$endgroup$
– saulspatz
Jan 8 at 13:30






$begingroup$
I thought that's what you meant, but I don't get the same answers. For the probability that the first event wins and the others lose, for example, I get $4.36%$
$endgroup$
– saulspatz
Jan 8 at 13:30














$begingroup$
Hmm, my numbers are rounded, could that be the difference, here is the link to the Google Sheet if that helps.. docs.google.com/spreadsheets/d/…
$endgroup$
– N App
Jan 8 at 13:33




$begingroup$
Hmm, my numbers are rounded, could that be the difference, here is the link to the Google Sheet if that helps.. docs.google.com/spreadsheets/d/…
$endgroup$
– N App
Jan 8 at 13:33












$begingroup$
The difference is too large to be explained by rounding, and I can't follow the spreadsheet. The first entry in the "1 winning" column should be computed as $$.2714cdot.6241cdot.5327cdots.7368$$ Is that what you did?
$endgroup$
– saulspatz
Jan 8 at 13:38






$begingroup$
The difference is too large to be explained by rounding, and I can't follow the spreadsheet. The first entry in the "1 winning" column should be computed as $$.2714cdot.6241cdot.5327cdots.7368$$ Is that what you did?
$endgroup$
– saulspatz
Jan 8 at 13:38












1 Answer
1






active

oldest

votes


















0












$begingroup$

Here is a python script that computes the probabilities you want:



from collections import defaultdict

p = [.2174, .3759, .4673, .0769, .0357, .2632, .2632]
N = len(p)

def bitsum(n):
'Number of 1 bits in n'
count = 0
while n:
count +=1
n &= n-1
return count

def prob(v):
'''
v is a bit vector indicating which events occurs
v[k]==1 iff event k occurs
'''
answer = 1
for k in range(N):
v,r = divmod(v,2)
answer *= p[k] if r else (1-p[k])
return answer

exact = defaultdict(float)
for v in range(2**N):
exact[bitsum(v)] += prob(v)

for k in range(N+1):
print('probability exactly', k, 'events occur', exact[k])

print('Sum of computed probabilities', sum(exact.values()))


This produces the output:



probability exactly 0 events occur 0.12572940926350773
probability exactly 1 events occur 0.32590285691607773
probability exactly 2 events occur 0.3297864319159991
probability exactly 3 events occur 0.1671225468059581
probability exactly 4 events occur 0.0449221573418514
probability exactly 5 events occur 0.006158839703878074
probability exactly 6 events occur 0.0003704954218414138
probability exactly 7 events occur 7.262630886494916e-06
Sum of computed probabilities 1.0000000000000002


The script just computes the probability of each of the $128$ possible outcomes, and tosses it into the appropriate bin. Since the last $3$ events never occur, I just ignored them.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    That's awesome, thanks a lot.
    $endgroup$
    – N App
    Jan 8 at 14:47











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3066127%2fprobabilities-of-set-number-of-events-happening-from-multiple-different-probabil%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0












$begingroup$

Here is a python script that computes the probabilities you want:



from collections import defaultdict

p = [.2174, .3759, .4673, .0769, .0357, .2632, .2632]
N = len(p)

def bitsum(n):
'Number of 1 bits in n'
count = 0
while n:
count +=1
n &= n-1
return count

def prob(v):
'''
v is a bit vector indicating which events occurs
v[k]==1 iff event k occurs
'''
answer = 1
for k in range(N):
v,r = divmod(v,2)
answer *= p[k] if r else (1-p[k])
return answer

exact = defaultdict(float)
for v in range(2**N):
exact[bitsum(v)] += prob(v)

for k in range(N+1):
print('probability exactly', k, 'events occur', exact[k])

print('Sum of computed probabilities', sum(exact.values()))


This produces the output:



probability exactly 0 events occur 0.12572940926350773
probability exactly 1 events occur 0.32590285691607773
probability exactly 2 events occur 0.3297864319159991
probability exactly 3 events occur 0.1671225468059581
probability exactly 4 events occur 0.0449221573418514
probability exactly 5 events occur 0.006158839703878074
probability exactly 6 events occur 0.0003704954218414138
probability exactly 7 events occur 7.262630886494916e-06
Sum of computed probabilities 1.0000000000000002


The script just computes the probability of each of the $128$ possible outcomes, and tosses it into the appropriate bin. Since the last $3$ events never occur, I just ignored them.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    That's awesome, thanks a lot.
    $endgroup$
    – N App
    Jan 8 at 14:47
















0












$begingroup$

Here is a python script that computes the probabilities you want:



from collections import defaultdict

p = [.2174, .3759, .4673, .0769, .0357, .2632, .2632]
N = len(p)

def bitsum(n):
'Number of 1 bits in n'
count = 0
while n:
count +=1
n &= n-1
return count

def prob(v):
'''
v is a bit vector indicating which events occurs
v[k]==1 iff event k occurs
'''
answer = 1
for k in range(N):
v,r = divmod(v,2)
answer *= p[k] if r else (1-p[k])
return answer

exact = defaultdict(float)
for v in range(2**N):
exact[bitsum(v)] += prob(v)

for k in range(N+1):
print('probability exactly', k, 'events occur', exact[k])

print('Sum of computed probabilities', sum(exact.values()))


This produces the output:



probability exactly 0 events occur 0.12572940926350773
probability exactly 1 events occur 0.32590285691607773
probability exactly 2 events occur 0.3297864319159991
probability exactly 3 events occur 0.1671225468059581
probability exactly 4 events occur 0.0449221573418514
probability exactly 5 events occur 0.006158839703878074
probability exactly 6 events occur 0.0003704954218414138
probability exactly 7 events occur 7.262630886494916e-06
Sum of computed probabilities 1.0000000000000002


The script just computes the probability of each of the $128$ possible outcomes, and tosses it into the appropriate bin. Since the last $3$ events never occur, I just ignored them.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    That's awesome, thanks a lot.
    $endgroup$
    – N App
    Jan 8 at 14:47














0












0








0





$begingroup$

Here is a python script that computes the probabilities you want:



from collections import defaultdict

p = [.2174, .3759, .4673, .0769, .0357, .2632, .2632]
N = len(p)

def bitsum(n):
'Number of 1 bits in n'
count = 0
while n:
count +=1
n &= n-1
return count

def prob(v):
'''
v is a bit vector indicating which events occurs
v[k]==1 iff event k occurs
'''
answer = 1
for k in range(N):
v,r = divmod(v,2)
answer *= p[k] if r else (1-p[k])
return answer

exact = defaultdict(float)
for v in range(2**N):
exact[bitsum(v)] += prob(v)

for k in range(N+1):
print('probability exactly', k, 'events occur', exact[k])

print('Sum of computed probabilities', sum(exact.values()))


This produces the output:



probability exactly 0 events occur 0.12572940926350773
probability exactly 1 events occur 0.32590285691607773
probability exactly 2 events occur 0.3297864319159991
probability exactly 3 events occur 0.1671225468059581
probability exactly 4 events occur 0.0449221573418514
probability exactly 5 events occur 0.006158839703878074
probability exactly 6 events occur 0.0003704954218414138
probability exactly 7 events occur 7.262630886494916e-06
Sum of computed probabilities 1.0000000000000002


The script just computes the probability of each of the $128$ possible outcomes, and tosses it into the appropriate bin. Since the last $3$ events never occur, I just ignored them.






share|cite|improve this answer









$endgroup$



Here is a python script that computes the probabilities you want:



from collections import defaultdict

p = [.2174, .3759, .4673, .0769, .0357, .2632, .2632]
N = len(p)

def bitsum(n):
'Number of 1 bits in n'
count = 0
while n:
count +=1
n &= n-1
return count

def prob(v):
'''
v is a bit vector indicating which events occurs
v[k]==1 iff event k occurs
'''
answer = 1
for k in range(N):
v,r = divmod(v,2)
answer *= p[k] if r else (1-p[k])
return answer

exact = defaultdict(float)
for v in range(2**N):
exact[bitsum(v)] += prob(v)

for k in range(N+1):
print('probability exactly', k, 'events occur', exact[k])

print('Sum of computed probabilities', sum(exact.values()))


This produces the output:



probability exactly 0 events occur 0.12572940926350773
probability exactly 1 events occur 0.32590285691607773
probability exactly 2 events occur 0.3297864319159991
probability exactly 3 events occur 0.1671225468059581
probability exactly 4 events occur 0.0449221573418514
probability exactly 5 events occur 0.006158839703878074
probability exactly 6 events occur 0.0003704954218414138
probability exactly 7 events occur 7.262630886494916e-06
Sum of computed probabilities 1.0000000000000002


The script just computes the probability of each of the $128$ possible outcomes, and tosses it into the appropriate bin. Since the last $3$ events never occur, I just ignored them.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Jan 8 at 14:39









saulspatzsaulspatz

14.5k21329




14.5k21329












  • $begingroup$
    That's awesome, thanks a lot.
    $endgroup$
    – N App
    Jan 8 at 14:47


















  • $begingroup$
    That's awesome, thanks a lot.
    $endgroup$
    – N App
    Jan 8 at 14:47
















$begingroup$
That's awesome, thanks a lot.
$endgroup$
– N App
Jan 8 at 14:47




$begingroup$
That's awesome, thanks a lot.
$endgroup$
– N App
Jan 8 at 14:47


















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3066127%2fprobabilities-of-set-number-of-events-happening-from-multiple-different-probabil%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith