Results 1 to 7 of 7

Math Help - Is there a mathmatical solution to this problem?

  1. #1
    Newbie
    Joined
    Aug 2007
    Posts
    3

    Exclamation Is there a mathmatical solution to this problem?

    Could you please explain aswell as giving me the answer, thanks (=
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Aug 2007
    Posts
    3
    The archivist misplaced his shopping list inside one of the books. He has a handy way to remember which volume he placed it in, though. The volume number was a four-digit number, in which all four digits were unique. If you take the largest possible four-digit number that can be made by rearranging the four digits, and you subtract from that the smallest possible four-digit number that can be made by rearranging the four digits, the number you get is volume number, but with the digits in reverse order.

    In what volume of the Encyclopedia Altadoria did he leave his shopping list?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Aug 2007
    Posts
    3
    There are 9950 books in the library.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Aug 2007
    Posts
    23

    Hmm

    Using what you described there is no way to find the volume directly.

    However, if you mean that the largest possible 4 digit number that any book in the library can be (with all unique digits) then that would be 9876 (because 9950 has 2 x 9), and we want the largest we can obtin so make each digit 1 smaller than the last. The smallest possible would be 0123.
    If this is correct then all you do is subtract the smaller from the larger, reverse the digits and get the volume.

    However if you mean what you say exactly, it's not possible to work out directly (i think) because the volume number is unknown, the largest and smallest could be any one of many many permutations.
    Last edited by Alias_NeO; August 27th 2007 at 01:59 PM. Reason: Mistake.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Aug 2007
    Posts
    10

    The answer

    The solution to this problem is 4716

    The largest number obtained from rearranging the digits is 7641
    The smallest number obtained from rearranging the digits is 1467

    Subtract the smaller from the larger to get 6174

    Reverse the order of 6174 and you get 4716 which is the number we started with. Interestingly there is only one number between 0000 and 9999 that has this property.

    You could say I cheated to get this answer as I wrote a BASIC algorithm to solve it by trial and error. I have posted the program below, with hopefully enough comments to make it self explanatory. The challenge now is to discover if there is a logical or algebraic method to solve this question without needing to resort to a computer.


    REM ***** BASIC *****
    Sub Main
    Dim N(4),P(4),T(4),RT(4) As Integer

    For i = 0 to 9950
    digitize(i,N()) Rem Split i into 4 digits stored in array N().
    If isunique(N()) then
    largest(N()) Rem If all the digits are unique then rearrange to find the largest number.
    NN=N(1)*1000+N(2)*100+N(3)*10+N(4) Rem NN is the value of the largest number express as a single variable.
    P(1)=N(4) : P(2)=N(3) : P(3)=N(2) : P(4)= N(1) Rem Reverse the digits of N to find the smallest value.
    PP=P(1)*1000+P(2)*100+P(3)*10+P(4) Rem PP is the smallest value.
    TT=NN-PP
    digitize(TT,T()) Rem Subtract smallest from largest, digitise it and reverse the digits.
    RT(1)=T(4) : RT(2)=T(3) : RT(3)=T(2) : RT(4)= T(1)
    NT=RT(1)*1000+RT(2)*100+RT(3)*10+RT(4) Rem Find the actual value of the reversed digits.
    If NT=i then
    Print "Found a solution ";i;" ";NN;" -";PP;"=";TT;" <--> ";NT
    end if
    end if
    next i
    msgbox "No more solutions"
    end Sub

    Sub digitize(ii,Q())
    k=ii
    Q(1)=Fix(k/1000) : k= k-Q(1)*1000
    Q(2)=Fix(k/100) : k= k-Q(2)*100
    Q(3)=Fix(k/10) : k= k-Q(3)*10
    Q(4)=k
    end sub

    Function isUnique(Q()) as boolean
    For j=1 to 4
    For k=j+1 to 4
    If Q(j)=Q(k) then
    isUnique = false
    exit function
    end if
    next k
    next j
    isUnique=true
    end function

    Sub reverse_digits(Q(),R())
    R(1)=Q(4) : R(2) =Q(3) : R(3)=Q(2) : R(4)= Q(1)
    end sub

    Sub largest(Q())
    For j=2 to 4
    For k = j to 4
    If Q(k)>Q(j-1) then
    temp = Q(j-1) : q(j-1)=q(k) :Q(k)=temp
    end if
    next k
    next j
    end sub






    Follow Math Help Forum on Facebook and Google+

  6. #6
    Super Member

    Joined
    May 2006
    From
    Lexington, MA (USA)
    Posts
    11,707
    Thanks
    626
    Hello, kirsty_b!

    The archivist misplaced his shopping list inside one of the books.
    He has a handy way to remember which volume he placed it in, though.
    The volume number was a four-digit number, in which all four digits were unique.
    If you take the largest possible four-digit number that can be made
    by rearranging the four digits, and you subtract from that the smallest
    possible four-digit number that can be made by rearranging the four digits,
    the number you get is volume number, but with the digits in reverse order.

    In what volume of the Encyclopedia Altadoria did he leave his shopping list?

    One possible answer: . 4716

    The largest permutation is: 7641
    The smallest permutation is: 1467

    The difference is: . 7641 - 1467 \:=\:6174

    Hence, the volume number is 4716.



    Are there any other solutions? . . . I don't know.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Newbie
    Joined
    Aug 2007
    Posts
    10
    There are no other solutions. 4716 is the only possible solution.

    My algorithm above checked every permutation from 0000 to 9999

    I am still curious if there is a way to deduce this solution without the brute force method of checking every permutation?
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Mathmatical modeling
    Posted in the Math Topics Forum
    Replies: 1
    Last Post: November 21st 2011, 02:06 AM
  2. [SOLVED] Please help me with the solution for this problem
    Posted in the Algebra Forum
    Replies: 8
    Last Post: July 25th 2010, 08:12 PM
  3. Dishwashing mathmatical help
    Posted in the Algebra Forum
    Replies: 7
    Last Post: June 6th 2010, 07:32 AM
  4. Need a solution to this problem
    Posted in the Statistics Forum
    Replies: 20
    Last Post: January 8th 2009, 08:26 PM
  5. Another Mathmatical Problem..
    Posted in the Advanced Statistics Forum
    Replies: 9
    Last Post: August 8th 2006, 03:59 AM

Search Tags


/mathhelpforum @mathhelpforum