## Infinite Inscribed Squares

**Moderators:** gmalivuk, Moderators General, Prelates

### Infinite Inscribed Squares

Hello fellows! I just joined the forum to post a problem that looks easy enough, but has been defying me for the past few days, here it is (I made it up, so I don't have a solution nor a correct spelling, but I will try ):

Given a circumference O and an inscribed square ABCD whose side lenght is l. Inscribe now a square EFGH in AB in a way that EF lies on the square side AB and G and H lie on the circumference. Inscribe now a square in GH and so on to infinity.

Find the sum of the areas of the squares.

Thank you in advance, be sure to ask for clarifications.

EDIT: For the mods, you can delete my second topic, I thought I didn't hit "submit" or something. Instead it was just waiting to be approved

Given a circumference O and an inscribed square ABCD whose side lenght is l. Inscribe now a square EFGH in AB in a way that EF lies on the square side AB and G and H lie on the circumference. Inscribe now a square in GH and so on to infinity.

Find the sum of the areas of the squares.

Thank you in advance, be sure to ask for clarifications.

EDIT: For the mods, you can delete my second topic, I thought I didn't hit "submit" or something. Instead it was just waiting to be approved

Last edited by Squarian on Tue Feb 16, 2016 4:51 pm UTC, edited 1 time in total.

- Xanthir
- My HERO!!!
**Posts:**5426**Joined:**Tue Feb 20, 2007 12:49 am UTC**Location:**The Googleplex-
**Contact:**

### Re: Infinite Inscribed Squares

Squarian wrote:Given a circumference O and an inscribed square ABCD whose side lenght is l.

Did you means "1"? Naming a variable lowercase L is terrible practice in any case, but also, since this is the only length given, naming it and just setting it equal to 1 are equivalent.

Inscribe now a square EFGH in AB

What do you mean by "in AB"? AB is one of the sides of the square, you can't put another square inside of it. The dimensions are wrong.

in a way that EF lies on the square side AB and G and H lie on the circumference. Inscribe now a square in GH and so on to infinity.

So EFGH is a "hat" on top of the first square, fitting snugly between ABCD's side and the circumscribing circle?

(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

### Re: Infinite Inscribed Squares

Let the circle be centered at the origin, with radius 1.

We'll construct the sequence of squares along the positive X axis.

Let (x, y) be the coordinates of the top right corner of a square, so for each square x² + y² = 1 by Pythagoras' theorem. Let s be the side of a square.

The first square has x = y, so x

For the subsequent squares, the left edge of the square has the same X coordinate as the right edge of the previous square = x

To keep the algebra simple, let's write that as (x+s, s/2). We know x and we want to determine s.

Now (x+s)² + (s/2)² = 1

x² + 2sx + s² + s²/4 = 1

5s²/4 + 2xs + (x² - 1) = 0

We can solve that for s using the quadratic formula:

s = (-2x ± sqrt(4x² - 5(x² - 1))) / (5/2)

s > 0 so we can ignore the negative solution

s = (2/5) * (sqrt(5 - x²) - 2x)

With this equation we can now calculate the coordinates and area of each subsequent square, but I can't see a simple closed-form expression for them.

Substituting x

s = (2/5) * (sqrt(5 - ½) - sqrt(2))

= (2/5) * (sqrt(9/2) - sqrt(2))

= (2/5) * (3sqrt(2)/2 - sqrt(2))

s = sqrt(2) / 5

Unfortunately, after this, things start getting messy. But here's some Python 2 code that does the calculations.

output

As you can see, the total area converges rather quickly.

Here's a more accurate approximation for the total area, calculated using the mpmath library:

2.0801007598219333251352540471639420067242795178

The Inverse Symbolic Calculator couldn't find an expression for this number.

We'll construct the sequence of squares along the positive X axis.

Let (x, y) be the coordinates of the top right corner of a square, so for each square x² + y² = 1 by Pythagoras' theorem. Let s be the side of a square.

The first square has x = y, so x

_{0}= y_{0}= sqrt(½), and s_{0}= sqrt(2), and its area is 2.For the subsequent squares, the left edge of the square has the same X coordinate as the right edge of the previous square = x

_{i-1}, so the coordinates of its top right corner (x_{i}, y_{i}) = (x_{i-1}+ s_{i}, s_{i}/ 2).To keep the algebra simple, let's write that as (x+s, s/2). We know x and we want to determine s.

Now (x+s)² + (s/2)² = 1

x² + 2sx + s² + s²/4 = 1

5s²/4 + 2xs + (x² - 1) = 0

We can solve that for s using the quadratic formula:

s = (-2x ± sqrt(4x² - 5(x² - 1))) / (5/2)

s > 0 so we can ignore the negative solution

s = (2/5) * (sqrt(5 - x²) - 2x)

With this equation we can now calculate the coordinates and area of each subsequent square, but I can't see a simple closed-form expression for them.

Substituting x

_{0}= sqrt(½) we gets = (2/5) * (sqrt(5 - ½) - sqrt(2))

= (2/5) * (sqrt(9/2) - sqrt(2))

= (2/5) * (3sqrt(2)/2 - sqrt(2))

s = sqrt(2) / 5

Unfortunately, after this, things start getting messy. But here's some Python 2 code that does the calculations.

Code: Select all

`# The x coordinate, side, and area of the initial central square`

x = .5 ** .5

s = 2 * x

a = 2

print 'i: x, s, a'

for i in range(8):

print '%d: %.15f, %.15f, %.15f' % (i, x, s, a)

s = ((5 - x * x) ** 0.5 - 2 * x) * 0.4

a += s * s

x += s

output

Code: Select all

`i: x, s, a`

0: 0.707106781186548, 1.414213562373095, 2.000000000000000

1: 0.989949493661166, 0.282842712474619, 2.080000000000000

2: 0.999987404962770, 0.010037911301604, 2.080100759663299

3: 0.999999999980171, 0.000012595017400, 2.080100759821933

4: 1.000000000000000, 0.000000000019829, 2.080100759821933

5: 1.000000000000000, 0.000000000000000, 2.080100759821933

6: 1.000000000000000, 0.000000000000000, 2.080100759821933

7: 1.000000000000000, 0.000000000000000, 2.080100759821933

As you can see, the total area converges rather quickly.

Here's a more accurate approximation for the total area, calculated using the mpmath library:

2.0801007598219333251352540471639420067242795178

The Inverse Symbolic Calculator couldn't find an expression for this number.

### Re: Infinite Inscribed Squares

Xanthir wrote:Squarian wrote:Given a circumference O and an inscribed square ABCD whose side lenght is l.

Did you means "1"? Naming a variable lowercase L is terrible practice in any case, but also, since this is the only length given, naming it and just setting it equal to 1 are equivalent.

No, I meant lowercase L. I'm italian, so L comes from the italian name for "side", muscle memoryInscribe now a square EFGH in AB

What do you mean by "in AB"? AB is one of the sides of the square, you can't put another square inside of it. The dimensions are wrong.

See next quotein a way that EF lies on the square side AB and G and H lie on the circumference. Inscribe now a square in GH and so on to infinity.

So EFGH is a "hat" on top of the first square, fitting snugly between ABCD's side and the circumscribing circle?

Yep, exactly

@PM 2Ring

I like the analytical approach, at first I was trying to solve it with euclidean geometry, but I kept going in circles (pun non intended). I found a formula for s

_{n}but has "Sum of all the previous sides" (I don't know how to use LaTex ) in it and is kind of complicated.

Do you think there is any chance of a nice closed form expression or is it hopeless?

- jestingrabbit
- Factoids are just Datas that haven't grown up yet
**Posts:**5967**Joined:**Tue Nov 28, 2006 9:50 pm UTC**Location:**Sydney

### Re: Infinite Inscribed Squares

PM 2Ring wrote:Code: Select all

`i: x, s, a`

0: 0.707106781186548, 1.414213562373095, 2.000000000000000

1: 0.989949493661166, 0.282842712474619, 2.080000000000000

2: 0.999987404962770, 0.010037911301604, 2.080100759663299

3: 0.999999999980171, 0.000012595017400, 2.080100759821933

4: 1.000000000000000, 0.000000000019829, 2.080100759821933

5: 1.000000000000000, 0.000000000000000, 2.080100759821933

6: 1.000000000000000, 0.000000000000000, 2.080100759821933

7: 1.000000000000000, 0.000000000000000, 2.080100759821933

Is that from 32 or 64 bit calculations?

ameretrifle wrote:Magic space feudalism is therefore a viable idea.

### Re: Infinite Inscribed Squares

Taking a similar approach to PM 2Ring, but sticking with exact forms and doing it without coordinates:

Let the height of the n

It doesn't take much to show that h

For all the other squares, you can draw a line from the centre of the circle that bisects all of their bases. If you do that, you then have a sequence of right-angled triangles formed from that line, half of the bisected base, and the hypotenuse which is a radius of the circle. And the height of the triangle, which comes from that bisector, is equal to half the height of the largest square, plus the height of all the squares up to that point. In other words, the side lengths of the n

(h

We can do a little tricksy manipulation to make that a little simpler - take the n

5/4 h

We find that h

As PM 2Ring showed, the heights converge to zero incredibly fast, so you do get a perfectly good approximation of the area after only two or three terms are added.

Let the height of the n

^{th}square be h_{n}, with h_{0}being the height of the biggest square.It doesn't take much to show that h

_{0}= sqrt(2), since the diagonal is a diameter of the circle.For all the other squares, you can draw a line from the centre of the circle that bisects all of their bases. If you do that, you then have a sequence of right-angled triangles formed from that line, half of the bisected base, and the hypotenuse which is a radius of the circle. And the height of the triangle, which comes from that bisector, is equal to half the height of the largest square, plus the height of all the squares up to that point. In other words, the side lengths of the n

^{th}triangle are h_{n}/2, sqrt(2)/2 + h_{1}+ h_{2}+ ... + h_{n}, and hypotenuse 1. So we can apply Pythagoras' Theorem to create the recurrence relation:(h

_{n}/ 2)^{2}+ (h_{n}+ h_{n-1}+ ... + h_{1}+ 1/2 h_{0})^{2}= 1We can do a little tricksy manipulation to make that a little simpler - take the n

^{th}and (n-1)^{th}relations and subtract them, then use difference of squares and some rearrangement to get:5/4 h

_{n}^{2}+ 2h_{n}(h_{n-1}+ h_{n-2}+ ... + h_{1}+ 1/2 h_{0}) - 1/4 h_{n-1}^{2}= 0We find that h

_{1}= sqrt(2) / 5 from the original relation (i.e. the first triangle), and from then on we can theoretically find the heights of all the other squares. Unfortunately, it gets ugly pretty quickly - h_{2}= sqrt(2)/25 (sqrt(201) - 14) and h_{3}= (sqrt(2) (397/25-(28 sqrt(201))/25))/(14+4 sqrt(201)+sqrt(7 (771-4 sqrt(201)))), according to Wolfram Alpha. So it doesn't look like there's an nice little equation for the heights, nor their squares.As PM 2Ring showed, the heights converge to zero incredibly fast, so you do get a perfectly good approximation of the area after only two or three terms are added.

pollywog wrote:I want to learn this smile, perfect it, and then go around smiling at lesbians and freaking them out.Wikihow wrote:* Smile a lot! Give a gay girl a knowing "Hey, I'm a lesbian too!" smile.

### Re: Infinite Inscribed Squares

jestingrabbit wrote:Is that from 32 or 64 bit calculations?

I'm running Python 2.6.6 on a 32 bit machine. My Python's floats are IEEE-754 doubles, so they have 53 bits of precision. The more accurate value for the area was calculated with 50 decimal digits of precision; I chopped off the last couple of digits, so the digits you see should all be correct... assuming I didn't make a blunder with my algebra.

- jestingrabbit
- Factoids are just Datas that haven't grown up yet
**Posts:**5967**Joined:**Tue Nov 28, 2006 9:50 pm UTC**Location:**Sydney

### Re: Infinite Inscribed Squares

Cool. I was just a bit worried about the speed of the convergence, but I believe it now.

ameretrifle wrote:Magic space feudalism is therefore a viable idea.

### Re: Infinite Inscribed Squares

ConMan wrote:Taking a similar approach to PM 2Ring, but sticking with exact forms and doing it without coordinates:

Let the height of the n^{th}square be h_{n}, with h_{0}being the height of the biggest square.

It doesn't take much to show that h_{0}= sqrt(2), since the diagonal is a diameter of the circle.

For all the other squares, you can draw a line from the centre of the circle that bisects all of their bases. If you do that, you then have a sequence of right-angled triangles formed from that line, half of the bisected base, and the hypotenuse which is a radius of the circle. And the height of the triangle, which comes from that bisector, is equal to half the height of the largest square, plus the height of all the squares up to that point. In other words, the side lengths of the n^{th}triangle are h_{n}/2, sqrt(2)/2 + h_{1}+ h_{2}+ ... + h_{n}, and hypotenuse 1. So we can apply Pythagoras' Theorem to create the recurrence relation:

(h_{n}/ 2)^{2}+ (h_{n}+ h_{n-1}+ ... + h_{1}+ 1/2 h_{0})^{2}= 1

We can do a little tricksy manipulation to make that a little simpler - take the n^{th}and (n-1)^{th}relations and subtract them, then use difference of squares and some rearrangement to get:

5/4 h_{n}^{2}+ 2h_{n}(h_{n-1}+ h_{n-2}+ ... + h_{1}+ 1/2 h_{0}) - 1/4 h_{n-1}^{2}= 0

We find that h_{1}= sqrt(2) / 5 from the original relation (i.e. the first triangle), and from then on we can theoretically find the heights of all the other squares. Unfortunately, it gets ugly pretty quickly - h_{2}= sqrt(2)/25 (sqrt(201) - 14) and h_{3}= (sqrt(2) (397/25-(28 sqrt(201))/25))/(14+4 sqrt(201)+sqrt(7 (771-4 sqrt(201)))), according to Wolfram Alpha. So it doesn't look like there's an nice little equation for the heights, nor their squares.

As PM 2Ring showed, the heights converge to zero incredibly fast, so you do get a perfectly good approximation of the area after only two or three terms are added.

Are you positive that there isn't a "nice" expression? I'm not trying to say that there has to be one, in fact I can't find one myself, but it seems weird to me that such a seemingly simple problem becomes complicated so easily. (Again, I guess the sum of the reciprocals of the cubes dosen't give a simple expression either, so...yeah )

### Re: Infinite Inscribed Squares

Squarian wrote:Are you positive that there isn't a "nice" expression? I'm not trying to say that there has to be one, in fact I can't find one myself, but it seems weird to me that such a seemingly simple problem becomes complicated so easily. (Again, I guess the sum of the reciprocals of the cubes dosen't give a simple expression either, so...yeah )

Well, I'm mainly basing it on the fact that the third term in the sequence already requires a double square root and has a bunch of numbers that don't obviously look nice. So it's not guaranteed, but I would be extremely surprised if you could do anything neatly.

pollywog wrote:I want to learn this smile, perfect it, and then go around smiling at lesbians and freaking them out.Wikihow wrote:* Smile a lot! Give a gay girl a knowing "Hey, I'm a lesbian too!" smile.

### Re: Infinite Inscribed Squares

Although, you may be happy to learn, that I finally coaxed Wolfram Alpha into simplifying it a little bit, so h

_{3}= sqrt(2)/125(-14-4sqrt(201)-sqrt(7(771-4sqrt(201)))).pollywog wrote:I want to learn this smile, perfect it, and then go around smiling at lesbians and freaking them out.Wikihow wrote:* Smile a lot! Give a gay girl a knowing "Hey, I'm a lesbian too!" smile.

### Who is online

Users browsing this forum: No registered users and 9 guests