Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

The Machine Game

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 628
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Rancher
Posts: 1197
22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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).
    Bookmark Topic Watch Topic
  • New Topic