VOOZH about

URL: https://www.geeksforgeeks.org/aptitude/puzzle-how-many-chickens-were-sold-by-the-farmer/

⇱ Puzzle - How many Chickens were sold by the farmer? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Puzzle - How many Chickens were sold by the farmer?

Last Updated : 18 Jan, 2023

A farmer bought chickens for 4 unique clients on a selected day. Each customer buys half the amount of chicken left till his turn and half a chicken (i.e., if x chicken were left he buys x/2 + 1/2). The fourth customer buys a single chicken and after his turn, no chicken was left. Can you find the number of chickens the farmer bought on that day?

👁 How many Chickens were sold by the farmer?
 How many Chickens were sold by the farmer?

Answer:

Let, the customers are C1, C2, C3, and C4 and the Number of chickens is X.

The first customer will buy (X/2 + 1/2) chicken and the left amount will be X - (X/2 + 1/2) = (X - 1)/2.

👁 Chicken sold to first customer
Chicken sold to first customer

The amount of chicken the second customer will buy is (X-1)/4 + 1/2 = (X+1)/4. So the amount of chicken left will be 
(X - 1)/2 - (X + 1)/4 = (X-3)/4.

👁 Chicken sold to Customer 2
Chicken sold to Customer 2

The amount of chicken bought by the third customer will be ((X-3)/4)/2 + 1/2 = (X-3)/8 + 1/2 = (X+1)/8. So the remaining amount of chicken is (X - 3)/4 - (X + 1)/8 = (X - 7)/8.

👁 Chicken sold to Customer 3
Chicken sold to Customer 3

The amount of chicken bought by the fourth customer is ((X-7)/8)/2 + 1/2 = (X - 7)/16 + 1/2 = (X + 1)/16. The amount of chicken left is (X - 7)/8 - (X + 1)/16 = (X - 15)/16.

👁 Chicken sold to Customer 4
Chicken sold to Customer 4

Given that the fourth customer purchased only single chicken and no chicken is left after his purchase:

(X - 15)/16 = 0
So X - 15 = 0
X = 15

Therefore, the farmer sold 15 chickens on that particular day to each customer as follows,

Customer 1: C1 = (15 + 1)/2 = 8 Chickens
Customer 2: C2 = (15 + 1)4  = 4Chickens
Customer 3: C3 = (15 + 1)/8 = 2 Chickens
Customer 4: C4 = (15 + 1)/16 = 1 Chicken

Comment
Article Tags: