hw1 - invariant i.e a property of the boy-girl ordering of...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Science 340 Reasoning about Computation Homework 1 Due at the beginning of class on Wed, September 26, 2007 Problem 1 Prove that if x ≥ - 1, then for any integer n 0, (1 + x ) n > nx . Problem 2 Show that at a party of n people, there are two people who have the same number of friends in the party. (Friendship is symmetric) Problem 3 There are two children sitting on a (very long) bench. The child on the left is a boy, the child on the right is a girl. Every minute, either two children arrive and sit down next to each other on the bench (possibly squeezing between two children who are already sitting), or two children who had been sitting next to each other get up off the bench and leave. Furthermore, the arriving and departing pairs of children are always of the same sex (i.e., either both boys or both girls). Is it possible, after some amount of time, that there will be only two children remaining on the bench with a girl on the left and a boy on the right? Hint: Try to find an
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: invariant , i.e., a property of the boy-girl ordering of the children that does not change with time. Problem 4 Arrange the following functions in increasing order of growth rate, so that for two con-secutive functions f ( n ) , g ( n ) in your sequence, either f ( n ) = o ( g ( n )) or f ( n ) = Θ( g ( n )) . Explain the relationships of all adjacent pairs of functions in your order. Assume here that log is a logarithm to base 2 and ln is a logarithm to base e . n ! , log n, log( n 2 ) , n 5 , ln n, ± n 10 ² , 2 log n , 2 ln n , (log n ) n , n (log n ) . Note: We discussed big-Oh notation O ( .. ) in class. This problem requires you to know two other commonly used symbols in comparing the relative growth rate of functions. Here are their definitions: We say that f ( n ) = o ( g ( n )) if lim n →∞ f ( n ) g ( n ) = 0. We say that f ( n ) = Θ( g ( n )) if f ( n ) = O ( g ( n )) and g ( n ) = O ( f ( n ))....
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.

Ask a homework question - tutors are online