Question

In: Advanced Math

How many ±1-sequences of length n are there?For example, (1, −1, −1, 1) is not a...

How many ±1-sequences of length n are there?For example, (1, −1, −1, 1) is not a happy sequence, because although 1 ≥ 0 and 1 − 1 ≥ 0,the sum 1−1−1 is negative, so the condition fails for k = 3.

Solutions

Expert Solution

First of all there are sequences with entries as each entry has 2 choices - +1 or -1.

Now we calculate the number of happy sequences of length n. Let the number of happy sequences of length n be

First case: n is even

Then, Consider. Since is odd, for all happy sequences of length , the sum of all entries is positive. So the last entry can be both +1 or -1. So, for this case for all n even.

Second Case : n is odd

Then n-1 is even. We now look at all the happy sequences of length n-1. :

Let The sum of all entries is zero. Then there are same number of +1 and -1. So then it is the number of Dyck Words of length n-1, which is given by . So the last entry has to be +1.

Sofor all n odd. Solving the two recursions we get the desired answer. Base case, .


Related Solutions

How many permutations of length 2n have a cycle of length n + 1? Explain your...
How many permutations of length 2n have a cycle of length n + 1? Explain your answer.
How many arrangements of length n where 1 ≤ n ≤ 8 can be formed from...
How many arrangements of length n where 1 ≤ n ≤ 8 can be formed from the letters A, A, B, C, C, C, D, E where (a) both A’s are adjacent? (b) the string starts or ends with A? (c) you use (exactly) 4 letters from the list?
[02] For n ≥ 1, how many strings of length n using letters a,b,c are there...
[02] For n ≥ 1, how many strings of length n using letters a,b,c are there if the letter a must occur an even number of times?
An n-bit binary string is a sequence of length n over the alphabet {0,1}. How many...
An n-bit binary string is a sequence of length n over the alphabet {0,1}. How many n-bit binary strings are there? How many n-bit binary strings b1,…,bn are there such that b1b2≠00? In other words, how many n-bit binary strings don't begin with 00? How many n-bit binary strings b1,…,bn are there such that b1b2≠00 and b2b3≠11? How many n-bit binary strings b1,…,bn are there such that b1b2≠00 and such that b2b3≠01?
1. How many permutations of the 26 letters are there that contain none of the sequences...
1. How many permutations of the 26 letters are there that contain none of the sequences ROCK, STONE, PLUG, FIT or HAY?
Evaluate if the followings are Cauchy sequences or not. (a) an= (-1)n (b) an= (-1)n/n (c)...
Evaluate if the followings are Cauchy sequences or not. (a) an= (-1)n (b) an= (-1)n/n (c) an = n/(n+1) (d) an = (cos n)/n
There are many measurements of the human body that arepositively correlated. For example, the length...
There are many measurements of the human body that are positively correlated. For example, the length of one's forearm (measured from elbow to wrist) is approximately the same length as the foot (measured from heel to toe). They are positively correlated because, as one measurement increases, so does the other measurement.You will discover through this project whether a human's arm span (measured across the body with the arms extended) is correlated to his height.You will need to collect data from...
1. If you were to toss a fair coin 5 times, how many different possible sequences...
1. If you were to toss a fair coin 5 times, how many different possible sequences of flips would there be? 2. Suppose that employees at a large company are assigned an ID number which contains 5 numbers and 2 letters. How many possible combinations are there in this system?
How many Subshells are in the N shell?
How many subshells are in the n = 3 shell? How many orbitals are in the n = 3 shell?  What Is the maximum number of electrons in the n = 3 shell? 
You are given 2 sorted sequences of log(n) and n-1 keys. We would like to merge...
You are given 2 sorted sequences of log(n) and n-1 keys. We would like to merge those 2 sorted sequences by performing o(n) comparisons.[Note that we are interested in the comparisons and not the running time.] Show how this can be done or argue how this cannot be done. In class we show that ordinary merging would require no more than lg(n)+n-1+1 = n+lg(n) comparisons.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT