Solve this Puzzle in Python


Solve this Puzzle in Python

Solve this Puzzle in Python


I would like to present you a very interesting puzzle. It was asked by maths teacher in high school ( not to solve in Python, but solve in pen and paper ). I could solve it back then ( where my "method" was not good and the way i found it is still a "mystery" to me. ). Even a few days back, I admit I couldn't find a method to solve this except brute forcing.

So I decided to apply brute-forcing for this puzzle in Python, and I asked this question in But I was really surprised seeing the answers provided there. I would like to share this with you.

This is the puzzle :

A merchant has a 40 kg weight which he used in his shop. Once, it fell from his hands and was broken into 4 pieces. But surprisingly, now he can weigh any weight between 1 kg to 40 kg with the combination of these 4 pieces.
So question is, what are weights of those 4 pieces?
Try to solve this puzzle in Python. If you can't, find its answer here.
With Regards,

2 Comments on OpenCV-Python: Solve this Puzzle in Python

  • Swami Gulagulaananda
    on May 07, 2012 | 21:36 Swami Gulagulaanandasaid :
    "There's a property of powers of 3 which is used for such problems."
  • abidk
    on May 07, 2012 | 21:39 abidksaid :
    "Yeah. I haven't known about it. Do you know more about this? Can you share it with us?"

Report "Solve this Puzzle in Python"

Are you sure you want to report this post for ?