Wednesday, September 24, 2008

Problem Of The Week 25

Let X and Y be distinct 3 digit palindromes such that X>Y. How many pairs (X,Y) exist such that X-Y is also a 3 digit palindrome ?

7 comments:

  1. Have you given the solution anywhere?

    ReplyDelete
  2. I give solutions after people write their attempts !
    Post your attempt.

    ReplyDelete
  3. My answer is 1620.

    Suppose x=100*x1+10*x2+x1 =101*x1+10*x2
    y=100*y1+10*y2+y1 =101*y1+10*y2

    Hence x-y= 101*(x1-y1)+10*(x2-y2)

    10*(x2-y2) will end in zero.
    For any value of x1-y1, resultant x-y will be a palindrome if and only if x2>y2.
    For example if (x1-y1)=2, 101*(x1-y1)=202. Suppose x2-y2= 6, x-y=262, another palindrome. On the other hand, if x-y=-6, x-y=202-60=142, which is not a palindrome.

    For x1-y1=1, there are 8 pairs of x1,y1 (2,1),(3,2),(4,3),(5,4),(6,5),(7,6),(8,7) and (9,8). Corresponding to each value of x1-y1, there will be 45 pairs of (x2,y2)such that x2>y2.

    Similarly for x1-y1=2, there are 7 pairs of (x1,y1) with corresponding 45 pairs of (x2,y2).

    So on and so forth, for x1-y1=8, there is only one pair of (x1,y1) with corresponding 45 pairs of (x2,y2).

    Hence total number of ordered pairs of x and y is

    45*(8+7+6+5+4+3+2+1) = 45*36 = 1620

    Girish

    ReplyDelete
  4. you have done a minor error
    try again girish
    answer is 1980

    ReplyDelete
  5. hey Girish great solutions but the errors i think is that its not 36*45 ie but 36*55 because the middle number of both x and y can be the same ,hence 45 + 10 ( because of 10 digits ).

    ReplyDelete
  6. Let the two palindromes be
    aba=X
    cdc=Y

    Their difference is ede
    Now, for ede to be 3 digit, a>1 and c can take values from 1 upto a-1
    Now, we see that the difference is a palindrome only if the middle digit of papa(aba)is >=middle digit of munna(cdc)
    so, for a=2, c=1
    and b can take values from 0 to 9.
    For, b=0, d=0(1 value)
    b=1, d=0/1(2 values)
    so on.. we get the possible no. values =1+2+3+4+5+6+7+8+9+10=55
    Now, for a=3, c=1/2
    similarly possible values are
    a=4, c=1/2/3
    a=5, c=1/2/3/4
    a=6, c=1/2/3/4/5
    a=7, c=1/2/3/4/5/6
    a=8, c=1/2/3/4/5/6/7
    a=9, c=1/2/3/4/5/6/7/8
    so, in all a can take 1+2+3+4+5+6+7+8=36
    So, the number of possible numbers is 36*55

    ReplyDelete
  7. nice work milind, but there is not need to list down all
    just follow the pattern and
    you will get it.
    good job

    ReplyDelete