All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Logic > Weights and Scales
Nine Marbles (Posted on 2014-09-20) Difficulty: 3 of 5
Three friends Ade, Ben and Cade have 9 marbles in front of them. Their weights are as follows:
154, 16, 19, 101, 10, 17, 13, 46 and 22 grams.

Each of the three friends takes 3 marbles. Ade's bunch weighs precisely twice as much as Bill's bunch.

What is the total weight in Cade's bunch?

See The Solution Submitted by K Sengupta    
Rating: 4.5000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Computer Program Solution | Comment 5 of 6 |
The program finds only one solution whose output is:
Ade, Ben, Cade are  [16, 46, 22] [19, 10, 13] [154, 101, 17]
and their sums are  84 42 272

Python program follows:

from itertools import combinations
marbles = [154, 16, 19, 101, 10, 17, 13, 46, 22]

for ade in combinations(marbles,3):
    copy = marbles[:]
    for elem in ade:
        copy.remove(elem)
    for bill in combinations(copy,3):
        if 2*sum(bill) != sum(ade):
            continue
        copy2 = copy[:]
        for elem2 in bill:
            copy2.remove(elem2)
        cade = copy2  # because other marbles removed

        print ('Ade, Ben, Cade are ', list(ade),list(bill),list(cade))
        print ('and their sums are ', sum(ade),sum(bill),sum(cade))

Edited on November 8, 2020, 10:35 am
  Posted by Larry on 2020-11-08 10:34:27

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (25)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information