5.4 Skipping digits
Example 11
The micronanometer in a certain factory can measure the pressure inside the gas chamber from 1 unit to 999999 units. Lately this instrument has not been working properly. The problem with the instrument is that it always skips the digit 5 and moves directly from 4 to 6. What is the actual pressure inside the gas chamber if the micronanometer displays 003016?
[XAT 2011]
(1) 2201
(2) 2202
(3) 2600
(4) 2960
(5) None of the above
Solution
As the instrument always skips 5, it uses 9 digits only. This means, the instrument uses a Base 9 number system.
Digits are nothing but symbols that are used to represent certain values. In this chapter we have learnt conversions or reconversions to Base 9 number system, where the 9 digits are 0,1,2,3,4,5,6,7,8.
The instrument, however, uses 0,1,2,3,4,6,7,8,9. The nine digits in sequential order of the Base 9 system and that of the instrument are provided below.
| Machine |
0 |
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
| Base 9 |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
Where the digits in the instrument is between
6 and 9, if we reduce by 1, we effectively convert the instrument number to a base 9 number (the way we've learnt base 9).
In 3016, we need to replace 6 with 5.
∴ 3016 of instrument =(3015)9
(3015)9=(3×729)+(1×9)+5=2201
Answer: (1) 2201
5.5 Special Type - Bases 2 and 3
Base 2 has only 2 digits - 0 and 1. This means a number written in base 2 is the sum of exponents of 2.
For instance,
(27)10 = (11011)2 = 24+23+21+20
Therefore, if we have the numbers a1=20,a2=21,a3=22,...,an=2n−1, then any integer between 1 and (2n - 1), both inclusive, can be formed by adding one or more from a1 to an.
In fact, a1=20 to an=2n−1 results in the lowest value that n can take in order to be able form any integer between 1 and (2n−1), both inclusive.
Therefore, if n is the number of digits of the upper limit of the range when written in base 2, then n terms are required to form any integers between 1 and the upper limit.
Example 12
Ashish is given Rs. 158 in one rupee denominations. He has been asked to allocate them into a number of bags such that any amount required between Re. 1 and Rs. 158 can be given by handing out a certain number of bags without opening them. What is the minimum number of bags required?
[CAT 2001]
(1) 11
(2) 12
(3) 13
(4) None of these
Solution
20,21,...,26 can be used to form numbers from 1 to 127 (i.e., 27 - 1).
20,21,...,27 can be used to form numbers from 1 to 255 (i.e., 28 - 1). Integers between 1 and 158 can be formed using these.
So, Ashish can put 1, 2, 4, 8, 16, 32, 64 into 7 bags and the remaining 31 coins into the 8th bag. Therefore, the minimum number of bags that are required is 8 bags.
Answer: (4) None of these
Now if you need to find n integers such that by adding or subtracting them you should be able to form numbers, then the integers can be used in three ways - adding it, subtracting it or not using it. As there are three possibilities, this is akin to a base 3 system, where the digits are 1, 0 and -1.
From the perspective of solving these questions all you need to note is the following. Using the integers
30 = 1, 31 = 3 and 32 = 9, we will be able to form all numbers from 1 to 13 (i.e., 1 + 3 + 9), as shown below.
| 1 = 1 |
2 = 3 - 1 |
3 = 3 |
4 = 3 + 1 |
5 = 9 - 3 - 1 |
6 = 9 - 3 |
7 = 9 - 3 + 1 |
| 8 = 9 - 1 |
9 = 9 |
10 = 9 + 1 |
11 = 9 + 3 - 1 |
12 = 9 + 3 |
13 = 9 + 3 + 1 |
|
Therefore, the fewest number of items we would be using is
30,31,32,...,3n−1 to form any number between 1 and sum of all these terms from 30 to 3n−1, which is 23n−1.
Example 13
Ram has a pan balance with which he should be able to measure all possible integral values in kilograms (kg) between 1 kg and 100 kg (both inclusive). If he has a total of
n weights, each measuring an integral value in kg, then what is the minimum value that n can take?
Solution
Note that the weights can be placed on either side of the pan balance. For instance to measure 6 kg, we could use a 9 kg weight of the left pan and 3 kg on the right pan. This would result in measuring exactly 9 - 3 = 6 kg of items (when placed on the right pan).
Using the weights 1, 3, 9 and 27, we can measure all integers up to 1 + 3 + 9 + 27 = 40 kg.
If
34 = 81 is also used, we can measure upto 40 + 81 = 121 kg.
Therefore, minimum of 5 weights is required, i.e. 1 kg, 3 kg, 9 kg, 27 kg and 81 kg to measure any weight between 1 kg and 100 kg where the weights can be placed on either side of the pan balance.
Answer: 5