``` wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi) riddles >> hard >> Binary Implications and Binomial Parity (Message started by: william wu on Oct 29th, 2003, 7:35pm) ``` Title: Binary Implications and Binomial Parity Post by william wu on Oct 29th, 2003, 7:35pm Let r and s be natural numbers. Denote the binary expansion of r by r1r2...rn. Similarly, denote the binary expansion of s by s1s2...sn. Assume these binary expansions are both of length n.Let the relation r [smiley=rrightarrow.gif] s mean that the following sentence is true: [forall]i[in]{1,...,n}, IF ri = 1, THEN si = 1Thus for example, for binary strings 1010 and 1110, it follows that 1010 [smiley=rrightarrow.gif] 1110.Prove that r [smiley=rrightarrow.gif] s    IF AND ONLY IF    C(s,r) is oddwhere C(s,r) is the binomial coefficient: (s!)/(r!(s-r)!)Note 1: An amazing result from the 1900s! It was passed to me via a colleague (Jon Yard). Does anyone know how it is proven (I don't), or what the theorem's name is if it has a name? If anyone knows the proof and feels it is too hard for recreational math, please say so.Note 2: This result apparently has a little to do with Hilbert's 10th problem. Title: Re: Binary Implications and Binomial Parity Post by Rezyk on Oct 29th, 2003, 10:44pm Tool #1: [hide]The number of times 2 divides X! is equal to X minus the number of 1s in the binary representation of X.[/hide] (proof omitted) Tool #2: [hide]When adding 2 numbers in binary, iff there is no carry anywhere, the number of "1" digits is conserved.[/hide] (proof omitted) C(s, r) is odd[bigleftrightarrow] [hide]s!/(r!(s-r)!) is not divisible by 2[/hide][bigleftrightarrow] [hide]number of times 2 divides s! = (number of times 2 divides r!)+(number of times 2 divides (s-r)!)[/hide][bigleftrightarrow] [hide]s - (number of 1s in binary repr. of s) = r - (number of 1s in binary repr. of r) + s-r - (number of 1s in binary repr. of s-r)[/hide][bigleftrightarrow] [hide]number of 1s in binary repr. of s = (number of 1s in binary repr. of r) + (number of 1s in binary repr. of s-r)[/hide][bigleftrightarrow] [hide]there is no carry anywhere in adding r to (s-r) in binary[/hide][bigleftrightarrow] r [smiley=rrightarrow.gif] s Title: Re: Binary Implications and Binomial Parity Post by Barukh on Oct 30th, 2003, 11:05am Awesome solution, Rezyk! And really elementary. Let me add something for the completeness of the derivation:Tool #1 - proof:[smiley=blacksquare.gif][hide]Denote F(n) the maximal power of 2 dividing n!, P(n) - number of 1's in the binary representation (BR) of n. We want to show that F(n) + P(n) = n. Use induction by n:1. F(1) + P(1) = 1 + 0 = 1.2. Let the rightmost 1 in BR of (n+1) be at position j. Then, the j-th position in BR of n was 0, but positions 1, ..., j-1 were all 1's. So, P(n+1) = P(n) - (j-2). Also, 2j-1 divides n+1, so F(n+1) = F(n) + (j-1). Therefore, F(n+1) + P(n+1) = n+1.[/hide][smiley=blacksquare.gif] Powered by YaBB 1 Gold - SP 1.4! Forum software copyright © 2000-2004 Yet another Bulletin Board