In: Statistics and Probability
Let S(n) be the number of subsets of {1,2,...,n} having the following property: there are no three elements in the subset that are consecutive integers. Find a recurrence for S(n) and explain in words why S(n) satisfies this recurrence
Sn is the number of subsets of {1,2,...,n} with the property that there are no three elements that are consecutive integers.
Then there are two types of subsets of Sn:
CASE 1: Sn contain n, then there are 2 cases for this:
A) : The subset contains n but not n-1. In this, the subset is subset of {1,2,...,n-2} having the property that no three elenent in the subset are consecutive integers including n.
Hence, number of sets in this case is Sn-2.
B) The subset contain n and n-1. Then in this case subset will nkt contain n-2 as it cannot contain 3 consecutive integers.
Then subset can be subset of {1,2,...,n-3} having property that no three elements are consecutive integers together with n and n-2.Therefore the number of subsets that fall into this category are Sn-3
CASE 2: thesubsetdoes not contain n. Then subset can be subset of {1,2,...,n-1} having property that no 3 elements are consecutive integers. Therefore tge number of subsets in this case is Sn-1.
Then the reccurence is,
Sn=Sn-1+Sn-2+Sn-3
We can check this recurrence as follows:
For n=0,we have one subset, a null set. S0=1
For n=1,we have {1} and null subset S1=2
For n=2,we have 3 subset, null subset+2C1+2C2=4i.e.,S2=4
For n=3,S3=null+3C1+3C2=7 as it cannot contain 3C3 by the given property.
For n=4,S4=null+4C1+4C2+4C3-2 as {1,2,3} and {2,3,4} cannot be subset with the given property. So, S4=13
So by reccurence relation,
S4=S3+S2+S1=>13=7+4+2
S3=S2+S1+S0=>7=4+2+1
So, it is clear that Sn satisfies this reccurence.