Tuesday 12 May 2015

Base System : Laying down the foundation

It's been a while but we are back with a new article today that takes up basic principles of base system and discovers its applications in various kinds of problems. This should set you up for other variants in this domain and a special new variant is present in our Number System E-book if you have bought a copy of that. Let's get started then..

General principle

The number of digits used in a particular system of writing numbers is known as the base. Our well known decimal system (or base 10) has 10 digits (0 to 9).

In general, a base-n system uses digits 0 to (n – 1). Like our count in decimal system runs in cycles of 10, another base n runs in cycles of n and moves to the next significant digit to the left when its digits get exhausted for the count.




Some basic principles
1) A number in base system n, say abc, is written as c + b*n + a*n^2. This would be familiar to writing a number, say 145, in decimal system as 5 + 4*10 + 1*100. Same principle applies for a general base n.
2) A base system N uses digits 0 to (N – 1) only for its representation.
3) A number is base N is divisible by N-1, when the sum of digits in base N is divisible by N-1
4) When digits of a number N1 in base N are rearranged to form a number N2, then N2-N1 is always divisible by N-1.
5) If a number in base N has even number of digits and that number is a palindrome, then the number is divisible by N+1



Example problems

Q1 A number 2342a121 is in base 8 and it is divisible by 7. Find the value of a.
Using principle 3,
(2 + 3 + 4 + 2 + a + 1 + 2 + 1) is divisible by 7.
(15 + a) is divisible by 7
a= 6

Q2 The value of (222) in base ‘x’ when converted to base 10 is ‘P’. The value of (222) in base ‘y’ when
converted to base 10 is Q. If (P – Q) in base 10 = 28, then what is the value of (Q – x) in base 10?

Use principle 1,
P = 2 + 2x + 2x^2
Q = 2 + 2y + 2y^2
(P – Q) = 28
2(x^2 – y^2) + 2(x – y) = 28
(x – y)(x + y + 1) = 14 = 1*14 = 2*7
[Note: Second bracket is always greater than the first hence we need not check for reverse combinations of 14*1 and 7*2.]
(x – y) = 1 and (x + y + 1) = 14
(x – y) = 1 and (x + y) = 13
x = (13 + 1)/2 = 7, y = (13 – 1)/2 = 6
Q = 2 + 2(6) + 2(36) = 86
(Q – x) = 79

(x – y) = 2 and (x + y + 1) = 7
(x – y) = 2 and (x + y) = 6
x = (6 + 2)/2 = 4, y = (6 – 2)/2 = 2
Not possible as if base y is 2 then it cannot have a number 222 existing in it since a base n uses only digits 0 to (n – 1).

Hence our answer will be distinct and equal to 79. If more than one valid values appear, you get your answer as cannot be determined.





Q3) Find the 1000th term of the sequence : 1,3,4,7,8,9,10,11,13,14,... in which there is no number which contain digit 2,5 or 6.

Standard Approach
_ : 6 numbers ; _ _ : 6*7 = 42 numbers ; _ _ _ : 6*7*7 = 294 numbers
342 numbers added till 999
1 _ _ _ : 7*7*7 = 343 added = 685 numbers till now. Remaining 1000 - 685 = 315
3 0 _ _ : 49 added
3 1 _ _ : 49 added
3 3 _ _ : 49 added
3 4 _ _ , 3 7 _ _ , 3 8 _ _ = 49*3 = 147
Total 294 more. Remaining 21
3 9 0 _ : 7
3 9 1 _ : 7
3 9 3 _ : 7
3939

Smart Approach[Using base system]
Analogous mapping of digits of this new system where 2,5,6 are absent unlike the known base 7 where 7,8,9 are not there. Remember base system is just a count. You can always map it to different digits and count differently. Only problem people face here is because we are too used to counting from 1 to 9 and further.
Mapping the available digits to the normal count, we have,


0 -> 0
1 -> 1
2 -> 3
3 -> 4
4 -> 7
5 -> 8
6 -> 9

1000th term of our series will thus be 1000[Read as one zero zero zero] in base 7 = 2626
Mapping it back to original digits <-> 3939.
[1000 = 2*343 + 6*49 + 2*7 + 6*1. Hence 1000 = 2626 in base 7.]



This brings us to the end of the helicopter view of the base system domain in number system. Someday if we find time we will take some more special application problems to enhance our knowledge or you could get started with them on your own using this as a foundation.

Until next time,


Cheers

AS

No comments:

Post a Comment