cse20_quiz_6_7_8_9

# cse20_quiz_6_7_8_9 - Quiz 4/26/11 Show that ab and a' +b'...

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

Quiz 4/26/11 Show that ab and a' +b' are complementary Solution: The complement law states that if for complements a and a', a + a' = 1 , aa' = 0 So, if ab and a'+b' are complements, then, ab + (a'+b') = 1 , ab( a' + b') = 0 Proof: ab + (a' +b') = (ab + a' )+ b' [Associative] = (b + a') + b' [Th 8] = a' + (b + b') [Associative, Commutative] = a' + 1 [Complement] = 1 [boundedness] ab( a'+b') = aba' + abb' [Distributive] = baa' + abb' [Commutative] = b.0 + a.0 [ Complement] = 0 + 0 [ Boundedness] = 0 Quiz- 5/3/11 Month 0 : 1 pair of adults, 0 pair of new borns Month I : Each pair of adults produce 2 pairs of new borns, newborns take 1 month to reproduce. 1) Write the program 2) Show f i , i { 0 -8} ( f i represents the number of newborn in i th month as recursion) Solution: 1) array n(i ) represent pairs of newborn, a(i) represent pairs of adults a(0) = 1, n(0) = 0 For i = 1, i++ n(i) = 2a(i-1) a(i) = a(i-1) + n(i-1) 2)

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

View Full Document
Index: 0 1 2 3 4 5 6 7 8 a(i) : 1 1 3 5 11 21 43 85 171 n(i) : 0
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/11/2011 for the course CSE 20 taught by Professor Foster during the Fall '08 term at UCSD.

### Page1 / 3

cse20_quiz_6_7_8_9 - Quiz 4/26/11 Show that ab and a' +b'...

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

View Full Document
Ask a homework question - tutors are online