Number of k consecutive 1's subsequences in a binary string.
$begingroup$
Say a sequence ${X_1, X_2,ldots ,X_n}$ is given, where $X_p$ is either one or zero ($0 < p < n$) with
probability $frac{1}{2}$ each. Let $N_k$ be the number of consecutive 1's subsequences of length k in ${X_1, X_2,ldots ,X_n}$,what is $Bbb E[N_k]$?
Example: in the sequence $1110011$ we have $N_2=3.$
probability expected-value
$endgroup$
add a comment |
$begingroup$
Say a sequence ${X_1, X_2,ldots ,X_n}$ is given, where $X_p$ is either one or zero ($0 < p < n$) with
probability $frac{1}{2}$ each. Let $N_k$ be the number of consecutive 1's subsequences of length k in ${X_1, X_2,ldots ,X_n}$,what is $Bbb E[N_k]$?
Example: in the sequence $1110011$ we have $N_2=3.$
probability expected-value
$endgroup$
$begingroup$
Hint: use linearity. if $iin {1,cdots, n-(k-1)}$ then $i$ can be the start of a consecutive sequence of $k$ $1's$ so let $X_i$ be the indicator value of that event and work from there.
$endgroup$
– lulu
Dec 19 '18 at 12:13
$begingroup$
If there is a subsequence of $N_{k+2}$, for instance, does that contain 3 $N_k$ sequences, 1, or none? In other words does it have to be exactly k long to count?
$endgroup$
– player100
Dec 19 '18 at 12:24
$begingroup$
It does not have to be exactly k,I added an example for clearance.@player100
$endgroup$
– Adddison
Dec 19 '18 at 12:29
add a comment |
$begingroup$
Say a sequence ${X_1, X_2,ldots ,X_n}$ is given, where $X_p$ is either one or zero ($0 < p < n$) with
probability $frac{1}{2}$ each. Let $N_k$ be the number of consecutive 1's subsequences of length k in ${X_1, X_2,ldots ,X_n}$,what is $Bbb E[N_k]$?
Example: in the sequence $1110011$ we have $N_2=3.$
probability expected-value
$endgroup$
Say a sequence ${X_1, X_2,ldots ,X_n}$ is given, where $X_p$ is either one or zero ($0 < p < n$) with
probability $frac{1}{2}$ each. Let $N_k$ be the number of consecutive 1's subsequences of length k in ${X_1, X_2,ldots ,X_n}$,what is $Bbb E[N_k]$?
Example: in the sequence $1110011$ we have $N_2=3.$
probability expected-value
probability expected-value
edited Dec 19 '18 at 12:28
Adddison
asked Dec 19 '18 at 12:10
AdddisonAdddison
847
847
$begingroup$
Hint: use linearity. if $iin {1,cdots, n-(k-1)}$ then $i$ can be the start of a consecutive sequence of $k$ $1's$ so let $X_i$ be the indicator value of that event and work from there.
$endgroup$
– lulu
Dec 19 '18 at 12:13
$begingroup$
If there is a subsequence of $N_{k+2}$, for instance, does that contain 3 $N_k$ sequences, 1, or none? In other words does it have to be exactly k long to count?
$endgroup$
– player100
Dec 19 '18 at 12:24
$begingroup$
It does not have to be exactly k,I added an example for clearance.@player100
$endgroup$
– Adddison
Dec 19 '18 at 12:29
add a comment |
$begingroup$
Hint: use linearity. if $iin {1,cdots, n-(k-1)}$ then $i$ can be the start of a consecutive sequence of $k$ $1's$ so let $X_i$ be the indicator value of that event and work from there.
$endgroup$
– lulu
Dec 19 '18 at 12:13
$begingroup$
If there is a subsequence of $N_{k+2}$, for instance, does that contain 3 $N_k$ sequences, 1, or none? In other words does it have to be exactly k long to count?
$endgroup$
– player100
Dec 19 '18 at 12:24
$begingroup$
It does not have to be exactly k,I added an example for clearance.@player100
$endgroup$
– Adddison
Dec 19 '18 at 12:29
$begingroup$
Hint: use linearity. if $iin {1,cdots, n-(k-1)}$ then $i$ can be the start of a consecutive sequence of $k$ $1's$ so let $X_i$ be the indicator value of that event and work from there.
$endgroup$
– lulu
Dec 19 '18 at 12:13
$begingroup$
Hint: use linearity. if $iin {1,cdots, n-(k-1)}$ then $i$ can be the start of a consecutive sequence of $k$ $1's$ so let $X_i$ be the indicator value of that event and work from there.
$endgroup$
– lulu
Dec 19 '18 at 12:13
$begingroup$
If there is a subsequence of $N_{k+2}$, for instance, does that contain 3 $N_k$ sequences, 1, or none? In other words does it have to be exactly k long to count?
$endgroup$
– player100
Dec 19 '18 at 12:24
$begingroup$
If there is a subsequence of $N_{k+2}$, for instance, does that contain 3 $N_k$ sequences, 1, or none? In other words does it have to be exactly k long to count?
$endgroup$
– player100
Dec 19 '18 at 12:24
$begingroup$
It does not have to be exactly k,I added an example for clearance.@player100
$endgroup$
– Adddison
Dec 19 '18 at 12:29
$begingroup$
It does not have to be exactly k,I added an example for clearance.@player100
$endgroup$
– Adddison
Dec 19 '18 at 12:29
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
$N_k=sum_{i=1}^{n-k+1}X_iX_{i+1}ldots X_{i+k-1}.$ Hence $E(N_k)=E(sum_{i=1}^{n-k+1}X_iX_{i+1}ldots X_{i+k-1})=(n-k+1)E(X_1,X_2ldots X_k)=frac{n-k+1}{2^k}$ if we have independence among $X_i$'s.
$endgroup$
$begingroup$
add on to the question:What is the probability of not having a sequence of length $frac{1}{2}log_2n$?
$endgroup$
– Adddison
Dec 19 '18 at 16:21
add a comment |
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
});
}
});
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%2f3046314%2fnumber-of-k-consecutive-1s-subsequences-in-a-binary-string%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
$begingroup$
$N_k=sum_{i=1}^{n-k+1}X_iX_{i+1}ldots X_{i+k-1}.$ Hence $E(N_k)=E(sum_{i=1}^{n-k+1}X_iX_{i+1}ldots X_{i+k-1})=(n-k+1)E(X_1,X_2ldots X_k)=frac{n-k+1}{2^k}$ if we have independence among $X_i$'s.
$endgroup$
$begingroup$
add on to the question:What is the probability of not having a sequence of length $frac{1}{2}log_2n$?
$endgroup$
– Adddison
Dec 19 '18 at 16:21
add a comment |
$begingroup$
$N_k=sum_{i=1}^{n-k+1}X_iX_{i+1}ldots X_{i+k-1}.$ Hence $E(N_k)=E(sum_{i=1}^{n-k+1}X_iX_{i+1}ldots X_{i+k-1})=(n-k+1)E(X_1,X_2ldots X_k)=frac{n-k+1}{2^k}$ if we have independence among $X_i$'s.
$endgroup$
$begingroup$
add on to the question:What is the probability of not having a sequence of length $frac{1}{2}log_2n$?
$endgroup$
– Adddison
Dec 19 '18 at 16:21
add a comment |
$begingroup$
$N_k=sum_{i=1}^{n-k+1}X_iX_{i+1}ldots X_{i+k-1}.$ Hence $E(N_k)=E(sum_{i=1}^{n-k+1}X_iX_{i+1}ldots X_{i+k-1})=(n-k+1)E(X_1,X_2ldots X_k)=frac{n-k+1}{2^k}$ if we have independence among $X_i$'s.
$endgroup$
$N_k=sum_{i=1}^{n-k+1}X_iX_{i+1}ldots X_{i+k-1}.$ Hence $E(N_k)=E(sum_{i=1}^{n-k+1}X_iX_{i+1}ldots X_{i+k-1})=(n-k+1)E(X_1,X_2ldots X_k)=frac{n-k+1}{2^k}$ if we have independence among $X_i$'s.
answered Dec 19 '18 at 13:24
John_WickJohn_Wick
1,616111
1,616111
$begingroup$
add on to the question:What is the probability of not having a sequence of length $frac{1}{2}log_2n$?
$endgroup$
– Adddison
Dec 19 '18 at 16:21
add a comment |
$begingroup$
add on to the question:What is the probability of not having a sequence of length $frac{1}{2}log_2n$?
$endgroup$
– Adddison
Dec 19 '18 at 16:21
$begingroup$
add on to the question:What is the probability of not having a sequence of length $frac{1}{2}log_2n$?
$endgroup$
– Adddison
Dec 19 '18 at 16:21
$begingroup$
add on to the question:What is the probability of not having a sequence of length $frac{1}{2}log_2n$?
$endgroup$
– Adddison
Dec 19 '18 at 16:21
add a comment |
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.
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%2f3046314%2fnumber-of-k-consecutive-1s-subsequences-in-a-binary-string%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
$begingroup$
Hint: use linearity. if $iin {1,cdots, n-(k-1)}$ then $i$ can be the start of a consecutive sequence of $k$ $1's$ so let $X_i$ be the indicator value of that event and work from there.
$endgroup$
– lulu
Dec 19 '18 at 12:13
$begingroup$
If there is a subsequence of $N_{k+2}$, for instance, does that contain 3 $N_k$ sequences, 1, or none? In other words does it have to be exactly k long to count?
$endgroup$
– player100
Dec 19 '18 at 12:24
$begingroup$
It does not have to be exactly k,I added an example for clearance.@player100
$endgroup$
– Adddison
Dec 19 '18 at 12:29