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)
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.
kudos Drex!!! Nice Thinking.
Log in to reply
Nice problem. Snow king :)
Hey thanks, @Vijay Kumar ! Nice Problem! I'm liking all the new problems with changing bases; this one was really original! :)
For a number to be represented in binary representation, we need l o g 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
This problem asks for n, if x is 340282366920938463463374607431768211456,
Then
l
o
g
2
(
x
)
=
l
o
g
2
(
2
n
)
l
o
g
2
(
x
)
=
n
And hence we need l o g 2 ( x ) bits to represent a number 'x'.
Thanks for Solving...!!!
Problem Loading...
Note Loading...
Set Loading...
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: l o g ( 2 ) 3 8 ≈ 1 2 6 . 2 3 . All that is needed now it to find a power of 2 that is closest to 126. 128 is 2 7 , so we get the answer.