precept1sol

precept1sol - Computer Science 340 Reasoning about...

Info iconThis preview shows pages 1–2. 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: Computer Science 340 Reasoning about Computation Precept 1 Problem 1 Discuss the unstacking game from the Lehman Leighton notes, Section 3.3. Problem 2 Show that if you pick a subset S of size 501 from the set { 1 , 2 , . . . , 1000 } then there must exist two numbers a, b ∈ S such that a divides b . Solution: First observe that any positive integer x can be written as 2 α y where α ≥ 0 and y is odd. Here y is the largest odd divisor of x . Let’s group the numbers in S according to their largest odd divisors. Since the range of values for them is the set of odd numbers in [1 .. 1000], there are only 500 different possibilities. Thus, by pigeonhole principle, two numbers x ≥ x ′ in S would have the same largest odd divisor y ; i.e., x = 2 α y and x ′ = 2 α ′ y . Diving x by x ′ , we get 2 α − α ′ which is an integer. Problem 3 Discuss the number rearrangement puzzle from Lehman Leighton, Section 3.2....
View Full Document

This homework help was uploaded on 01/29/2008 for the course COS 340 taught by Professor Charikarandchazelle during the Fall '07 term at Princeton.

Page1 / 2

precept1sol - Computer Science 340 Reasoning about...

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

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