Number of increasing sequences alternating between odd and even involving only integers from the set $[1, 2,...












0














I am new to this forum so do correct me if I am doing anything wrong.



(Problem 6 of British Mathematics Olympiad1 - 1994)



An increasing sequence of integers is said to be alternating
if it starts with an odd term, the second term is even, the
third term is odd, the fourth is even, and so on. The empty
sequence (with no term at all!) is considered to be alternating.
Let
$A(n)$ denote the number of alternating sequences which
only involve integers from the set $[1, 2,... ,n]$. Find the value of
$A(20)$ and prove
that your value is correct.



I believe a method is to set up a recursion.



What I have done is as follows:



(I've slightly changed the definition of A(n) to be the set of all possible sequences)



Let $O(n)$ be the number of increasing alternating sequences which only involve integers from the set $[1, 2, ..., n]$ that end in an odd number and $E(n)$ be the number of increasing alternating sequences which only involve integers from the set $[1, 2, ..., n]$ that end in an even number.



For every even $n$, $O(n+2) = O(n)+E(n)+1$.



Proof: For every sequence that ends in an odd number in $A(n)$, it will also be a sequence of $A(n+2)$, hence add $O(n)$. For every sequence that ends in an even number in $A(n)$, $n+1$, which is odd, can be added to the end of that sequence, hence add $E(n)$. The sequence with only $n+1$ also satisfies the conditions hence add $1$.



For every even $n$, $E(n+2)=2E(n)+O(n)+1$.



Proof: For every sequence that ends in an odd number in $A(n)$, $n+2$, which is even, can be added to the end of that sequence, hence add $O(n)$. For every sequence that ends in an even number in $A(n)$, nothing or both $n+1$ and $n+2$ can be added to the end of that sequence, hence add $2E(n)$. The sequence with only $n+2$ also satisfies the conditions hence add $1$.



$A(n) = E(n)+O(n)+1$



Proof: Every sequence either ends in an even number or an odd number or is an empty sequence.



Starting with $E(0)=0$ and $O(0)=0$, we get $E(20)=10945$ and $O(20)=6765$, meaning $A(20)=17711$.



Is there anything wrong with my method? If not is there a more efficient way to get to the answer? Thanks.










share|cite|improve this question






















  • I think there's a small mistake. You say the sequence consisting only of $n+2$ is alternating, but this is not true unless $n$ is odd, because one of the conditions is that an alternating sequence start with an odd term. Since you eventually compute $A(20),$ you need $n$ to be even. Your general approach looks fine, but you should review the details.
    – saulspatz
    Nov 21 '18 at 13:51










  • I believe I have avoided this by stating for every even n, or is this not what you mean.
    – 3684
    Nov 21 '18 at 14:12
















0














I am new to this forum so do correct me if I am doing anything wrong.



(Problem 6 of British Mathematics Olympiad1 - 1994)



An increasing sequence of integers is said to be alternating
if it starts with an odd term, the second term is even, the
third term is odd, the fourth is even, and so on. The empty
sequence (with no term at all!) is considered to be alternating.
Let
$A(n)$ denote the number of alternating sequences which
only involve integers from the set $[1, 2,... ,n]$. Find the value of
$A(20)$ and prove
that your value is correct.



I believe a method is to set up a recursion.



What I have done is as follows:



(I've slightly changed the definition of A(n) to be the set of all possible sequences)



Let $O(n)$ be the number of increasing alternating sequences which only involve integers from the set $[1, 2, ..., n]$ that end in an odd number and $E(n)$ be the number of increasing alternating sequences which only involve integers from the set $[1, 2, ..., n]$ that end in an even number.



For every even $n$, $O(n+2) = O(n)+E(n)+1$.



Proof: For every sequence that ends in an odd number in $A(n)$, it will also be a sequence of $A(n+2)$, hence add $O(n)$. For every sequence that ends in an even number in $A(n)$, $n+1$, which is odd, can be added to the end of that sequence, hence add $E(n)$. The sequence with only $n+1$ also satisfies the conditions hence add $1$.



For every even $n$, $E(n+2)=2E(n)+O(n)+1$.



Proof: For every sequence that ends in an odd number in $A(n)$, $n+2$, which is even, can be added to the end of that sequence, hence add $O(n)$. For every sequence that ends in an even number in $A(n)$, nothing or both $n+1$ and $n+2$ can be added to the end of that sequence, hence add $2E(n)$. The sequence with only $n+2$ also satisfies the conditions hence add $1$.



$A(n) = E(n)+O(n)+1$



Proof: Every sequence either ends in an even number or an odd number or is an empty sequence.



Starting with $E(0)=0$ and $O(0)=0$, we get $E(20)=10945$ and $O(20)=6765$, meaning $A(20)=17711$.



Is there anything wrong with my method? If not is there a more efficient way to get to the answer? Thanks.










share|cite|improve this question






















  • I think there's a small mistake. You say the sequence consisting only of $n+2$ is alternating, but this is not true unless $n$ is odd, because one of the conditions is that an alternating sequence start with an odd term. Since you eventually compute $A(20),$ you need $n$ to be even. Your general approach looks fine, but you should review the details.
    – saulspatz
    Nov 21 '18 at 13:51










  • I believe I have avoided this by stating for every even n, or is this not what you mean.
    – 3684
    Nov 21 '18 at 14:12














0












0








0


1





I am new to this forum so do correct me if I am doing anything wrong.



(Problem 6 of British Mathematics Olympiad1 - 1994)



An increasing sequence of integers is said to be alternating
if it starts with an odd term, the second term is even, the
third term is odd, the fourth is even, and so on. The empty
sequence (with no term at all!) is considered to be alternating.
Let
$A(n)$ denote the number of alternating sequences which
only involve integers from the set $[1, 2,... ,n]$. Find the value of
$A(20)$ and prove
that your value is correct.



I believe a method is to set up a recursion.



What I have done is as follows:



(I've slightly changed the definition of A(n) to be the set of all possible sequences)



Let $O(n)$ be the number of increasing alternating sequences which only involve integers from the set $[1, 2, ..., n]$ that end in an odd number and $E(n)$ be the number of increasing alternating sequences which only involve integers from the set $[1, 2, ..., n]$ that end in an even number.



For every even $n$, $O(n+2) = O(n)+E(n)+1$.



Proof: For every sequence that ends in an odd number in $A(n)$, it will also be a sequence of $A(n+2)$, hence add $O(n)$. For every sequence that ends in an even number in $A(n)$, $n+1$, which is odd, can be added to the end of that sequence, hence add $E(n)$. The sequence with only $n+1$ also satisfies the conditions hence add $1$.



For every even $n$, $E(n+2)=2E(n)+O(n)+1$.



Proof: For every sequence that ends in an odd number in $A(n)$, $n+2$, which is even, can be added to the end of that sequence, hence add $O(n)$. For every sequence that ends in an even number in $A(n)$, nothing or both $n+1$ and $n+2$ can be added to the end of that sequence, hence add $2E(n)$. The sequence with only $n+2$ also satisfies the conditions hence add $1$.



$A(n) = E(n)+O(n)+1$



Proof: Every sequence either ends in an even number or an odd number or is an empty sequence.



Starting with $E(0)=0$ and $O(0)=0$, we get $E(20)=10945$ and $O(20)=6765$, meaning $A(20)=17711$.



Is there anything wrong with my method? If not is there a more efficient way to get to the answer? Thanks.










share|cite|improve this question













I am new to this forum so do correct me if I am doing anything wrong.



(Problem 6 of British Mathematics Olympiad1 - 1994)



An increasing sequence of integers is said to be alternating
if it starts with an odd term, the second term is even, the
third term is odd, the fourth is even, and so on. The empty
sequence (with no term at all!) is considered to be alternating.
Let
$A(n)$ denote the number of alternating sequences which
only involve integers from the set $[1, 2,... ,n]$. Find the value of
$A(20)$ and prove
that your value is correct.



I believe a method is to set up a recursion.



What I have done is as follows:



(I've slightly changed the definition of A(n) to be the set of all possible sequences)



Let $O(n)$ be the number of increasing alternating sequences which only involve integers from the set $[1, 2, ..., n]$ that end in an odd number and $E(n)$ be the number of increasing alternating sequences which only involve integers from the set $[1, 2, ..., n]$ that end in an even number.



For every even $n$, $O(n+2) = O(n)+E(n)+1$.



Proof: For every sequence that ends in an odd number in $A(n)$, it will also be a sequence of $A(n+2)$, hence add $O(n)$. For every sequence that ends in an even number in $A(n)$, $n+1$, which is odd, can be added to the end of that sequence, hence add $E(n)$. The sequence with only $n+1$ also satisfies the conditions hence add $1$.



For every even $n$, $E(n+2)=2E(n)+O(n)+1$.



Proof: For every sequence that ends in an odd number in $A(n)$, $n+2$, which is even, can be added to the end of that sequence, hence add $O(n)$. For every sequence that ends in an even number in $A(n)$, nothing or both $n+1$ and $n+2$ can be added to the end of that sequence, hence add $2E(n)$. The sequence with only $n+2$ also satisfies the conditions hence add $1$.



$A(n) = E(n)+O(n)+1$



Proof: Every sequence either ends in an even number or an odd number or is an empty sequence.



Starting with $E(0)=0$ and $O(0)=0$, we get $E(20)=10945$ and $O(20)=6765$, meaning $A(20)=17711$.



Is there anything wrong with my method? If not is there a more efficient way to get to the answer? Thanks.







combinatorics contest-math






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Nov 21 '18 at 13:18









3684

1277




1277












  • I think there's a small mistake. You say the sequence consisting only of $n+2$ is alternating, but this is not true unless $n$ is odd, because one of the conditions is that an alternating sequence start with an odd term. Since you eventually compute $A(20),$ you need $n$ to be even. Your general approach looks fine, but you should review the details.
    – saulspatz
    Nov 21 '18 at 13:51










  • I believe I have avoided this by stating for every even n, or is this not what you mean.
    – 3684
    Nov 21 '18 at 14:12


















  • I think there's a small mistake. You say the sequence consisting only of $n+2$ is alternating, but this is not true unless $n$ is odd, because one of the conditions is that an alternating sequence start with an odd term. Since you eventually compute $A(20),$ you need $n$ to be even. Your general approach looks fine, but you should review the details.
    – saulspatz
    Nov 21 '18 at 13:51










  • I believe I have avoided this by stating for every even n, or is this not what you mean.
    – 3684
    Nov 21 '18 at 14:12
















I think there's a small mistake. You say the sequence consisting only of $n+2$ is alternating, but this is not true unless $n$ is odd, because one of the conditions is that an alternating sequence start with an odd term. Since you eventually compute $A(20),$ you need $n$ to be even. Your general approach looks fine, but you should review the details.
– saulspatz
Nov 21 '18 at 13:51




I think there's a small mistake. You say the sequence consisting only of $n+2$ is alternating, but this is not true unless $n$ is odd, because one of the conditions is that an alternating sequence start with an odd term. Since you eventually compute $A(20),$ you need $n$ to be even. Your general approach looks fine, but you should review the details.
– saulspatz
Nov 21 '18 at 13:51












I believe I have avoided this by stating for every even n, or is this not what you mean.
– 3684
Nov 21 '18 at 14:12




I believe I have avoided this by stating for every even n, or is this not what you mean.
– 3684
Nov 21 '18 at 14:12










1 Answer
1






active

oldest

votes


















3














If a sequence starts with 1, the rest of the sequence can be found by adding 1 every term of a sequence from $A(n-1)$.

If it doesn't begin with 1, you get it by adding 2 to every term of a sequence from $A(n-2)$.

So $A(n)=A(n-1)+A(n-2)$.






share|cite|improve this answer





















  • And you need to start things off with $A(0)=1, A(1)=2$.
    – TonyK
    Nov 21 '18 at 14:04












  • @Empy2 How were you able to come up with that recursion, have you done similar questions before?
    – 3684
    Nov 21 '18 at 14:15










  • I recognized 6765 and 17711, and looked for that recursion.
    – Empy2
    Nov 21 '18 at 14:17










  • If I had not provided those values do you think you could have got there?
    – 3684
    Nov 21 '18 at 14:18










  • I believe this is not quite right as it does not deal with the empty sequence, it may need to be slightly adjusted but thanks for the comment.
    – 3684
    Nov 21 '18 at 14:21











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%2f3007719%2fnumber-of-increasing-sequences-alternating-between-odd-and-even-involving-only-i%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









3














If a sequence starts with 1, the rest of the sequence can be found by adding 1 every term of a sequence from $A(n-1)$.

If it doesn't begin with 1, you get it by adding 2 to every term of a sequence from $A(n-2)$.

So $A(n)=A(n-1)+A(n-2)$.






share|cite|improve this answer





















  • And you need to start things off with $A(0)=1, A(1)=2$.
    – TonyK
    Nov 21 '18 at 14:04












  • @Empy2 How were you able to come up with that recursion, have you done similar questions before?
    – 3684
    Nov 21 '18 at 14:15










  • I recognized 6765 and 17711, and looked for that recursion.
    – Empy2
    Nov 21 '18 at 14:17










  • If I had not provided those values do you think you could have got there?
    – 3684
    Nov 21 '18 at 14:18










  • I believe this is not quite right as it does not deal with the empty sequence, it may need to be slightly adjusted but thanks for the comment.
    – 3684
    Nov 21 '18 at 14:21
















3














If a sequence starts with 1, the rest of the sequence can be found by adding 1 every term of a sequence from $A(n-1)$.

If it doesn't begin with 1, you get it by adding 2 to every term of a sequence from $A(n-2)$.

So $A(n)=A(n-1)+A(n-2)$.






share|cite|improve this answer





















  • And you need to start things off with $A(0)=1, A(1)=2$.
    – TonyK
    Nov 21 '18 at 14:04












  • @Empy2 How were you able to come up with that recursion, have you done similar questions before?
    – 3684
    Nov 21 '18 at 14:15










  • I recognized 6765 and 17711, and looked for that recursion.
    – Empy2
    Nov 21 '18 at 14:17










  • If I had not provided those values do you think you could have got there?
    – 3684
    Nov 21 '18 at 14:18










  • I believe this is not quite right as it does not deal with the empty sequence, it may need to be slightly adjusted but thanks for the comment.
    – 3684
    Nov 21 '18 at 14:21














3












3








3






If a sequence starts with 1, the rest of the sequence can be found by adding 1 every term of a sequence from $A(n-1)$.

If it doesn't begin with 1, you get it by adding 2 to every term of a sequence from $A(n-2)$.

So $A(n)=A(n-1)+A(n-2)$.






share|cite|improve this answer












If a sequence starts with 1, the rest of the sequence can be found by adding 1 every term of a sequence from $A(n-1)$.

If it doesn't begin with 1, you get it by adding 2 to every term of a sequence from $A(n-2)$.

So $A(n)=A(n-1)+A(n-2)$.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Nov 21 '18 at 13:48









Empy2

33.5k12261




33.5k12261












  • And you need to start things off with $A(0)=1, A(1)=2$.
    – TonyK
    Nov 21 '18 at 14:04












  • @Empy2 How were you able to come up with that recursion, have you done similar questions before?
    – 3684
    Nov 21 '18 at 14:15










  • I recognized 6765 and 17711, and looked for that recursion.
    – Empy2
    Nov 21 '18 at 14:17










  • If I had not provided those values do you think you could have got there?
    – 3684
    Nov 21 '18 at 14:18










  • I believe this is not quite right as it does not deal with the empty sequence, it may need to be slightly adjusted but thanks for the comment.
    – 3684
    Nov 21 '18 at 14:21


















  • And you need to start things off with $A(0)=1, A(1)=2$.
    – TonyK
    Nov 21 '18 at 14:04












  • @Empy2 How were you able to come up with that recursion, have you done similar questions before?
    – 3684
    Nov 21 '18 at 14:15










  • I recognized 6765 and 17711, and looked for that recursion.
    – Empy2
    Nov 21 '18 at 14:17










  • If I had not provided those values do you think you could have got there?
    – 3684
    Nov 21 '18 at 14:18










  • I believe this is not quite right as it does not deal with the empty sequence, it may need to be slightly adjusted but thanks for the comment.
    – 3684
    Nov 21 '18 at 14:21
















And you need to start things off with $A(0)=1, A(1)=2$.
– TonyK
Nov 21 '18 at 14:04






And you need to start things off with $A(0)=1, A(1)=2$.
– TonyK
Nov 21 '18 at 14:04














@Empy2 How were you able to come up with that recursion, have you done similar questions before?
– 3684
Nov 21 '18 at 14:15




@Empy2 How were you able to come up with that recursion, have you done similar questions before?
– 3684
Nov 21 '18 at 14:15












I recognized 6765 and 17711, and looked for that recursion.
– Empy2
Nov 21 '18 at 14:17




I recognized 6765 and 17711, and looked for that recursion.
– Empy2
Nov 21 '18 at 14:17












If I had not provided those values do you think you could have got there?
– 3684
Nov 21 '18 at 14:18




If I had not provided those values do you think you could have got there?
– 3684
Nov 21 '18 at 14:18












I believe this is not quite right as it does not deal with the empty sequence, it may need to be slightly adjusted but thanks for the comment.
– 3684
Nov 21 '18 at 14:21




I believe this is not quite right as it does not deal with the empty sequence, it may need to be slightly adjusted but thanks for the comment.
– 3684
Nov 21 '18 at 14:21


















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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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.


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%2f3007719%2fnumber-of-increasing-sequences-alternating-between-odd-and-even-involving-only-i%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

mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?