Binary less than 100

Find the number of integers that are between 1 1 and 100 100 inclusive that when converted to binary have a digit sum of less than 5. 5.


The answer is 87.

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.

3 solutions

Curtis Clement
Jan 4, 2015

Firstly, you have to choose a 0 or 1 for each of the 7 spaces (as 2 7 2^{7} = 64 but, 2 8 2^{8} = 128 > 100). For a single 1, there are \ b o x e d 7 boxed{7} choices (#1). For pairs: there are ( 7 2 ) 7\choose2 = 21 \boxed{21} choices (#2). Now for triples and quads I need to denote the spaces from A to G from left to right and I will need to use c a s e w o r k {casework} . TRIPLES: If G = F = 1 (in binary), then there are 3 choices, namely (G,F, A/B/C). If G = 1, F \neq 1, then there are ( 5 2 ) 5\choose2 = 10 choices. If G \neq 1, F=1, then again there are ( 5 2 ) 5\choose2 = 10 choices. If G \neq 1, F \neq 1, then there are ( 5 4 ) 5\choose4 = 5 choices. Overall, for triples there are 33 \boxed{33} choices (#3). QUADS: If G=F=1, then A = 1 is the only option. If G = 1, F \neq 1: there are ( 5 3 ) 5\choose3 = 10 choices; as with G \neq 1, F \neq 1. If G \neq 1, F \neq 1: there are ( 5 4 ) 5\choose4 = 5 choices. Overall, for quads there are 26 \boxed{26} choices (#4). In total, there are 7 + 21 + 33 + 26 = 8 {\color{#3D99F6}8} 7 {\color{#3D99F6}7} choices

you have some mistake, 2^6 = 64 and 2^7 = 128

Shohag Hossen - 6 years, 3 months ago
Trevor Arashiro
Jan 3, 2015

We will prove our answer by looking at the complement.

Looking at binary, we have the largest value less than 100 to be 1100100 1100100

There will be ( 7 5 ) + ( 7 6 ) + ( 7 7 ) = 29 \dbinom{7}{5}+\dbinom{7}{6}+\dbinom{7}{7}=29 numbers that have a digit sum greater than 4.

Now we have to look at numbers that exceed 100 but have a digit sum less than 4

There will be 4 numbers that are less then 100 and have a digit sum less than 4 (1100100, 1100011, 1100001, 1100010), so we'll put these aside for now.

Looking at the numbers, we have ( 5 1 ) + ( 5 2 ) = 15 \dbinom{5}{1}+\dbinom{5}{2}=15

However, we already decided that 4 will work, so we subtract 4, 15 4 = 11 15-4=11

Totaling our numbers that don't work we have 11+29=40

Since we have 127 numbers between 127 and 1, and 40 that don't work, we have

127 40 = 87 127-40=87 numbers that work.

Why you have numbers between 1 and 127 ? The question is how many numbers between 1 and 100. I've done:100=1100100 (base2) and 64=1000000 (base2), which give us 6 numbers that don't work (1011111 with an optional 0 on the 5 last positions).

Between 1000000 and 11111 (64 and 31) we have 7 numbersthat don't work (111111 with an optional 0 on the last 6 positions).

Less than 11110 we don't have any numbers with 5 "1" or more. So there is 6+7=13 numbers between 1 and 100 who's binary sum is 5 or more. 100-13=87 that's work.

damien G - 5 years, 2 months ago

@damiden G, please read his solution correctly, Trevor first found numbers with greater digital sum than 4, and then restricted to take only numbers less than 100, otherwise 7C5+7C6+7C7 gives numbers till 127.

B. Anshuman - 1 year ago
Les Schumer
Jul 27, 2020

Note that 100 = 110010 0 2 100 = 1100100_{2}\\ Counting backwards from 100, note that the first number with a digit sum of 5 or more is 101111 1 2 101 1111_{2}\\ From the last sequence of 11111 1 1111 we exclude those numbers with a digit count of 5 or 4. ( 5 5 ) + ( 5 4 ) = 1 + 5 = 6 {5 \choose 5} + {5 \choose 4} = 1 + 5 = 6\\ The next lowest number with a digit count of 5 or more is 011111 1 2 011 1111_{2}\\ Again, we exclude the 6 6 numbers with a digit count of 5 or 4 from the low order sequence. \\ There is one final sequence with a digit count of 5 - 001111 1 2 0011111_{2}\\ Hence the answer is 100 ( 6 + 6 + 1 ) = 87 100-(6+6+1)=\boxed{87}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...