{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

MIT6_042JS10_lec31_sol

# MIT6_042JS10_lec31_sol - Massachusetts Institute of...

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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Massachusetts Institute of Technology 6.042J/18.062J, Spring ’10 : Mathematics for Computer Science April 23 Prof. Albert R. Meyer revised April 21, 2010, 763 minutes Solutions to In-Class Problems Week 11, Fri. Problem 1. We are interested in generating functions for the number of different ways to compose a bag of n donuts subject to various restrictions. For each of the restrictions in (a)-(e) below, find a closed form for the corresponding generating function. (a) All the donuts are chocolate and there are at least 3. Solution. 3 x , , , 1 , 1 ,..., 1 ,... ←→ 1 − x (b) All the donuts are glazed and there are at most 2. Solution. 1 , 1 , 1 , , ,..., ,... ←→ 1 + x + x 2 (c) All the donuts are coconut and there are exactly 2 or there are none. Solution. 1 , , 1 , , ,..., ,... ←→ 1 + x 2 (d) All the donuts are plain and their number is a multiple of 4. Solution. 1 1 , , , , 1 , , , ,..., 1 , , , ,... ←→ 1 − x 4 (e) The donuts must be chocolate, glazed, coconut, or plain and: • there must be at least 3 chocolate donuts, and • there must be at most 2 glazed, and • there must be exactly 0 or 2 coconut, and • there must be a multiple of 4 plain. Creative Commons 2010, Prof. Albert R. Meyer . 2 Solutions to In-Class Problems Week 11, Fri....
View Full Document

{[ snackBarMessage ]}

### Page1 / 5

MIT6_042JS10_lec31_sol - Massachusetts Institute of...

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

View Full Document
Ask a homework question - tutors are online