In a line of ones and zeroes, $10$ changes to $01$ every second. Prove that it takes no longer than $10n$ seconds until there are no more $10$s.
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
There is a line of ones and zeroes of length $n$. Every second, $10$
changes to $01$. Prove that it takes no longer than $10n$ seconds
until there is nothing to change in the line.
Example:
- 1110010
- 1101001
- 1010101
- 0101011
- 0010111
- 0001111
My reasoning went like this:
- base case: obvious (for $0$ and $1$, there's nothing to change from the start);
- hypothesis: let's assume the statement is true for a line of length $n$;
- step: what can we say about a line of length $n+1$, then?
Let's note that a line of length $n+1$ is just a line of length $n$ from the hypothesis with a $1$ or a $0$ added to it (let's say at the right).
If (line of length $n$)$1$, then $1$ stays intact, and we can apply the hypothesis.
If (line of length $n$ ending with $1$)$0$, then it changes to (line of length $n$)$1$, and our time becomes $10n+1$ at most.
However, if (line of length $n$ ending with $0$)$0$, I don't know how to see the following: that, at the last second of $10n$, it's not possible for the before-last $0$ in the line to change to $1$ and start a chain reaction inside the subline of length $n$, giving us $10n+10n=20n>10(n+1)=10n+10$ seconds of time.
While my book suggests induction for this problem, I am interested in and will be grateful for any proof, no matter inductive or not.
Thank you.
induction
add a comment |Â
up vote
3
down vote
favorite
There is a line of ones and zeroes of length $n$. Every second, $10$
changes to $01$. Prove that it takes no longer than $10n$ seconds
until there is nothing to change in the line.
Example:
- 1110010
- 1101001
- 1010101
- 0101011
- 0010111
- 0001111
My reasoning went like this:
- base case: obvious (for $0$ and $1$, there's nothing to change from the start);
- hypothesis: let's assume the statement is true for a line of length $n$;
- step: what can we say about a line of length $n+1$, then?
Let's note that a line of length $n+1$ is just a line of length $n$ from the hypothesis with a $1$ or a $0$ added to it (let's say at the right).
If (line of length $n$)$1$, then $1$ stays intact, and we can apply the hypothesis.
If (line of length $n$ ending with $1$)$0$, then it changes to (line of length $n$)$1$, and our time becomes $10n+1$ at most.
However, if (line of length $n$ ending with $0$)$0$, I don't know how to see the following: that, at the last second of $10n$, it's not possible for the before-last $0$ in the line to change to $1$ and start a chain reaction inside the subline of length $n$, giving us $10n+10n=20n>10(n+1)=10n+10$ seconds of time.
While my book suggests induction for this problem, I am interested in and will be grateful for any proof, no matter inductive or not.
Thank you.
induction
1
See puzzling.stackexchange.com/questions/17403/confused-soldiers. This puzzle is equivalent one linked, where 1 = "soldier facing east" and 0 = "soldier facing west".
– Mike Earnest
2 days ago
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
There is a line of ones and zeroes of length $n$. Every second, $10$
changes to $01$. Prove that it takes no longer than $10n$ seconds
until there is nothing to change in the line.
Example:
- 1110010
- 1101001
- 1010101
- 0101011
- 0010111
- 0001111
My reasoning went like this:
- base case: obvious (for $0$ and $1$, there's nothing to change from the start);
- hypothesis: let's assume the statement is true for a line of length $n$;
- step: what can we say about a line of length $n+1$, then?
Let's note that a line of length $n+1$ is just a line of length $n$ from the hypothesis with a $1$ or a $0$ added to it (let's say at the right).
If (line of length $n$)$1$, then $1$ stays intact, and we can apply the hypothesis.
If (line of length $n$ ending with $1$)$0$, then it changes to (line of length $n$)$1$, and our time becomes $10n+1$ at most.
However, if (line of length $n$ ending with $0$)$0$, I don't know how to see the following: that, at the last second of $10n$, it's not possible for the before-last $0$ in the line to change to $1$ and start a chain reaction inside the subline of length $n$, giving us $10n+10n=20n>10(n+1)=10n+10$ seconds of time.
While my book suggests induction for this problem, I am interested in and will be grateful for any proof, no matter inductive or not.
Thank you.
induction
There is a line of ones and zeroes of length $n$. Every second, $10$
changes to $01$. Prove that it takes no longer than $10n$ seconds
until there is nothing to change in the line.
Example:
- 1110010
- 1101001
- 1010101
- 0101011
- 0010111
- 0001111
My reasoning went like this:
- base case: obvious (for $0$ and $1$, there's nothing to change from the start);
- hypothesis: let's assume the statement is true for a line of length $n$;
- step: what can we say about a line of length $n+1$, then?
Let's note that a line of length $n+1$ is just a line of length $n$ from the hypothesis with a $1$ or a $0$ added to it (let's say at the right).
If (line of length $n$)$1$, then $1$ stays intact, and we can apply the hypothesis.
If (line of length $n$ ending with $1$)$0$, then it changes to (line of length $n$)$1$, and our time becomes $10n+1$ at most.
However, if (line of length $n$ ending with $0$)$0$, I don't know how to see the following: that, at the last second of $10n$, it's not possible for the before-last $0$ in the line to change to $1$ and start a chain reaction inside the subline of length $n$, giving us $10n+10n=20n>10(n+1)=10n+10$ seconds of time.
While my book suggests induction for this problem, I am interested in and will be grateful for any proof, no matter inductive or not.
Thank you.
induction
edited 2 days ago
asked 2 days ago
fragileradius
938
938
1
See puzzling.stackexchange.com/questions/17403/confused-soldiers. This puzzle is equivalent one linked, where 1 = "soldier facing east" and 0 = "soldier facing west".
– Mike Earnest
2 days ago
add a comment |Â
1
See puzzling.stackexchange.com/questions/17403/confused-soldiers. This puzzle is equivalent one linked, where 1 = "soldier facing east" and 0 = "soldier facing west".
– Mike Earnest
2 days ago
1
1
See puzzling.stackexchange.com/questions/17403/confused-soldiers. This puzzle is equivalent one linked, where 1 = "soldier facing east" and 0 = "soldier facing west".
– Mike Earnest
2 days ago
See puzzling.stackexchange.com/questions/17403/confused-soldiers. This puzzle is equivalent one linked, where 1 = "soldier facing east" and 0 = "soldier facing west".
– Mike Earnest
2 days ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Your hypothesis could be stated more clearly as
For any string of length $n$ there will be no changes after $10n$ seconds
and your induction argument goes through. As you say, a string of length $n+1$ can be considered as a string of length $n$ followed by one more bit. You have justified that a string of length $n+1$ will not change after $10n+1$ seconds. Now observe $10n+1 le 10(n+1)$ and you have verified the statement for length $n+1$. Yes, the string of length $n$ might change after the first second, but we assumed that any string of that length will not change after $10n$ seconds so we don't care if it changes. The important thing is that you noted the last bit cannot change after the first second.
In fact you don't need the factor $10$ out front. You can do the same proof without it and show that no changes will happen after $n$ seconds for a string of length $n$.
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
accepted
Your hypothesis could be stated more clearly as
For any string of length $n$ there will be no changes after $10n$ seconds
and your induction argument goes through. As you say, a string of length $n+1$ can be considered as a string of length $n$ followed by one more bit. You have justified that a string of length $n+1$ will not change after $10n+1$ seconds. Now observe $10n+1 le 10(n+1)$ and you have verified the statement for length $n+1$. Yes, the string of length $n$ might change after the first second, but we assumed that any string of that length will not change after $10n$ seconds so we don't care if it changes. The important thing is that you noted the last bit cannot change after the first second.
In fact you don't need the factor $10$ out front. You can do the same proof without it and show that no changes will happen after $n$ seconds for a string of length $n$.
add a comment |Â
up vote
1
down vote
accepted
Your hypothesis could be stated more clearly as
For any string of length $n$ there will be no changes after $10n$ seconds
and your induction argument goes through. As you say, a string of length $n+1$ can be considered as a string of length $n$ followed by one more bit. You have justified that a string of length $n+1$ will not change after $10n+1$ seconds. Now observe $10n+1 le 10(n+1)$ and you have verified the statement for length $n+1$. Yes, the string of length $n$ might change after the first second, but we assumed that any string of that length will not change after $10n$ seconds so we don't care if it changes. The important thing is that you noted the last bit cannot change after the first second.
In fact you don't need the factor $10$ out front. You can do the same proof without it and show that no changes will happen after $n$ seconds for a string of length $n$.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Your hypothesis could be stated more clearly as
For any string of length $n$ there will be no changes after $10n$ seconds
and your induction argument goes through. As you say, a string of length $n+1$ can be considered as a string of length $n$ followed by one more bit. You have justified that a string of length $n+1$ will not change after $10n+1$ seconds. Now observe $10n+1 le 10(n+1)$ and you have verified the statement for length $n+1$. Yes, the string of length $n$ might change after the first second, but we assumed that any string of that length will not change after $10n$ seconds so we don't care if it changes. The important thing is that you noted the last bit cannot change after the first second.
In fact you don't need the factor $10$ out front. You can do the same proof without it and show that no changes will happen after $n$ seconds for a string of length $n$.
Your hypothesis could be stated more clearly as
For any string of length $n$ there will be no changes after $10n$ seconds
and your induction argument goes through. As you say, a string of length $n+1$ can be considered as a string of length $n$ followed by one more bit. You have justified that a string of length $n+1$ will not change after $10n+1$ seconds. Now observe $10n+1 le 10(n+1)$ and you have verified the statement for length $n+1$. Yes, the string of length $n$ might change after the first second, but we assumed that any string of that length will not change after $10n$ seconds so we don't care if it changes. The important thing is that you noted the last bit cannot change after the first second.
In fact you don't need the factor $10$ out front. You can do the same proof without it and show that no changes will happen after $n$ seconds for a string of length $n$.
answered 2 days ago


Ross Millikan
275k21184350
275k21184350
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2871990%2fin-a-line-of-ones-and-zeroes-10-changes-to-01-every-second-prove-that-it-t%23new-answer', 'question_page');
);
Post as a guest
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
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
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
1
See puzzling.stackexchange.com/questions/17403/confused-soldiers. This puzzle is equivalent one linked, where 1 = "soldier facing east" and 0 = "soldier facing west".
– Mike Earnest
2 days ago