Gold Chain

A man has a gold chain with 7 links. he needs the service of a laborer for 7 days at a fee of one gold link per day. however, each day of work needs to be paid for separately. in other words, the worker must be paid each day after working and if the laborer is ever overpaid he will quit with the extra money. also he will never allow himself to be owed a link.

what is the fewest # of cuts to the chain to facilitate this arrangement and how does that guarantee payment?

Solution

Can we get change back from the laborer?

If so, we cut one link to make a chain of 4 links, a chain of 2 links and the cut link itself.

Day 1, we give him the cut link
Day 2, we take back the cut link, give him the 2 link chain
Day 3, we give him the cut link
Day 4, we take back both the cut link and the 2 link chain, give him the 4 link chain
Day 5, we give him the cut link
Day 6, we take back the cut link, give him the 2 link chain
Day 7, we give him the cut link

2026 Update: Greedy Algorithms and Change-Making

The Gold Chain puzzle (you have a 23-link chain and must pay exactly 1 link per day for 23 days of hotel — what is the minimum number of cuts to make?) is a greedy/binary representation problem. The optimal solution is to cut links 1, 2, 4… in a pattern that allows you to make exact change for any amount up to 23, just like binary number representation.

The minimum cuts insight: With cuts at links 1, 3, 8… you can represent any value 1-23 as a combination of these pieces. This is exactly the problem of finding a minimal set of denominations that covers all values up to N — the same as optimal banknote design.

def min_cuts_for_chain(n):
    """
    Find minimum cuts to pay exactly 1..n units per day.
    Equivalent to: find smallest set of numbers that sum to n
    and can represent all values 1..n through subset sums.
    Greedy: each piece should be 1 + sum_of_previous_pieces.
    """
    pieces = []
    remaining = n

    while remaining > 0:
        next_piece = sum(pieces) + 1  # Can cover 1 more than current total
        next_piece = min(next_piece, remaining)
        pieces.append(next_piece)
        remaining -= next_piece

    return pieces

pieces = min_cuts_for_chain(23)
print(f"Cut into pieces: {pieces}")  # [1, 2, 4, 8, 8] or similar
print(f"Number of cuts: {len(pieces) - 1}")  # n-1 cuts for n pieces

Modern application: This is essentially the coin change problem variant of “design the minimum number of coin denominations to make exact change for all values 1-N.” It appears in: payment system denomination design, address space layout in OS memory management, and time-of-use pricing tier design.

💡Strategies for Solving This Problem

The Payment Problem

Classic logic puzzle. You have a gold chain with n links and need to pay someone 1 link per day for n days. What's the minimum number of cuts needed?

The Problem Setup

Gold chain has n links in a row. You need to pay 1 link per day for n days. You can make cuts to create pieces, and pieces can be traded back and forth.

Example: 7 links, need to pay 1/day for 7 days. How many cuts minimum?

Key Insight

You can get pieces back! Day 1: give 1 link. Day 2: give 2-link piece, get 1 link back. Day 3: give that 1 link back (now they have 3 total).

This is like representing numbers in base 2, but with "trading back" allowed.

The Pattern

With k cuts, you get k+1 pieces. You can pay up to 2^k - 1 days if pieces are sized correctly.

Optimal piece sizes: 1, 2, 4, 8, ... (powers of 2)

For n links, need ceiling(log2(n+1)) cuts.

Example: 7 Links

Make 2 cuts to create pieces of size 1, 2, 4:

  • Day 1: Give 1
  • Day 2: Give 2, take back 1
  • Day 3: Give 1 (they have 3)
  • Day 4: Give 4, take back 1 and 2
  • Day 5: Give 1 (they have 5)
  • Day 6: Give 2, take back 1
  • Day 7: Give 1 (they have 7)

Answer: 2 cuts for 7 links.

At Various Companies

This is more of a logic puzzle than coding problem. Tests your ability to see patterns and think about state representation. Similar to making change with coins problem.

Scroll to Top