Find a recursive formula for the number of combinations












0












$begingroup$


I have some question integrating between combinatorics and recursive formulas.



Generally, I have some difficulty with the concept of recursion, as well as with the recursion in programming unfortunately.



I have some question to solve, and maybe you can guide me:



Find a recursive formula and a terminal condition for the number of words with the length 'n' that can be written by $A, B, C$, such that these combinations won't be shown: $AB, AC, BA, BC$.



Now, I know that if we start from $A$ or $B$ we of course have one option, 'n' $A's$, 'n' $B's$ - which are two combinations.



Now, if we start from $C$, I understand we have more 'n-1' letters to write such that we don't write the illegal ones.



I know that means we have $a_{n-1}$ combinations after $C$.
But that is what I don't understand, what is that $a_{n-1}$, how do we know it really contains only the legal combinations?



I wold love to get some sense of this concept.



Thanks.










share|cite|improve this question









$endgroup$








  • 1




    $begingroup$
    Hint: it might be helpful to set up two recurrences, one counting the number of such strings of length $n$ starting with $A$ or $B$ and one counting the number of strings starting with $C$. Clearly adding these together gives what you want, and having both of these quantities will help you generate the next counts.
    $endgroup$
    – platty
    Dec 1 '18 at 20:35






  • 1




    $begingroup$
    For recursion in programming, the key thing is to assume the recursive call works. (It's just like an induction hypothesis.)
    $endgroup$
    – saulspatz
    Dec 1 '18 at 20:43










  • $begingroup$
    @platty As I have already described, as for starting with $A$ or $B$ is in total 2 options for them both. But if I start with $C$, I have more 'n-1' places to pose 3 letters but I have those restrictions. We studies that we have for this last one with some magic $a_{n-1}$ options. I don't understand where it comes from, why it really works... saulspatz - It sounds interesting, can you describe? Thank you!
    $endgroup$
    – HelpMe
    Dec 1 '18 at 20:47
















0












$begingroup$


I have some question integrating between combinatorics and recursive formulas.



Generally, I have some difficulty with the concept of recursion, as well as with the recursion in programming unfortunately.



I have some question to solve, and maybe you can guide me:



Find a recursive formula and a terminal condition for the number of words with the length 'n' that can be written by $A, B, C$, such that these combinations won't be shown: $AB, AC, BA, BC$.



Now, I know that if we start from $A$ or $B$ we of course have one option, 'n' $A's$, 'n' $B's$ - which are two combinations.



Now, if we start from $C$, I understand we have more 'n-1' letters to write such that we don't write the illegal ones.



I know that means we have $a_{n-1}$ combinations after $C$.
But that is what I don't understand, what is that $a_{n-1}$, how do we know it really contains only the legal combinations?



I wold love to get some sense of this concept.



Thanks.










share|cite|improve this question









$endgroup$








  • 1




    $begingroup$
    Hint: it might be helpful to set up two recurrences, one counting the number of such strings of length $n$ starting with $A$ or $B$ and one counting the number of strings starting with $C$. Clearly adding these together gives what you want, and having both of these quantities will help you generate the next counts.
    $endgroup$
    – platty
    Dec 1 '18 at 20:35






  • 1




    $begingroup$
    For recursion in programming, the key thing is to assume the recursive call works. (It's just like an induction hypothesis.)
    $endgroup$
    – saulspatz
    Dec 1 '18 at 20:43










  • $begingroup$
    @platty As I have already described, as for starting with $A$ or $B$ is in total 2 options for them both. But if I start with $C$, I have more 'n-1' places to pose 3 letters but I have those restrictions. We studies that we have for this last one with some magic $a_{n-1}$ options. I don't understand where it comes from, why it really works... saulspatz - It sounds interesting, can you describe? Thank you!
    $endgroup$
    – HelpMe
    Dec 1 '18 at 20:47














0












0








0





$begingroup$


I have some question integrating between combinatorics and recursive formulas.



Generally, I have some difficulty with the concept of recursion, as well as with the recursion in programming unfortunately.



I have some question to solve, and maybe you can guide me:



Find a recursive formula and a terminal condition for the number of words with the length 'n' that can be written by $A, B, C$, such that these combinations won't be shown: $AB, AC, BA, BC$.



Now, I know that if we start from $A$ or $B$ we of course have one option, 'n' $A's$, 'n' $B's$ - which are two combinations.



Now, if we start from $C$, I understand we have more 'n-1' letters to write such that we don't write the illegal ones.



I know that means we have $a_{n-1}$ combinations after $C$.
But that is what I don't understand, what is that $a_{n-1}$, how do we know it really contains only the legal combinations?



I wold love to get some sense of this concept.



Thanks.










share|cite|improve this question









$endgroup$




I have some question integrating between combinatorics and recursive formulas.



Generally, I have some difficulty with the concept of recursion, as well as with the recursion in programming unfortunately.



I have some question to solve, and maybe you can guide me:



Find a recursive formula and a terminal condition for the number of words with the length 'n' that can be written by $A, B, C$, such that these combinations won't be shown: $AB, AC, BA, BC$.



Now, I know that if we start from $A$ or $B$ we of course have one option, 'n' $A's$, 'n' $B's$ - which are two combinations.



Now, if we start from $C$, I understand we have more 'n-1' letters to write such that we don't write the illegal ones.



I know that means we have $a_{n-1}$ combinations after $C$.
But that is what I don't understand, what is that $a_{n-1}$, how do we know it really contains only the legal combinations?



I wold love to get some sense of this concept.



Thanks.







sequences-and-series combinatorics discrete-mathematics recurrence-relations combinations






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Dec 1 '18 at 20:28









HelpMeHelpMe

185




185








  • 1




    $begingroup$
    Hint: it might be helpful to set up two recurrences, one counting the number of such strings of length $n$ starting with $A$ or $B$ and one counting the number of strings starting with $C$. Clearly adding these together gives what you want, and having both of these quantities will help you generate the next counts.
    $endgroup$
    – platty
    Dec 1 '18 at 20:35






  • 1




    $begingroup$
    For recursion in programming, the key thing is to assume the recursive call works. (It's just like an induction hypothesis.)
    $endgroup$
    – saulspatz
    Dec 1 '18 at 20:43










  • $begingroup$
    @platty As I have already described, as for starting with $A$ or $B$ is in total 2 options for them both. But if I start with $C$, I have more 'n-1' places to pose 3 letters but I have those restrictions. We studies that we have for this last one with some magic $a_{n-1}$ options. I don't understand where it comes from, why it really works... saulspatz - It sounds interesting, can you describe? Thank you!
    $endgroup$
    – HelpMe
    Dec 1 '18 at 20:47














  • 1




    $begingroup$
    Hint: it might be helpful to set up two recurrences, one counting the number of such strings of length $n$ starting with $A$ or $B$ and one counting the number of strings starting with $C$. Clearly adding these together gives what you want, and having both of these quantities will help you generate the next counts.
    $endgroup$
    – platty
    Dec 1 '18 at 20:35






  • 1




    $begingroup$
    For recursion in programming, the key thing is to assume the recursive call works. (It's just like an induction hypothesis.)
    $endgroup$
    – saulspatz
    Dec 1 '18 at 20:43










  • $begingroup$
    @platty As I have already described, as for starting with $A$ or $B$ is in total 2 options for them both. But if I start with $C$, I have more 'n-1' places to pose 3 letters but I have those restrictions. We studies that we have for this last one with some magic $a_{n-1}$ options. I don't understand where it comes from, why it really works... saulspatz - It sounds interesting, can you describe? Thank you!
    $endgroup$
    – HelpMe
    Dec 1 '18 at 20:47








1




1




$begingroup$
Hint: it might be helpful to set up two recurrences, one counting the number of such strings of length $n$ starting with $A$ or $B$ and one counting the number of strings starting with $C$. Clearly adding these together gives what you want, and having both of these quantities will help you generate the next counts.
$endgroup$
– platty
Dec 1 '18 at 20:35




$begingroup$
Hint: it might be helpful to set up two recurrences, one counting the number of such strings of length $n$ starting with $A$ or $B$ and one counting the number of strings starting with $C$. Clearly adding these together gives what you want, and having both of these quantities will help you generate the next counts.
$endgroup$
– platty
Dec 1 '18 at 20:35




1




1




$begingroup$
For recursion in programming, the key thing is to assume the recursive call works. (It's just like an induction hypothesis.)
$endgroup$
– saulspatz
Dec 1 '18 at 20:43




$begingroup$
For recursion in programming, the key thing is to assume the recursive call works. (It's just like an induction hypothesis.)
$endgroup$
– saulspatz
Dec 1 '18 at 20:43












$begingroup$
@platty As I have already described, as for starting with $A$ or $B$ is in total 2 options for them both. But if I start with $C$, I have more 'n-1' places to pose 3 letters but I have those restrictions. We studies that we have for this last one with some magic $a_{n-1}$ options. I don't understand where it comes from, why it really works... saulspatz - It sounds interesting, can you describe? Thank you!
$endgroup$
– HelpMe
Dec 1 '18 at 20:47




$begingroup$
@platty As I have already described, as for starting with $A$ or $B$ is in total 2 options for them both. But if I start with $C$, I have more 'n-1' places to pose 3 letters but I have those restrictions. We studies that we have for this last one with some magic $a_{n-1}$ options. I don't understand where it comes from, why it really works... saulspatz - It sounds interesting, can you describe? Thank you!
$endgroup$
– HelpMe
Dec 1 '18 at 20:47










1 Answer
1






active

oldest

votes


















2












$begingroup$

EDIT: a little clarification.



We will define $a_k$ to be the number of legal strings of length $k$. So, by definition, $a_{n-1}$ counts the number of legal strings of length $n-1$. The idea of recursion here is to use $a_k$ for smaller values of $k$ (here, $k = n-1$) to get the value for $a_n$. This comes to play in the fact that, if I have any legal string of length $n$, then removing the first letter has to result in a legal string of length $n-1$. Additionally, starting from any legal string of length $n-1$, we can always add $C$ to the beginning to get a legal string of length $n$.



Your observations above are correct. In particular, if the string starts with $A$, it must be the string which only contains $A$'s. Likewise if it starts with $B$; these give exactly $2$ strings. Suppose now that the string starts with $C$. Then the entire $n$-letter string is legal iff the rest of the string is legal, i.e. there are $a_{n-1}$ choices for the rest of the string. This gives us the recurrence:
$$
a_n = a_{n-1} + 2
$$

Finally, it should be clear that $a_1 = 3$ (none of these strings is illegal).



To check that this works, we note that this recurrence gives the closed form $a_n = 2n + 1$. We can count the number of strings directly. If you are familiar with regular expressions, every string is of the form $C^*(A^*|B^*)$, i.e. it starts with all $C$'s, then switches to either all $A$'s or all $B$'s. Such a string of length $n$ can then be constructed in 2 steps: Choose how many $C$'s there are (between $0$ and $n$) and then choose whether the rest of the string is $A$'s or $B$'s. There are $(n+1) cdot 2$ such strings, but actually, if we have $n$ $C$'s, it makes no difference if we choose $A$ or $B$, so we overcounted by one. This gives a total of $2n+1$ strings of length $n$, as desired.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Again, I don't understand how we can leap to $a_{n-1}$,. Okay, after the first $C$, we have n-1 places, how does it tells us that has $a_{n-1}$? How do we know what is this $a_{n-1}$ at all?
    $endgroup$
    – HelpMe
    Dec 1 '18 at 21:02










  • $begingroup$
    Does the first paragraph help? There is a correspondence between legal strings of length $n-1$ and legal strings of length $n$ which begin with $C$; one of the first kind is matched with exactly one of the second and vice versa. So counting the first one (which is the value $a_{n-1}$) also counts the second.
    $endgroup$
    – platty
    Dec 1 '18 at 21:05










  • $begingroup$
    Yes. It's again my difficulty of understanding deeply the concept of Recursion, Induction, strong induction... It works like a magic for me, more than mathematics. I will think about that... Thank you.
    $endgroup$
    – HelpMe
    Dec 1 '18 at 21:14











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%2f3021790%2ffind-a-recursive-formula-for-the-number-of-combinations%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









2












$begingroup$

EDIT: a little clarification.



We will define $a_k$ to be the number of legal strings of length $k$. So, by definition, $a_{n-1}$ counts the number of legal strings of length $n-1$. The idea of recursion here is to use $a_k$ for smaller values of $k$ (here, $k = n-1$) to get the value for $a_n$. This comes to play in the fact that, if I have any legal string of length $n$, then removing the first letter has to result in a legal string of length $n-1$. Additionally, starting from any legal string of length $n-1$, we can always add $C$ to the beginning to get a legal string of length $n$.



Your observations above are correct. In particular, if the string starts with $A$, it must be the string which only contains $A$'s. Likewise if it starts with $B$; these give exactly $2$ strings. Suppose now that the string starts with $C$. Then the entire $n$-letter string is legal iff the rest of the string is legal, i.e. there are $a_{n-1}$ choices for the rest of the string. This gives us the recurrence:
$$
a_n = a_{n-1} + 2
$$

Finally, it should be clear that $a_1 = 3$ (none of these strings is illegal).



To check that this works, we note that this recurrence gives the closed form $a_n = 2n + 1$. We can count the number of strings directly. If you are familiar with regular expressions, every string is of the form $C^*(A^*|B^*)$, i.e. it starts with all $C$'s, then switches to either all $A$'s or all $B$'s. Such a string of length $n$ can then be constructed in 2 steps: Choose how many $C$'s there are (between $0$ and $n$) and then choose whether the rest of the string is $A$'s or $B$'s. There are $(n+1) cdot 2$ such strings, but actually, if we have $n$ $C$'s, it makes no difference if we choose $A$ or $B$, so we overcounted by one. This gives a total of $2n+1$ strings of length $n$, as desired.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Again, I don't understand how we can leap to $a_{n-1}$,. Okay, after the first $C$, we have n-1 places, how does it tells us that has $a_{n-1}$? How do we know what is this $a_{n-1}$ at all?
    $endgroup$
    – HelpMe
    Dec 1 '18 at 21:02










  • $begingroup$
    Does the first paragraph help? There is a correspondence between legal strings of length $n-1$ and legal strings of length $n$ which begin with $C$; one of the first kind is matched with exactly one of the second and vice versa. So counting the first one (which is the value $a_{n-1}$) also counts the second.
    $endgroup$
    – platty
    Dec 1 '18 at 21:05










  • $begingroup$
    Yes. It's again my difficulty of understanding deeply the concept of Recursion, Induction, strong induction... It works like a magic for me, more than mathematics. I will think about that... Thank you.
    $endgroup$
    – HelpMe
    Dec 1 '18 at 21:14
















2












$begingroup$

EDIT: a little clarification.



We will define $a_k$ to be the number of legal strings of length $k$. So, by definition, $a_{n-1}$ counts the number of legal strings of length $n-1$. The idea of recursion here is to use $a_k$ for smaller values of $k$ (here, $k = n-1$) to get the value for $a_n$. This comes to play in the fact that, if I have any legal string of length $n$, then removing the first letter has to result in a legal string of length $n-1$. Additionally, starting from any legal string of length $n-1$, we can always add $C$ to the beginning to get a legal string of length $n$.



Your observations above are correct. In particular, if the string starts with $A$, it must be the string which only contains $A$'s. Likewise if it starts with $B$; these give exactly $2$ strings. Suppose now that the string starts with $C$. Then the entire $n$-letter string is legal iff the rest of the string is legal, i.e. there are $a_{n-1}$ choices for the rest of the string. This gives us the recurrence:
$$
a_n = a_{n-1} + 2
$$

Finally, it should be clear that $a_1 = 3$ (none of these strings is illegal).



To check that this works, we note that this recurrence gives the closed form $a_n = 2n + 1$. We can count the number of strings directly. If you are familiar with regular expressions, every string is of the form $C^*(A^*|B^*)$, i.e. it starts with all $C$'s, then switches to either all $A$'s or all $B$'s. Such a string of length $n$ can then be constructed in 2 steps: Choose how many $C$'s there are (between $0$ and $n$) and then choose whether the rest of the string is $A$'s or $B$'s. There are $(n+1) cdot 2$ such strings, but actually, if we have $n$ $C$'s, it makes no difference if we choose $A$ or $B$, so we overcounted by one. This gives a total of $2n+1$ strings of length $n$, as desired.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    Again, I don't understand how we can leap to $a_{n-1}$,. Okay, after the first $C$, we have n-1 places, how does it tells us that has $a_{n-1}$? How do we know what is this $a_{n-1}$ at all?
    $endgroup$
    – HelpMe
    Dec 1 '18 at 21:02










  • $begingroup$
    Does the first paragraph help? There is a correspondence between legal strings of length $n-1$ and legal strings of length $n$ which begin with $C$; one of the first kind is matched with exactly one of the second and vice versa. So counting the first one (which is the value $a_{n-1}$) also counts the second.
    $endgroup$
    – platty
    Dec 1 '18 at 21:05










  • $begingroup$
    Yes. It's again my difficulty of understanding deeply the concept of Recursion, Induction, strong induction... It works like a magic for me, more than mathematics. I will think about that... Thank you.
    $endgroup$
    – HelpMe
    Dec 1 '18 at 21:14














2












2








2





$begingroup$

EDIT: a little clarification.



We will define $a_k$ to be the number of legal strings of length $k$. So, by definition, $a_{n-1}$ counts the number of legal strings of length $n-1$. The idea of recursion here is to use $a_k$ for smaller values of $k$ (here, $k = n-1$) to get the value for $a_n$. This comes to play in the fact that, if I have any legal string of length $n$, then removing the first letter has to result in a legal string of length $n-1$. Additionally, starting from any legal string of length $n-1$, we can always add $C$ to the beginning to get a legal string of length $n$.



Your observations above are correct. In particular, if the string starts with $A$, it must be the string which only contains $A$'s. Likewise if it starts with $B$; these give exactly $2$ strings. Suppose now that the string starts with $C$. Then the entire $n$-letter string is legal iff the rest of the string is legal, i.e. there are $a_{n-1}$ choices for the rest of the string. This gives us the recurrence:
$$
a_n = a_{n-1} + 2
$$

Finally, it should be clear that $a_1 = 3$ (none of these strings is illegal).



To check that this works, we note that this recurrence gives the closed form $a_n = 2n + 1$. We can count the number of strings directly. If you are familiar with regular expressions, every string is of the form $C^*(A^*|B^*)$, i.e. it starts with all $C$'s, then switches to either all $A$'s or all $B$'s. Such a string of length $n$ can then be constructed in 2 steps: Choose how many $C$'s there are (between $0$ and $n$) and then choose whether the rest of the string is $A$'s or $B$'s. There are $(n+1) cdot 2$ such strings, but actually, if we have $n$ $C$'s, it makes no difference if we choose $A$ or $B$, so we overcounted by one. This gives a total of $2n+1$ strings of length $n$, as desired.






share|cite|improve this answer









$endgroup$



EDIT: a little clarification.



We will define $a_k$ to be the number of legal strings of length $k$. So, by definition, $a_{n-1}$ counts the number of legal strings of length $n-1$. The idea of recursion here is to use $a_k$ for smaller values of $k$ (here, $k = n-1$) to get the value for $a_n$. This comes to play in the fact that, if I have any legal string of length $n$, then removing the first letter has to result in a legal string of length $n-1$. Additionally, starting from any legal string of length $n-1$, we can always add $C$ to the beginning to get a legal string of length $n$.



Your observations above are correct. In particular, if the string starts with $A$, it must be the string which only contains $A$'s. Likewise if it starts with $B$; these give exactly $2$ strings. Suppose now that the string starts with $C$. Then the entire $n$-letter string is legal iff the rest of the string is legal, i.e. there are $a_{n-1}$ choices for the rest of the string. This gives us the recurrence:
$$
a_n = a_{n-1} + 2
$$

Finally, it should be clear that $a_1 = 3$ (none of these strings is illegal).



To check that this works, we note that this recurrence gives the closed form $a_n = 2n + 1$. We can count the number of strings directly. If you are familiar with regular expressions, every string is of the form $C^*(A^*|B^*)$, i.e. it starts with all $C$'s, then switches to either all $A$'s or all $B$'s. Such a string of length $n$ can then be constructed in 2 steps: Choose how many $C$'s there are (between $0$ and $n$) and then choose whether the rest of the string is $A$'s or $B$'s. There are $(n+1) cdot 2$ such strings, but actually, if we have $n$ $C$'s, it makes no difference if we choose $A$ or $B$, so we overcounted by one. This gives a total of $2n+1$ strings of length $n$, as desired.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Dec 1 '18 at 20:52









plattyplatty

3,370320




3,370320












  • $begingroup$
    Again, I don't understand how we can leap to $a_{n-1}$,. Okay, after the first $C$, we have n-1 places, how does it tells us that has $a_{n-1}$? How do we know what is this $a_{n-1}$ at all?
    $endgroup$
    – HelpMe
    Dec 1 '18 at 21:02










  • $begingroup$
    Does the first paragraph help? There is a correspondence between legal strings of length $n-1$ and legal strings of length $n$ which begin with $C$; one of the first kind is matched with exactly one of the second and vice versa. So counting the first one (which is the value $a_{n-1}$) also counts the second.
    $endgroup$
    – platty
    Dec 1 '18 at 21:05










  • $begingroup$
    Yes. It's again my difficulty of understanding deeply the concept of Recursion, Induction, strong induction... It works like a magic for me, more than mathematics. I will think about that... Thank you.
    $endgroup$
    – HelpMe
    Dec 1 '18 at 21:14


















  • $begingroup$
    Again, I don't understand how we can leap to $a_{n-1}$,. Okay, after the first $C$, we have n-1 places, how does it tells us that has $a_{n-1}$? How do we know what is this $a_{n-1}$ at all?
    $endgroup$
    – HelpMe
    Dec 1 '18 at 21:02










  • $begingroup$
    Does the first paragraph help? There is a correspondence between legal strings of length $n-1$ and legal strings of length $n$ which begin with $C$; one of the first kind is matched with exactly one of the second and vice versa. So counting the first one (which is the value $a_{n-1}$) also counts the second.
    $endgroup$
    – platty
    Dec 1 '18 at 21:05










  • $begingroup$
    Yes. It's again my difficulty of understanding deeply the concept of Recursion, Induction, strong induction... It works like a magic for me, more than mathematics. I will think about that... Thank you.
    $endgroup$
    – HelpMe
    Dec 1 '18 at 21:14
















$begingroup$
Again, I don't understand how we can leap to $a_{n-1}$,. Okay, after the first $C$, we have n-1 places, how does it tells us that has $a_{n-1}$? How do we know what is this $a_{n-1}$ at all?
$endgroup$
– HelpMe
Dec 1 '18 at 21:02




$begingroup$
Again, I don't understand how we can leap to $a_{n-1}$,. Okay, after the first $C$, we have n-1 places, how does it tells us that has $a_{n-1}$? How do we know what is this $a_{n-1}$ at all?
$endgroup$
– HelpMe
Dec 1 '18 at 21:02












$begingroup$
Does the first paragraph help? There is a correspondence between legal strings of length $n-1$ and legal strings of length $n$ which begin with $C$; one of the first kind is matched with exactly one of the second and vice versa. So counting the first one (which is the value $a_{n-1}$) also counts the second.
$endgroup$
– platty
Dec 1 '18 at 21:05




$begingroup$
Does the first paragraph help? There is a correspondence between legal strings of length $n-1$ and legal strings of length $n$ which begin with $C$; one of the first kind is matched with exactly one of the second and vice versa. So counting the first one (which is the value $a_{n-1}$) also counts the second.
$endgroup$
– platty
Dec 1 '18 at 21:05












$begingroup$
Yes. It's again my difficulty of understanding deeply the concept of Recursion, Induction, strong induction... It works like a magic for me, more than mathematics. I will think about that... Thank you.
$endgroup$
– HelpMe
Dec 1 '18 at 21:14




$begingroup$
Yes. It's again my difficulty of understanding deeply the concept of Recursion, Induction, strong induction... It works like a magic for me, more than mathematics. I will think about that... Thank you.
$endgroup$
– HelpMe
Dec 1 '18 at 21:14


















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%2f3021790%2ffind-a-recursive-formula-for-the-number-of-combinations%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

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?