Bits Please!

In computers a number is stored in binaries. Snow is currently designing the computer and so she is interested in knowing how many bits are needed to represent the number n. In Snow's world, the computers are designed upon user's request and hence snow needs a generalized procedure to know how many bits are needed to design a computer that can handle numbers upto n.

Vijay being the current customer, has to open a software company in a week, ordered Snow to rush up the process and hence Snow comes to you for the requirements of number of bits to handle numbers upto 340282366920938463463374607431768211456. (n=340282366920938463463374607431768211456)


The answer is 128.

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

Drex Beckman
Jan 24, 2016

I counted to number of digits, since we can represent the number of powers of 10. There were 39 digits, 38 discounting a power to the zero. So next, we can use the change of base formula: 38 l o g ( 2 ) 126.23 \frac {38}{log (2)}\approx 126.23 . All that is needed now it to find a power of 2 that is closest to 126. 128 is 2 7 2^7 , so we get the answer.

kudos Drex!!! Nice Thinking.

Vijay Kumar - 5 years, 4 months ago

Log in to reply

Nice problem. Snow king :)

Karthick Shiva - 5 years, 4 months ago

Hey thanks, @Vijay Kumar ! Nice Problem! I'm liking all the new problems with changing bases; this one was really original! :)

Drex Beckman - 5 years, 4 months ago
Vijay Kumar
Jan 24, 2016

For a number to be represented in binary representation, we need l o g 2 ( n ) log_2 (n) bits. And hence to represent such a number 'n' in the problem, We actually need 128 bits. Yes, Vijay is in need of 128 bit computer systems for his software company.

If there are 'n' bits,then the number 'x' that can be represented using these 'n' bits can be,
x = 2 n x = 2^n

This problem asks for n, if x is 340282366920938463463374607431768211456,

Then l o g 2 ( x ) = l o g 2 ( 2 n ) log_2 (x) = log_2 (2^n)
l o g 2 ( x ) = n log_2 (x) = n

And hence we need l o g 2 ( x ) \boxed{log_2 (x)} bits to represent a number 'x'.

Thanks for Solving...!!!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...