Puzzles of strange coinage (increasing in difficulty).

13 thoughts on “Puzzles of strange coinage (increasing in difficulty).

  1. the real problem is what if the transaction forces one of the members to be left with 1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 13, 15, 16, 18, 19, 22, 23, 25, 26, 29, 32, 33, 36, 39, 43, 46, or 53 pesos?

    1. That would be a different problem statement with different constraints. Like “however much money you have in your pocket, this coffee is going to cost you exactly one peso less than your pocketful of change”, and it would be impossible to settle.
      As written though, the cost of the meal is, in each case, a specific amount that is independent of the exact amount of cash you have on hand (and implicitly assumes you have at least enough coins to make it happen, which could be significantly more than the cost of the bill).

  2. First problem easy as you say. 2 10s and 2 7s is 34, and change from 6 is 4 7s. At this point I see an equation and modular arithmetic is needed for future problems. I hope it’s ok to put solutions in comments.

      1. Here are my asnwers. To avoid spoilers, they are written in Spanish and then rot13.

        1. CNTN QBF ZBARQNF QR QVRM, ERPVOR QBF ZBARQNF QR FVRGR
        2. BPUB ZBARQNF
        3. FRFRAGN L FRVF
        4. AB

      2. Here are my answers – don’t scroll down unless you want spoilers (or want to correct me):

        M
        O
        N
        E
        Y
        M
        O
        N
        E
        Y
        M
        O
        N
        E
        Y
        M
        O
        N
        E
        Y
        M
        O
        N
        E
        Y
        M
        O
        N
        E
        Y

        Chapter 1:
        Bill = 6p.
        Pay with two x 10p coins = 20p.
        Change with two x 7p coins = 14p.
        20 – 14 = 6. Total coins exchanged = 4 coins.

        Chapter 2:
        Bill = 5p Total coins exchanged = 8
        This is the maximum number of coins exchanged for the bills between 1-10p

        Chapter 3:
        Bill = 29p Total coins exchanged = 9
        This is the next highest number of coins exchanged after 8.

        Chapter 4:
        The most challenging but exciting of all chapters.
        I don’t know python so I used MS Excel formulae and VBA macros.
        My codes are far from the most efficient and there was a fair bit of trial and error and assistance from ChatGPT but I think I got there in the end…

        Denominations of two even numbers are not possible to give change for all bills between 1-100p. Neither are denomination combos of multiples of 3 (e.g. 3,6 or 3,9).
        Testing for all other denomination combinations, it would seem that 7,10 is a very efficient combination although NOT the most efficient.
        The smaller denominations end up having lots of coins required for larger bills so the rumour that the government is causing busy work with 7,10 is not true.
        However, the government could make their people less busy by using a 9,10 coin combination.
        I calculated an EV (Efficiency Value) for each combination, which is the total number of coins in every exchange for bills 1-100p.
        Here are some examples:
        EV (1,2) = 2550
        EV (3,5) = 1094
        EV (7,10) = 694
        EV (8,9) = 690
        EV (9,10) = 670

        I look forward to going to a holiday destination like this in the future : )

        1. Hello:
          A couple of comments on Chris’ answers.
          Chapter 3: 29 = 5*10-3*7, so that’s eight coins.
          Chapter 4. I get the same values for EV(x,y) for all the pairs (x,y) that you show, except for EV(7,10)=688.
          Best regards,

        2. For Chapter 3: I get 66 as the lowest bill requiring more than 8 coins (it requires 9: 8*7 + 10)

          I also find EV (7, 10) as 688. Looking at your values Chris, my calculations disagree on the following:

          29: 8, not 9 (5*10 – 3*7)
          46: 8, not 9 (6*10 – 2*7)
          63: 8, not 9 (7*10 – 1*7)
          73: 9, not 10 (8*10 – 1*7)
          83: 10, not 11 (9*10 – 1*7)
          93: 11, not 12 (10*10 – 1*7)

          All in all that’s 6 fewer coins (so 688 instead of 694)

  3. Thanks for the feedback Mariano.
    I had a look more closely at my code and found some limitations.
    Perhaps you can check your answers for 1-100 against mine.
    29 is an issue for me because my code looks up the smallest amount of ‘change’ given which is 20. It then adds 20 to 29 = 49 and works out the coins used for 49 (7*7) and 20 (2*10). But as you point out, change of 21 results in less coins in total so my code would miss that.
    I think the following bills cause issues with my code:
    29, 39, 46, 56, 63, 73, 80, 90, 97.

    7,10
    EV = 694
    Bill Total coins
    1 5
    2 7
    3 2
    4 3
    5 8
    6 4
    7 1
    8 6
    9 6
    10 1
    11 4
    12 8
    13 3
    14 2
    15 7
    16 5
    17 2
    18 5
    19 7
    20 2
    21 3
    22 8
    23 4
    24 3
    25 6
    26 6
    27 3
    28 4
    29 9
    30 3
    31 4
    32 7
    33 5
    34 4
    35 5
    36 7
    37 4
    38 5
    39 8
    40 4
    41 5
    42 6
    43 6
    44 5
    45 6
    46 9
    47 5
    48 6
    49 7
    50 5
    51 6
    52 7
    53 7
    54 6
    55 7
    56 8
    57 6
    58 7
    59 8
    60 6
    61 7
    62 8
    63 9
    64 7
    65 8
    66 9
    67 7
    68 8
    69 9
    70 7
    71 8
    72 9
    73 10
    74 8
    75 9
    76 10
    77 8
    78 9
    79 10
    80 8
    81 9
    82 10
    83 11
    84 9
    85 10
    86 11
    87 9
    88 10
    89 11
    90 9
    91 10
    92 11
    93 12
    94 10
    95 11
    96 12
    97 10
    98 11
    99 12
    100 10

Leave a Reply to ChrisCancel reply