Binary counting

Logic Level 3

In binary, the number of digits 0 in this quote is ______.

In binary, the number of digits 1 in this quote is ______.

Fill both blanks in binary without leading zeroes. Concatenate the two answers (the answer for the 0 first, both still in binary) as your answer.

Inspiration 1 and inspiration 2 .


The answer is 11100.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Ivan Koswara
Jul 16, 2015

Suppose the first answer is x x , having a = log 2 x + 1 a = \lfloor \log_2 x \rfloor + 1 digits, and the second answer is y y , having b = log 2 y + 1 b = \lfloor \log_2 y \rfloor + 1 digits. Note that x 2 a 1 , y 2 b 1 x \ge 2^{a-1}, y \ge 2^{b-1} .

Note that x + y x+y counts all the digits. On the other hand, there are 2 + a + b 2+a+b digits. Thus 2 + a + b = x + y 2 a 1 + 2 b 1 2+a+b = x+y \ge 2^{a-1} + 2^{b-1} , or ( 2 a 1 a ) + ( 2 b 1 b ) 2 (2^{a-1}-a) + (2^{b-1}-b) \le 2 . But 2 t 1 t 0 2^{t-1} - t \ge 0 for all natural number t t , so we have 2 a 1 a , 2 b 1 b 2 2^{a-1}-a, 2^{b-1}-b \le 2 .

By finding the derivative of t 2 t 1 t t \mapsto 2^{t-1}-t , we can see that it is increasing for t 2 t \ge 2 , and for t = 4 t = 4 we have 2 t 1 t = 4 > 2 2^{t-1} - t = 4 > 2 , so 2 t 1 t > 2 2^{t-1} - t > 2 for all t 4 t \ge 4 . Thus a , b 3 a,b \le 3 , or x , y 7 x,y \le 7 . Also, x , y 1 x,y \ge 1 since they count at least the existing 0 and 1. There are just 49 49 cases to search, which should be doable (if tiring) by hand.

The unique solution is ( 1 1 2 , 10 0 2 ) \boxed{(11_2, 100_2)} , where there are 3 = 1 1 2 3 = 11_2 zeroes and 4 = 10 0 2 4 = 100_2 ones.

Moderator note:

Great! Having bound the possible values, we can then check the small enough cases to find the solution.

I wonder if there is a base with no possible answer.

Good thinking about binary numbers sir! And a very good solution too! I happy that you got inspired by that problem!

Sravanth C. - 5 years, 11 months ago

Log in to reply

where is the quote

Chris Ian Avendaño - 5 years, 3 months ago
Akash Singh
Aug 21, 2015

binary 11 , 100

number of digis 3 , 4

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...