Log In

Squaring a triangle

Posted on: March 1st, 2014 by
5

A triangle is formed by arranging 1+3+5+7+...(2n-1) = n^2 coins as shown in the figure below.
triangle_square
What is the minimum number of coins that you need to move so that you can form a square that uses all the coins?

- via Algorithmic puzzles


5 Responses to Squaring a triangle

  1. Sid Hollander had this to say about that:

    If the nth row has 2n-1 coins in it you need to move 2n-2 coins. Keep the central coin in the row fixed and fill in all the holes with the remaining ones in the nth row. (The cental coin and the apex will be the endpoints of a diagonal of the square formed.

    • Mike Earnest had this to say about that:

      You can do faster if you make a square which is rotated 45 degrees from horizontal.

  2. admin had this to say about that:

    Click for Solution.

    The right answer depends on your interpretation of what it means to use all the coins to form a square, but the solution I have moves \lfloor {n\over 2}\rfloor\times \lfloor {n\over 2}\rfloor coins as shown in the figure below. '+' indicates a coin placed at that location and '-' indicates a coin removed from that location. '.' indicates an unmoved coin. It will be interesting to see your detailed explanation.

    • Sid Hollander had this to say about that:

      You said "The right answer depends on your interpretation of what it means to use all the coins to form a square" and then gave ONLY a single interpretation. If you don't give another then I imagine that in all problems you could give an "it depends.." answer. How does your answer work for the case when n = 1?

    • Sid Hollander had this to say about that:

      Clearly in the bottom figure of your explanation there were 5^2 original coins. i.e. n=5.
      Your answer suggests that that the number of moves should be 5/2 x 5/2 which equals 6.25 moves??? You moved 6.0000 moves?
      Is your interpretation correct?


{"result":"error", "message":"You can't access this resource as it requires an 'view' access for the website id = 1."}