In: Computer Science
How many bits are required to represent all the elements currently in the Periodic Table?
As we know that using 1 bit we can represent 2 numbers , using 2 bits we can represent 4 numbers , using 3 bits we can represent 8 numbersand so on. So n number of bits can represent 2n numbers.
For example we have 3 bits now _ _ _ ( a single bit represented as _ ) , these 3 bits can be filled with 0 or a 1. so by principle of counting we have 222 unique representations using these 3 bits and same goes for other.
Now we know that some n bits can represent 2n numbers so what we want is to calculate the minimum n for which 2n 118, so we get answer as 7. As 27=128 which is greater than 118 and 26 = 64 is less than 118.
Or you can use the formula mentioned above which is derived by taking log2() both sides.
So if you still have any doubt regarding this solution please feel free to ask it in the comment section below and if it is helpful then please upvote this solution, THANK YOU.