This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Draw a square with width N. Cut of a rectangular stripe of width c at the right. Turn the stripe inside the remaining rectangle, so that all corners will be positioned on the resulting outer rectangle. How long has the width of the cut to be, to make the stripe fit?
(Note: An turning angle of n*90�, n being an integer, is not allowed.)
Schematical image - the outer rectangle shall be a square.
Why isn't this shown in monospace-font? Copy it to a monospaced-font editor to view it right
Well - it's more a geometrical/ mathematical diversion, but I needed assistance from Java to find a nearly solution iterating, and on that way I observed some details, which helped solving it mathematically.
c = N/2 works nicely (just fold the square in half).
(No, I didn't get that by geometric intuition. I derived the equation N sin a + c cos a = N - c and noticed that a = 0 gave that solution. It's time to go to bed so I'm not going to look for nontrivial solutions just now.)