This week's book giveaway is in the Kotlin forum.We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
programming forums Java Java JSRs Mobile Certification Databases Caching Books Engineering Languages Frameworks Products This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Sheriffs:
Saloon Keepers:
Bartenders:

# [Easy]Inside a rectangle

Arjun Shastry
Ranch Hand
Posts: 1906
1
Recently appeared in one regional newspaper.
Draw a rectangle ABCD with length 'x' and width 'y'.From point A ,draw an angle bisector line AE(bisecting angle BAD) ,intersecting BC at E.From point E,draw a line perpendicular to AE,intersecting CD/AD at F.Continue this procedure until you meet in one of the corners of the rectangle.Question is:
1)Is this procedure infinite(i.e.unable to meet at one of the corners) or finite? For what ratios of x/y this procedure is finite?
2)How many of such lines AE,EF.. can be drawn before meeting one of the corners?Answer in terms of x and y.
[ October 27, 2003: Message edited by: Capablanca Kepler ]

Arjun Shastry
Ranch Hand
Posts: 1906
1
Ok, Here is what I did:
Total horizontal distance traversed = Total vertical distance traversed = L.C.M. of(x,y).
If x=y,there will be only one line.If x and y are natural numbers(and y is not a multiple of x) ,then total number of lines before meeting one of the corners is x+y-1.If y = Nx,then total number of lines will be N.

Jim Yingst
Wanderer
Sheriff
Posts: 18671
If x and y are natural numbers(and y is not a multiple of x) ,then total number of lines before meeting one of the corners is x+y-1.
If x = y = 1, then shouldn't the number of walls before hitting a corner be 0? And if x = 30, y = 40, shouldn't the number of walls be 5?

Arjun Shastry
Ranch Hand
Posts: 1906
1
Thanks for corrcetion,I think then we have to make 30/40 -->3/4 so that number of lines(of type AE,EF etc) for the rectagles of sizes 3/4 or 15/20 or 30/40 etc is 3+4-1 = 6.So 6 lines can be drawn before reaching the corner of the rectagle.If rectangle is 30/41 then I think number of lines will be 30+41-1 = 70.
[ October 29, 2003: Message edited by: Capablanca Kepler ]

 Consider Paul's rocket mass heater.