Brain Teasers
Three Digit Employee Id!!!
Two years ago, a problem surfaced at the Romankachi Pharmaceuticals Ltd. - one of the many companies belonging to the huge Romankachi conglomerate.
We were devising a three digit id (nonzero first digit) for the employees such that no two employees can have id's that are identical when written in the reverse order. For example, 123 and 321 are identical and hence only one of them can exist. Also a 3 digit id starting with a 0 was invalid since the machine used for swiping does not recognize a 3 digit id starting with a 0.
After a lot of careful analysis and discussion, we were able to figure out the maximum number of employees that could use this system. Can you repeat the feat?
We were devising a three digit id (nonzero first digit) for the employees such that no two employees can have id's that are identical when written in the reverse order. For example, 123 and 321 are identical and hence only one of them can exist. Also a 3 digit id starting with a 0 was invalid since the machine used for swiping does not recognize a 3 digit id starting with a 0.
After a lot of careful analysis and discussion, we were able to figure out the maximum number of employees that could use this system. Can you repeat the feat?
Answer
It has been mentioned that a 3 digit code starting with a 0 is invalid. Hence we cannot use codes from 001 to 099.Hence the total number of valid 3 digit id's is 900.
Out of these, three digit numbers that are symmetrical will have the same first and the last digit. The first and the last digit in this case can be selected in 9 ways(any number from 1 to 9). The second digit can be selected in 10 ways(any number from 0 to 9). Therefore number of symmetrical three digit numbers = 9*10 = 90. These 90 id's will not have a corresponding number when written in reverse order.
Secondly numbers ending with a zero will also not have a corresponding 3 digit number when written in reverse order. For example, reverse of 910 is 019 which is not a valid three digit code due to the condition given that 3 digit codes starting with 0 are invalid. Number of such three digit numbers = 9*10 = 90.
Rest of the (900-180) = 720 numbers can be classified into two groups of 360 numbers each, where corresponding pairs of numbers will be identical when written in reverse order. Hence consider only 360 of these numbers.
Therefore total number of valid employee id's possible = 90 + 90 + 360 = 540.
Hide Answer Show Answer
What Next?
View a Similar Brain Teaser...
If you become a registered user you can vote on this brain teaser, keep track of which ones you have seen, and even make your own.
Solve a Puzzle
Comments
Well I liked it!
I did not find it as difficult as its rating, but I also found it more fun than its rating. I guess some people do not like math.
I think I disagree with the answer, and would love for someone to tell me where I went wrong...
If the first number is a 1, the second number can be anything, and the third number can be any number between 2 and 9 (can't be 0 because if reversed would be 0xx, which is disallowed, and can't be 1 because we would otherwise read it the same forwards and back.) So there are 10*8 numbers that we can use starting with a 1.
For numbers starting with a 2, there are 10*7 numbers. With a 3, 10*6. And so on.
This leads to a total of 10*8 + 10*7 + 10*6 + ... + 10*2 + 10*1 = 360 different combinations of usable numbers.
This is, incidentally, 900 - 540; it looks like the proposed solution mixed between counting good numbers and bad ones. Does this look right to anyone else?
If the first number is a 1, the second number can be anything, and the third number can be any number between 2 and 9 (can't be 0 because if reversed would be 0xx, which is disallowed, and can't be 1 because we would otherwise read it the same forwards and back.) So there are 10*8 numbers that we can use starting with a 1.
For numbers starting with a 2, there are 10*7 numbers. With a 3, 10*6. And so on.
This leads to a total of 10*8 + 10*7 + 10*6 + ... + 10*2 + 10*1 = 360 different combinations of usable numbers.
This is, incidentally, 900 - 540; it looks like the proposed solution mixed between counting good numbers and bad ones. Does this look right to anyone else?
I think the reverse numbers are anyways disallowed, so why cant the third digit be 0 like 900.Because the question says that only one of the digit or its reverse can exist.In this case 900 exists and obviously 009 does not,which satisfies the conditions given in the question.I find the wordings wrong!
For numbers 000 to 999, we remove the symmetrical numbers, that is 000, 010, 020, ..., 979, 989, 999. That leaves us with 1000 - 100 (total symmetrical numbers) = 900. This 900 can now be divided into 2 because half of it is just identical to the other half. It doesn't matter if the number starts or ends in zero.
For example, 450 is valid, but 054 is invalid. That would count as 1.
But if 451 is valid, 154 is also invalid because they are identical when written in the reverse order. So that would also count as 1.
So 900/2 = 450. Then we'll add the symmetrical numbers not starting with 0 (101, 111, 121, ..., 979, 989, 999; a total of 90).
So the answer would be 450 + 90 = 540!
For example, 450 is valid, but 054 is invalid. That would count as 1.
But if 451 is valid, 154 is also invalid because they are identical when written in the reverse order. So that would also count as 1.
So 900/2 = 450. Then we'll add the symmetrical numbers not starting with 0 (101, 111, 121, ..., 979, 989, 999; a total of 90).
So the answer would be 450 + 90 = 540!
I did it a little differently. After analyzing the problem for a few seconds I calculated the answer as
(11*5-1) * 10 = 540
All middle digits are allowed, so I ignored it to start and just considered the first and last. For simplicity sake I also only considered numbers where the first digit is greater than or equal to the first. So there are ten combinations with a first digit of nine, nine with a first digit of eight, etc. down to two with a first digit of one. This is the sum of the numbers from two to ten or 11*5-1=54. (The sum of the numbers from A to B is (A+B)*(A-B+1)/2, but more simply, the sum of the numbers from 1 to N is (N+1)*(N/2), so I just used that minus 1 instead of 12*9/2.) Then I just multiplied by the ten choices for the middle digit.
(11*5-1) * 10 = 540
All middle digits are allowed, so I ignored it to start and just considered the first and last. For simplicity sake I also only considered numbers where the first digit is greater than or equal to the first. So there are ten combinations with a first digit of nine, nine with a first digit of eight, etc. down to two with a first digit of one. This is the sum of the numbers from two to ten or 11*5-1=54. (The sum of the numbers from A to B is (A+B)*(A-B+1)/2, but more simply, the sum of the numbers from 1 to N is (N+1)*(N/2), so I just used that minus 1 instead of 12*9/2.) Then I just multiplied by the ten choices for the middle digit.
My previous comment should say "...the first digit is greater than or equal to the last...".
To post a comment, please create an account and sign in.
Follow Braingle!