VOOZH about

URL: https://www.geeksforgeeks.org/aptitude/puzzle-4-pay-an-employee-using-a-gold-rod-of-7-units/

⇱ Puzzle | Pay an employee using a gold rod of 7 units ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Puzzle | Pay an employee using a gold rod of 7 units ?

Last Updated : 27 Apr, 2026

An employee works for an employer for 7 days. The employer has a gold rod of 7 units length. How does the employer pay the employee, so that the employee’s total gold increases by 1 unit each day? The employer can make at most 2 cuts in the rod. 

👁 pay_an_employee_using_a_gold_rod_of_7_units_

(Hint- after the end of the day, employees can't spend any part of the rod)

Check if you were right - full answer with solution below.

Solution:

The employer can pay the employee for seven days by making two cuts, resulting in three rods of lengths 1, 2, and 4 units.

DayAction Taken by EmployerRods with EmployeeTotal Gold
1Gives 1 unit rod11
2Takes 1, gives 222
3Gives 11 + 23
4Takes 1 & 2, gives 444
5Gives 14 + 15
6Takes 1, gives 24 + 26
7Gives 14 + 2 + 17

How does this work?

We use powers of 2, the same idea as decimal to binary conversion. These allow us to express any number from 1 to 7 via binary:

Notice that 7 = 2³ - 1. This means, with three pieces (after two cuts), we can represent any number from 1 to 7 by combining the lengths 1, 2, and 4 ,which are powers of 2:

  • 2⁰ = 1
  • 2¹ = 2
  • 2² = 4

This is just like binary numbers, where we can express any number using combinations of powers of 2. With 3 such pieces, we can form all sums from 1 to 7:

  • 1
  • 2
  • 1 + 2 = 3
  • 4
  • 4 + 1 = 5
  • 4 + 2 = 6
  • 4 + 2 + 1 = 7

So each day, the employee gets a total of rods that sum up to the day's number by giving, taking back, or combining the existing pieces. This clever method ensures daily payment without needing more than 2 cuts.

Comment
Article Tags: