HW5 - Solution to HW 5 Ning SUN August 16, 2009 7.1: 2, 10;...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Solution to HW 5 Ning SUN August 16, 2009 7.1: 2, 10; 7.2: 8 (a,b); 8.1: 10, 12, 20, 26, 36; 8.2: 2, 6, 8 7.1#2 (a) a n = a n- 1 + a n- 2 + a n- 4 ; a = 1 , a 1 = 1 . ( a k = 0 for k < .) (b) a 4 = a 3 + a 2 + a = ( a 2 + a 1 ) + a 2 + a = ( a 1 + a + a 1 ) + ( a 1 + a ) + a = 6 . So there are 6 ways to climb four stairs. 7.1#10 # of female in the n th previous generation=(# of female + # of male) in the ( n- 1) th previous generation = a n- 1 , so # of male in the n th previous generation=# of female in the ( n- 1) th previous generation = a n- 2 . So a n = (# of female + # of male) in the n th previous generation = a n- 1 + a n- 2 ; a 1 = 1 , a 2 = 2 . Find a recurrence relation for the number of n-digit binary sequences with (a) no "11"; (b) no "10". (a) There are 2 choices for the rst digit: 1 or 0. If it's 0... , you can simplify the subcase to an ( n- 1)- digit sequence restarting from the second digit. The corresponding number is a n- 1 . If it's 1... , then the second digit can only be 0 to aviod 11... . And then you can simplify the subcase to an ( n- 2)- digit sequence restarting from the third digit. The corresponding number is a n- 2 . In total, a n = a n- 1 + a n- 2 , a = 1 , a 1 = 2 . (b) There are 2 choices for the rst digit: 1 or 0. If it's 0... , you can simplify the subcase to an ( n- 1)- digit sequence restarting from the second digit. The corresponding number is a n- 1 . If it's 1... , then the second digit can only be 1 to aviod 10... . However you cannot restart the sequence after this 11... since the next digit can be 0 which makes 110... . So we subtract the undesired cases 10... (we can restart the sequence after the 0 . So the number is a n- 2 ) from the total 1... ( a n- 1 ). In total, a n = 2 a n- 1- a n- 2 , a = 1 , a 1 = 2 . 1 Find a recurrence relation for the number of n-digit ternary sequences with (a) no "10"; (b) any 1 not in the last position is followed by a 0. (a) There are 3 choices for the rst digit: 0, 1 or 2. If it's 0... or 2... (2 cases), you can simplify the subcase to an ( n- 1)- digit sequence restarting from the second digit. The corresponding number is 2 a n- 1 . If it's 1... , then the second digit must be 1 or 2 to avoid 10... . However, if the second digit is 1, then the sequence cannot restart from the third digit since if the third digit digit is 0, we get 110... which violates the constraint. So we need to subtract the undesired cases 10... (we can restart the sequence after the 0 . So the number is a n- 2 ) from the total 1... ( a n- 1 )....
View Full Document

Page1 / 5

HW5 - Solution to HW 5 Ning SUN August 16, 2009 7.1: 2, 10;...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online