wood burning stoves*
The moose likes Meaningless Drivel and the fly likes The Machine Game Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Meaningless Drivel
Bookmark "The Machine Game" Watch "The Machine Game" New topic
Author

The Machine Game

Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
Anyone who wanna try this?
Quite and old and comon game...

I got 10 machines dishing out coins of 10 grams each.... One machine becomes faulty and dishes out an 11 gram coin.
With just one try on an electronic display weighing scale, how do i determine the faulty one?
Rambo Prasad
Ranch Hand

Joined: Feb 23, 2006
Posts: 628
set the machine such that the 1 st machine dishes out 1 coin..2nd machine 2 cone....10th machine 10 coin...

Now summation of all coins =10(1+2...10)= 10*10*11/2=550---1

Now weigh all the coins...you will get X----2

Now subtract 1 from 2 and then divide by 10 you will get the answer...


Helping hands are much better than the praying lips
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1006
    
    3
Originally posted by Pratik Lohia:
Anyone who wanna try this?
Quite and old and comon game...

I got 10 machines dishing out coins of 10 grams each.... One machine becomes faulty and dishes out an 11 gram coin.
With just one try on an electronic display weighing scale, how do i determine the faulty one?


This type of problem has been popping up in the Programming Diversions forum even though it doesn't really have much to do with programming.

Anyhow...

Grab...
1 coin from machine 1 plus
8 coins from machine 2 plus
7 coins from machine 3 plus
4 coins from machine 4 plus
5 coins from machine 5 plus
6 coins from machine 6 plus
3 coins from machine 7 plus
2 coins from machine 8 plus
9 coins from machine 9 plus
10 coins from machine 10

Weigh them all together. Cube that result. The last digit of that result shows the malfunctioning machine (last digit==0 -> machine 10).
 
 
subject: The Machine Game
 
Similar Threads
Find the faulty machine
Solve this puzzle.
Getting NullPointerException
Another puzzle
multiple iframe submit