What is the probability of three consecutive results X and two results Y in an event?
up vote
4
down vote
favorite
I have N
number of days where three different events X,Y,Z
can occur in each day. A
is a set of possible occurrences of length N
. I want to calculate the number of ways where:
- Y does NOT happen twice or more in these number of days N
- X does NOT happen three times consecutively in these number of days N
So, one acceptable way where N=5
is A=[Z,Z,Z,Y,Z]
. One unacceptable way is where A=[X,X,X,Z,Z]
.
I was just going to find the number of days where Y
can occur two time, plus the number of days where x
happens three times consecutively, add then and subtract that from the total number of days possible, but that wouldn't give me the right answer because it is possible for there to be overlap in those days. I don't remember the right formula I need.
probability
This question has an open bounty worth +50
reputation from user3026388 ending in 3 days.
Looking for an answer drawing from credible and/or official sources.
|
show 1 more comment
up vote
4
down vote
favorite
I have N
number of days where three different events X,Y,Z
can occur in each day. A
is a set of possible occurrences of length N
. I want to calculate the number of ways where:
- Y does NOT happen twice or more in these number of days N
- X does NOT happen three times consecutively in these number of days N
So, one acceptable way where N=5
is A=[Z,Z,Z,Y,Z]
. One unacceptable way is where A=[X,X,X,Z,Z]
.
I was just going to find the number of days where Y
can occur two time, plus the number of days where x
happens three times consecutively, add then and subtract that from the total number of days possible, but that wouldn't give me the right answer because it is possible for there to be overlap in those days. I don't remember the right formula I need.
probability
This question has an open bounty worth +50
reputation from user3026388 ending in 3 days.
Looking for an answer drawing from credible and/or official sources.
To clarify, Y happens at most one time TOTAL, while X can happen many times, bot not three times in a row, correct?
– Todor Markov
Nov 20 at 12:44
This is a repeat of math.stackexchange.com/questions/2250558/… which is also equivalent to projecteuler.net/problem=191
– antkam
Nov 20 at 14:27
@TodorMarkov Yes, that is correct
– user3026388
Nov 20 at 16:37
Do you mean Y happens exactly twice or at least twice?
– Mostafa Ayaz
2 days ago
@MostafaAyaz I do not want Y to happen 2 or more times. Hope that clarifies
– user3026388
2 days ago
|
show 1 more comment
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I have N
number of days where three different events X,Y,Z
can occur in each day. A
is a set of possible occurrences of length N
. I want to calculate the number of ways where:
- Y does NOT happen twice or more in these number of days N
- X does NOT happen three times consecutively in these number of days N
So, one acceptable way where N=5
is A=[Z,Z,Z,Y,Z]
. One unacceptable way is where A=[X,X,X,Z,Z]
.
I was just going to find the number of days where Y
can occur two time, plus the number of days where x
happens three times consecutively, add then and subtract that from the total number of days possible, but that wouldn't give me the right answer because it is possible for there to be overlap in those days. I don't remember the right formula I need.
probability
I have N
number of days where three different events X,Y,Z
can occur in each day. A
is a set of possible occurrences of length N
. I want to calculate the number of ways where:
- Y does NOT happen twice or more in these number of days N
- X does NOT happen three times consecutively in these number of days N
So, one acceptable way where N=5
is A=[Z,Z,Z,Y,Z]
. One unacceptable way is where A=[X,X,X,Z,Z]
.
I was just going to find the number of days where Y
can occur two time, plus the number of days where x
happens three times consecutively, add then and subtract that from the total number of days possible, but that wouldn't give me the right answer because it is possible for there to be overlap in those days. I don't remember the right formula I need.
probability
probability
edited 2 days ago
asked Nov 14 at 23:40
user3026388
9610
9610
This question has an open bounty worth +50
reputation from user3026388 ending in 3 days.
Looking for an answer drawing from credible and/or official sources.
This question has an open bounty worth +50
reputation from user3026388 ending in 3 days.
Looking for an answer drawing from credible and/or official sources.
To clarify, Y happens at most one time TOTAL, while X can happen many times, bot not three times in a row, correct?
– Todor Markov
Nov 20 at 12:44
This is a repeat of math.stackexchange.com/questions/2250558/… which is also equivalent to projecteuler.net/problem=191
– antkam
Nov 20 at 14:27
@TodorMarkov Yes, that is correct
– user3026388
Nov 20 at 16:37
Do you mean Y happens exactly twice or at least twice?
– Mostafa Ayaz
2 days ago
@MostafaAyaz I do not want Y to happen 2 or more times. Hope that clarifies
– user3026388
2 days ago
|
show 1 more comment
To clarify, Y happens at most one time TOTAL, while X can happen many times, bot not three times in a row, correct?
– Todor Markov
Nov 20 at 12:44
This is a repeat of math.stackexchange.com/questions/2250558/… which is also equivalent to projecteuler.net/problem=191
– antkam
Nov 20 at 14:27
@TodorMarkov Yes, that is correct
– user3026388
Nov 20 at 16:37
Do you mean Y happens exactly twice or at least twice?
– Mostafa Ayaz
2 days ago
@MostafaAyaz I do not want Y to happen 2 or more times. Hope that clarifies
– user3026388
2 days ago
To clarify, Y happens at most one time TOTAL, while X can happen many times, bot not three times in a row, correct?
– Todor Markov
Nov 20 at 12:44
To clarify, Y happens at most one time TOTAL, while X can happen many times, bot not three times in a row, correct?
– Todor Markov
Nov 20 at 12:44
This is a repeat of math.stackexchange.com/questions/2250558/… which is also equivalent to projecteuler.net/problem=191
– antkam
Nov 20 at 14:27
This is a repeat of math.stackexchange.com/questions/2250558/… which is also equivalent to projecteuler.net/problem=191
– antkam
Nov 20 at 14:27
@TodorMarkov Yes, that is correct
– user3026388
Nov 20 at 16:37
@TodorMarkov Yes, that is correct
– user3026388
Nov 20 at 16:37
Do you mean Y happens exactly twice or at least twice?
– Mostafa Ayaz
2 days ago
Do you mean Y happens exactly twice or at least twice?
– Mostafa Ayaz
2 days ago
@MostafaAyaz I do not want Y to happen 2 or more times. Hope that clarifies
– user3026388
2 days ago
@MostafaAyaz I do not want Y to happen 2 or more times. Hope that clarifies
– user3026388
2 days ago
|
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
1
down vote
a) Y cannot appear two or more times
Then
- if Y does not appear, we are left with a binary (X,Z) string of length $n=N$;
- if Y appears once, by removing it, we are left with two binary (X,Z) string of length $n$ and $N-n-1$, with $0 le n le N-1$.
b) The string does not contain one (or more) runs of three (or more) consecutive X
Consider a binary string with $s$ $X; leftrightarrow ,1$'s and $m$ $Z; leftrightarrow ,0$'s in total.
The number of these strings in which the runs of consecutive ones have a length not greater than $r$, is given by
$$N_{,b} (s,r,m+1) = text{No}text{. of solutions to};left{ begin{gathered}
0 leqslant text{integer }x_{,j} leqslant r hfill \
x_{,1} + x_{,2} + cdots + x_{,m+1} = s hfill \
end{gathered} right.$$
which is equal to
$$
N_b (s,r,m + 1)quad left| {;0 leqslant text{integers }s,m,r} right.quad
= sumlimits_{left( {0, leqslant } right),,k,,left( { leqslant ,frac{s}{r}, leqslant ,m + 1} right)}
{left( { - 1} right)^k left( begin{gathered}
m + 1 \
k \
end{gathered} right)left( begin{gathered}
s + m - kleft( {r + 1} right) \
s - kleft( {r + 1} right) \
end{gathered} right)}
$$
as thoroughly explained in this and this other posts.
In our case $r=2$, and for a string of length $n$ we shall put $m=n-s$ and sum for $0 le s le n$
$$
S(n)quad = sumlimits_{left( {0, le } right),s,left( { le ,n} right)} {sumlimits_{left( {0, le } right),,k,,left( { le ,{s over 2},} right)}
{left( { - 1} right)^k binom{n-s+1}{k} binom{n-3k}{s-3k}
} }
$$
For $n=0,1,2,cdots ,6$ we obtain that $S(n)$ equals
$$1, 2, 4, 7, 13, 24, 44, cdots$$
c) Conclusion
Standing what said in point a) we can conclude that the sought number $T(N)$ is given by
$$
T(n) = S(N) + sumlimits_{0, le ,n, le ,N - 1} {S(n),S(N - 1 - n)}
$$
For $n=0,1,2,cdots ,8$ $T(n)$ results to be
$$1, 3, 8, 19, 43, 94, 200, 418, 861, cdots$$
which checks correctly with a direct count.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
a) Y cannot appear two or more times
Then
- if Y does not appear, we are left with a binary (X,Z) string of length $n=N$;
- if Y appears once, by removing it, we are left with two binary (X,Z) string of length $n$ and $N-n-1$, with $0 le n le N-1$.
b) The string does not contain one (or more) runs of three (or more) consecutive X
Consider a binary string with $s$ $X; leftrightarrow ,1$'s and $m$ $Z; leftrightarrow ,0$'s in total.
The number of these strings in which the runs of consecutive ones have a length not greater than $r$, is given by
$$N_{,b} (s,r,m+1) = text{No}text{. of solutions to};left{ begin{gathered}
0 leqslant text{integer }x_{,j} leqslant r hfill \
x_{,1} + x_{,2} + cdots + x_{,m+1} = s hfill \
end{gathered} right.$$
which is equal to
$$
N_b (s,r,m + 1)quad left| {;0 leqslant text{integers }s,m,r} right.quad
= sumlimits_{left( {0, leqslant } right),,k,,left( { leqslant ,frac{s}{r}, leqslant ,m + 1} right)}
{left( { - 1} right)^k left( begin{gathered}
m + 1 \
k \
end{gathered} right)left( begin{gathered}
s + m - kleft( {r + 1} right) \
s - kleft( {r + 1} right) \
end{gathered} right)}
$$
as thoroughly explained in this and this other posts.
In our case $r=2$, and for a string of length $n$ we shall put $m=n-s$ and sum for $0 le s le n$
$$
S(n)quad = sumlimits_{left( {0, le } right),s,left( { le ,n} right)} {sumlimits_{left( {0, le } right),,k,,left( { le ,{s over 2},} right)}
{left( { - 1} right)^k binom{n-s+1}{k} binom{n-3k}{s-3k}
} }
$$
For $n=0,1,2,cdots ,6$ we obtain that $S(n)$ equals
$$1, 2, 4, 7, 13, 24, 44, cdots$$
c) Conclusion
Standing what said in point a) we can conclude that the sought number $T(N)$ is given by
$$
T(n) = S(N) + sumlimits_{0, le ,n, le ,N - 1} {S(n),S(N - 1 - n)}
$$
For $n=0,1,2,cdots ,8$ $T(n)$ results to be
$$1, 3, 8, 19, 43, 94, 200, 418, 861, cdots$$
which checks correctly with a direct count.
add a comment |
up vote
1
down vote
a) Y cannot appear two or more times
Then
- if Y does not appear, we are left with a binary (X,Z) string of length $n=N$;
- if Y appears once, by removing it, we are left with two binary (X,Z) string of length $n$ and $N-n-1$, with $0 le n le N-1$.
b) The string does not contain one (or more) runs of three (or more) consecutive X
Consider a binary string with $s$ $X; leftrightarrow ,1$'s and $m$ $Z; leftrightarrow ,0$'s in total.
The number of these strings in which the runs of consecutive ones have a length not greater than $r$, is given by
$$N_{,b} (s,r,m+1) = text{No}text{. of solutions to};left{ begin{gathered}
0 leqslant text{integer }x_{,j} leqslant r hfill \
x_{,1} + x_{,2} + cdots + x_{,m+1} = s hfill \
end{gathered} right.$$
which is equal to
$$
N_b (s,r,m + 1)quad left| {;0 leqslant text{integers }s,m,r} right.quad
= sumlimits_{left( {0, leqslant } right),,k,,left( { leqslant ,frac{s}{r}, leqslant ,m + 1} right)}
{left( { - 1} right)^k left( begin{gathered}
m + 1 \
k \
end{gathered} right)left( begin{gathered}
s + m - kleft( {r + 1} right) \
s - kleft( {r + 1} right) \
end{gathered} right)}
$$
as thoroughly explained in this and this other posts.
In our case $r=2$, and for a string of length $n$ we shall put $m=n-s$ and sum for $0 le s le n$
$$
S(n)quad = sumlimits_{left( {0, le } right),s,left( { le ,n} right)} {sumlimits_{left( {0, le } right),,k,,left( { le ,{s over 2},} right)}
{left( { - 1} right)^k binom{n-s+1}{k} binom{n-3k}{s-3k}
} }
$$
For $n=0,1,2,cdots ,6$ we obtain that $S(n)$ equals
$$1, 2, 4, 7, 13, 24, 44, cdots$$
c) Conclusion
Standing what said in point a) we can conclude that the sought number $T(N)$ is given by
$$
T(n) = S(N) + sumlimits_{0, le ,n, le ,N - 1} {S(n),S(N - 1 - n)}
$$
For $n=0,1,2,cdots ,8$ $T(n)$ results to be
$$1, 3, 8, 19, 43, 94, 200, 418, 861, cdots$$
which checks correctly with a direct count.
add a comment |
up vote
1
down vote
up vote
1
down vote
a) Y cannot appear two or more times
Then
- if Y does not appear, we are left with a binary (X,Z) string of length $n=N$;
- if Y appears once, by removing it, we are left with two binary (X,Z) string of length $n$ and $N-n-1$, with $0 le n le N-1$.
b) The string does not contain one (or more) runs of three (or more) consecutive X
Consider a binary string with $s$ $X; leftrightarrow ,1$'s and $m$ $Z; leftrightarrow ,0$'s in total.
The number of these strings in which the runs of consecutive ones have a length not greater than $r$, is given by
$$N_{,b} (s,r,m+1) = text{No}text{. of solutions to};left{ begin{gathered}
0 leqslant text{integer }x_{,j} leqslant r hfill \
x_{,1} + x_{,2} + cdots + x_{,m+1} = s hfill \
end{gathered} right.$$
which is equal to
$$
N_b (s,r,m + 1)quad left| {;0 leqslant text{integers }s,m,r} right.quad
= sumlimits_{left( {0, leqslant } right),,k,,left( { leqslant ,frac{s}{r}, leqslant ,m + 1} right)}
{left( { - 1} right)^k left( begin{gathered}
m + 1 \
k \
end{gathered} right)left( begin{gathered}
s + m - kleft( {r + 1} right) \
s - kleft( {r + 1} right) \
end{gathered} right)}
$$
as thoroughly explained in this and this other posts.
In our case $r=2$, and for a string of length $n$ we shall put $m=n-s$ and sum for $0 le s le n$
$$
S(n)quad = sumlimits_{left( {0, le } right),s,left( { le ,n} right)} {sumlimits_{left( {0, le } right),,k,,left( { le ,{s over 2},} right)}
{left( { - 1} right)^k binom{n-s+1}{k} binom{n-3k}{s-3k}
} }
$$
For $n=0,1,2,cdots ,6$ we obtain that $S(n)$ equals
$$1, 2, 4, 7, 13, 24, 44, cdots$$
c) Conclusion
Standing what said in point a) we can conclude that the sought number $T(N)$ is given by
$$
T(n) = S(N) + sumlimits_{0, le ,n, le ,N - 1} {S(n),S(N - 1 - n)}
$$
For $n=0,1,2,cdots ,8$ $T(n)$ results to be
$$1, 3, 8, 19, 43, 94, 200, 418, 861, cdots$$
which checks correctly with a direct count.
a) Y cannot appear two or more times
Then
- if Y does not appear, we are left with a binary (X,Z) string of length $n=N$;
- if Y appears once, by removing it, we are left with two binary (X,Z) string of length $n$ and $N-n-1$, with $0 le n le N-1$.
b) The string does not contain one (or more) runs of three (or more) consecutive X
Consider a binary string with $s$ $X; leftrightarrow ,1$'s and $m$ $Z; leftrightarrow ,0$'s in total.
The number of these strings in which the runs of consecutive ones have a length not greater than $r$, is given by
$$N_{,b} (s,r,m+1) = text{No}text{. of solutions to};left{ begin{gathered}
0 leqslant text{integer }x_{,j} leqslant r hfill \
x_{,1} + x_{,2} + cdots + x_{,m+1} = s hfill \
end{gathered} right.$$
which is equal to
$$
N_b (s,r,m + 1)quad left| {;0 leqslant text{integers }s,m,r} right.quad
= sumlimits_{left( {0, leqslant } right),,k,,left( { leqslant ,frac{s}{r}, leqslant ,m + 1} right)}
{left( { - 1} right)^k left( begin{gathered}
m + 1 \
k \
end{gathered} right)left( begin{gathered}
s + m - kleft( {r + 1} right) \
s - kleft( {r + 1} right) \
end{gathered} right)}
$$
as thoroughly explained in this and this other posts.
In our case $r=2$, and for a string of length $n$ we shall put $m=n-s$ and sum for $0 le s le n$
$$
S(n)quad = sumlimits_{left( {0, le } right),s,left( { le ,n} right)} {sumlimits_{left( {0, le } right),,k,,left( { le ,{s over 2},} right)}
{left( { - 1} right)^k binom{n-s+1}{k} binom{n-3k}{s-3k}
} }
$$
For $n=0,1,2,cdots ,6$ we obtain that $S(n)$ equals
$$1, 2, 4, 7, 13, 24, 44, cdots$$
c) Conclusion
Standing what said in point a) we can conclude that the sought number $T(N)$ is given by
$$
T(n) = S(N) + sumlimits_{0, le ,n, le ,N - 1} {S(n),S(N - 1 - n)}
$$
For $n=0,1,2,cdots ,8$ $T(n)$ results to be
$$1, 3, 8, 19, 43, 94, 200, 418, 861, cdots$$
which checks correctly with a direct count.
edited 2 days ago
answered 2 days ago
G Cab
16.9k31237
16.9k31237
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2998975%2fwhat-is-the-probability-of-three-consecutive-results-x-and-two-results-y-in-an-e%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
To clarify, Y happens at most one time TOTAL, while X can happen many times, bot not three times in a row, correct?
– Todor Markov
Nov 20 at 12:44
This is a repeat of math.stackexchange.com/questions/2250558/… which is also equivalent to projecteuler.net/problem=191
– antkam
Nov 20 at 14:27
@TodorMarkov Yes, that is correct
– user3026388
Nov 20 at 16:37
Do you mean Y happens exactly twice or at least twice?
– Mostafa Ayaz
2 days ago
@MostafaAyaz I do not want Y to happen 2 or more times. Hope that clarifies
– user3026388
2 days ago