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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Paul Clapham
• Ron McLeod
• Jeanne Boyarsky
• Tim Cooke
Sheriffs:
• Liutauras Vilda
• paul wheaton
• Henry Wong
Saloon Keepers:
• Tim Moores
• Tim Holloway
• Stephan van Hulst
• Carey Brown
• Frits Walraven
Bartenders:
• Piet Souris
• Himai Minh

# cut a certain stripe of a square

Ranch Hand
Posts: 1923
• Number of slices to send:
Optional 'thank-you' note:
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.

I hope it's new to the most of you.

Well here is a graphical representation of the quiz.
At the bottom of the page is a link to the solution.
[ April 24, 2006: Message edited by: Stefan Wagner ]

[ April 24, 2006: Message edited by: Stefan Wagner ]
[ April 24, 2006: Message edited by: Stefan Wagner ]

Greenhorn
Posts: 22
• Number of slices to send:
Optional 'thank-you' note:
Trick question.. The stripe will never fit.

Stefan Wagner
Ranch Hand
Posts: 1923
• Number of slices to send:
Optional 'thank-you' note:
Ajay: Why? Give a prove, or at least a reason.

Marshal
Posts: 27211
87
• Number of slices to send:
Optional 'thank-you' note:
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.)

Stefan Wagner
Ranch Hand
Posts: 1923
• Number of slices to send:
Optional 'thank-you' note:
Well, Paul, have a nice sleep, and read the next morning this:

I added a restriction for the too clever ones:

(Note: An turning angle of n*90�, n being an integer, is not allowed.)

Ajay A Patil
Greenhorn
Posts: 22
• Number of slices to send:
Optional 'thank-you' note:
Stefan..

Ajay: Why? Give a prove, or at least a reason.

The hypotenus of a right-angle triangle cannot be the same length
as one of the other sides.

But, the problem was really nice.
I am sorry if I spoilt it for the others.

Ajay A Patil
Greenhorn
Posts: 22
• Number of slices to send:
Optional 'thank-you' note:
I am sorry. my reason/proof is wrong.
** lol ** need to give more thought.

Ajay A Patil
Greenhorn
Posts: 22
• Number of slices to send:
Optional 'thank-you' note:
Noticed that
N sin a + c cos a = N - c
N cos a + c sin a = N

But, unable to solve this and get 'c' in terms of 'N'.

Paul Clapham
Marshal
Posts: 27211
87
• Number of slices to send:
Optional 'thank-you' note:
Or:

(1) c sin a = N (1 - cos a)
(2) c (1 + cos a) = N (1 - sin a)

Multiply (1) by 1 + cos a:

(3) c sin a (1 + cos a) = N sin2 a [that's sine-squared a]
(4) c (1 + cos a) = N sin a

Combine (2) with (4):

(5) sin a = 1/2
(6) cos a = sqrt(3)/2
(7) c = N (2 - sqrt(3))

Stefan Wagner
Ranch Hand
Posts: 1923
• Number of slices to send:
Optional 'thank-you' note:
Fast solution, Paul. (I needed 3 starts in 4 years to solve this f...in' problem ).
Can you tell me where a is, because I used a different way to find the same solution?
my way:

Paul Clapham
Marshal
Posts: 27211
87
• Number of slices to send:
Optional 'thank-you' note:
"a" is the angle in the small triangle at the lower left of the square, about where "b/)'y" is at the bottom of your diagram.

Bartender
Posts: 1205
22
• Number of slices to send:
Optional 'thank-you' note:

Originally posted by Paul Clapham:
"a" is the angle in the small triangle at the lower left of the square, about where "b/)'y" is at the bottom of your diagram.

Or even better...

It's where the "a)" is in the top line. In fact, I assumed that's how Ajay picked the variable a for that angle.

Stefan Wagner
Ranch Hand
Posts: 1923
• Number of slices to send:
Optional 'thank-you' note:
Ah - you're talking about the ascii-art.
I'm searching and searching the real graphics on the webpage ...

Paul Clapham
Marshal
Posts: 27211
87
• Number of slices to send:
Optional 'thank-you' note:

Originally posted by Stefan Wagner:
Ah - you're talking about the ascii-art.

Of course. I didn't even look at the web page until I had the answer. Would have been cheating.

 Don't MAKE me come back there with this tiny ad: free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter