### Brain Teasers

# Overlapping Squares

Probability
Probability puzzles require you to weigh all the possibilities and pick the most likely outcome.

Two squares each 17cm by 17cm are drawn randomly inside a square measuring 1m by 1m.

The edges of the two smaller squares are both parallel/perpendicular to the edges of the large square.

What is the exact probability the two smaller squares overlap (or touch)?

The edges of the two smaller squares are both parallel/perpendicular to the edges of the large square.

What is the exact probability the two smaller squares overlap (or touch)?

### Answer

6,416,089/47,458,321Since the centers of the two smaller squares each lie inside a square of side 83cm, we can simplify the problem to:

Find the probability that the horizontal and vertical distances between 2 points in a square of side 83 cm are less than or equal to 17 cm.

Considering the horizontal distances:

Let x and y be the horizontal distances of the two points from the left edge of the 83 by 83 square.

Clearly x and y can take any value from 0 to 83.

We can represent this space of possibilities using a grid where the lower left corner is (0,0), the horizontal axis represents x, and the vertical axis represents y.

We must work out what part of this space represents the two points being a distance of 17cm or less apart, we can do this by plotting a point where it is true.

Firstly assume y>x, then we must have y<=x+17.

This inequality is simply all the points on and below the straight line from (0,17) to (66,83).

Now assume, y<=x, then we must have y>=x-17.

This inequality is simply all the points on and above the straight line from (17,0) to (83,66).

Combining both inequalities gives a shaded area that lies between 2 right-angled triangles.

The smaller sides of each triangle will be 66 cm each. So the area of both triangles together is 66^2.

Hence the shaded area=83^2-66^2=2533

Hence the probability the distance between x and y is less than or equal to 17 is 2533/83^2=2533/6889.

Now Prob(any 2 points in 83 by 83 square having vertical AND horizontal distance <=17) =

Prob(horizontal distance between points is <=17) * Prob(vertical distance between points is <=17)

=2533/6889 * 2533/6889 (Due to symmetry)

=6,416,089/47,458,321

Hide Answer Show Answer

## What Next?

**Solve a Similar Brain Teaser...**

Or, get a random brain teaser.

If you become a registered user you can vote on this brain teaser, keep track of

which ones you have seen, and even make your own.

## Comments

Yay! First to comment! Well, pretty good teaser, and pretty hard too. Good job.

Sorry too complicated for this old brain. Suspect there are seom brainiacs out there who can do these, but I am not one of them. But even so, it appears you v\gave a very good expanation of how you arrived at your answer so all in all It was a good job.

Grrrr that teaser wasn't easy... And y didn't you share your chocolate with me in the chat room.?? *waaahh!!!*

So very confusing!

Its not really, just follow the solution on paper and everything will become clear

It's a very interesting problem and a well constructed solution but I am not going to vote on this until I have thought about the solution. Certainly if the squares fall in the designated area, they will touch/overlap, but I am struggling to connect the specific areas with a general solution. I like the problem and the way the solution has been tackled!

Superb problem. I got it though by a round about method. Assuming the side of the small sq is A meters (0.17 in this case) and the big sq is 1 M, the answer I got is (A*(2-3A)/(1-A)^2)^2 which matches the solution.

I solved it by splitting the bigger square into three areas (a center sq of side 1-3A, 4 corner squares of side A and 4 rectangles of side A & 1-3A). The probability of the squares overlapping when the first square is in each of the above areas are 4AA/(1-A)^2, 9AA/4/(1-A)^2 and 3AA/(1-A)^2. Adding these after multiplying by first square probabilities, we can get the answer as (A*(2-3A)/(1-A)^2)^2.

The solution given by the author is definitely more elegant. Here in the xy grid of side (1-A), overlap will happen if the X coordinates of the two squares are within the center rectangle of sides sqrt(2)*A and sqrt(2)*(1-2A) or the two corner triangles. So the probability of one coordinate say X suitable for overlapping is sqrt(2)*A * sqrt(2)*(1-2A) /(1-A)^2 + AA = A(2-3A)/(1-A)^2. Square of this will give the answer.

I solved it by splitting the bigger square into three areas (a center sq of side 1-3A, 4 corner squares of side A and 4 rectangles of side A & 1-3A). The probability of the squares overlapping when the first square is in each of the above areas are 4AA/(1-A)^2, 9AA/4/(1-A)^2 and 3AA/(1-A)^2. Adding these after multiplying by first square probabilities, we can get the answer as (A*(2-3A)/(1-A)^2)^2.

The solution given by the author is definitely more elegant. Here in the xy grid of side (1-A), overlap will happen if the X coordinates of the two squares are within the center rectangle of sides sqrt(2)*A and sqrt(2)*(1-2A) or the two corner triangles. So the probability of one coordinate say X suitable for overlapping is sqrt(2)*A * sqrt(2)*(1-2A) /(1-A)^2 + AA = A(2-3A)/(1-A)^2. Square of this will give the answer.

In being one of the editors who accepted this teaser, I think it is really hard. Even I couldn't get it!

All I can say is Wow.....very hard....very good teaser though!

Thanks, I'm glad everyone liked it, my first solution was difficult, using double integrals, and was tough to understand.

But while I was lying in bed, the solution just came to me, and in the middle of the night, I got up and grabbed my calculator, tested it, and it matched my other solution.

Just to make sure it was correct, I did a simulation using a java program. I think I ran the experiment a billion times, counted the successes, and divided by a billion.

The result was practically identical (to about 4sf) to the theoretical probability.

Numerical verification isn't an absolute proof, but its good enough for me

But while I was lying in bed, the solution just came to me, and in the middle of the night, I got up and grabbed my calculator, tested it, and it matched my other solution.

Just to make sure it was correct, I did a simulation using a java program. I think I ran the experiment a billion times, counted the successes, and divided by a billion.

The result was practically identical (to about 4sf) to the theoretical probability.

Numerical verification isn't an absolute proof, but its good enough for me

â™¥ â™¥ â™¥ â™¥ â™¥ â™¥ wanna know how 2 do dis hearts code email me at drzangelfaceo5@yahoo.com wit a zero â™¥ â™¥ â™¥ â™¥ â™¥

Thank you. My brain exploded while contemplating this question.

whoa.

That was fun!

That was fun!

my.....brain.....is.....turning......to.......mush

Are you kidding me? this is probably the most basic probability riddle ive ever seen.

The solution is nice and there are many more problems that can be solved using the same technique. This is a set method for problems like these.

Another problem could be like probability of whether bf and gf meet each-other in 1 hr window if the other one can only wait for 15 mins and they dont care much abt each other .

Another problem could be like probability of whether bf and gf meet each-other in 1 hr window if the other one can only wait for 15 mins and they dont care much abt each other .

The squares can overlap diagonally as well in which case the distance between their centers will be \sqrt(2) times 17.

## Follow Braingle!