Teaser 3054: Discs a go-go
From The Sunday Times, 4th April 2021 [link] [link]
My kitchen floor is tiled with identically-sized equilateral triangle tiles while the floor of the bathroom is tiled with identically-sized regular hexagon tiles, the tiles being less than 1m across. In both cases the gaps between tiles are negligible. After much experimenting I found that a circular disc dropped at random onto either the kitchen or bathroom floor had exactly the same (non-zero) chance of landing on just one tile.
The length of each side of the triangular tiles and the length of each side of the hexagon tiles are both even triangular numbers of mm (i.e., of the form 1+2+3+…).
What are the lengths of the sides of the triangular and hexagonal tiles?
[teaser3054]












Jim Randell 9:50 pm on 1 April 2021 Permalink |
For a disc of radius x dropped randomly onto the floor, the centre of it will lie in one of the tiles and we want to find out if the entire disc lies within the tile. Which it will do if the centre of the disc lies within a smaller version of the tile that has a perimeter that is a distance of x from the perimeter of the actual tile.
If the triangular tiles have a side t, then the area of one tile is: A = (t²√3)/4
And the inradius is: r = t/(2√3)
The radius of the disc cannot be larger than the inradius of the triangle.
So the smaller version of the triangle has an inradius of: (r − x)
And the corresponding area is: a = (3√3)(r − x)²
The probability of the disc landing entirely within a single tile is then: P = a / A
Similarly for a hexagon with side h:
The area of one hexagonal tile is: B = 3(h²√3)/2 (it is composed of 6 equilateral triangles).
And the inradius is: s = h(√3)/2
Again the radius of the disc cannot be larger than the inradius of the hexagon.
We make a smaller hexagon with inradius = (s − x)
And the corresponding area is: b = (2√3)(s − x)²
And the probability of the disc landing entirely within a single tile is: Q = b / B
This is enough to permit a programmed solution.
The following program finds possible sides for the triangular and hexagonal tiles, and then looks for pairs that can be solved to give a disc that makes the probabilities the same.
It runs in 73ms.
Run: [ @replit ]
from itertools import product from enigma import irange, inf, sqrt, fdiv, find_zero, printf # root 3 r3 = sqrt(3) # find the radius of a disc that makes the probabilities equal def solve(t, h): # area of a triangular tile A = t * t * r3 * 0.25 r = fdiv(t, 2 * r3) # hexagonal tile B = h * h * r3 * 1.5 s = h * r3 * 0.5 # find the difference between the probabilities def f(x): a = 3 * r3 * (r - x) ** 2 b = 2 * r3 * (s - x) ** 2 P = fdiv(a, A) Q = fdiv(b, B) return P - Q # find a zero of f try: r = find_zero(f, 1, min(r, s)) except ValueError: return # output solution printf("t={t}mm h={h}mm [x={r.v:.2f}mm]") # generate even triangular numbers def tris(f): t = 0 for i in irange(1, inf): t += i if t * f > 1000: break if t % 2 == 0: yield t # collect possible sides for the triangular tiles ts = list(tris(0.5 * r3)) # collect possible sides for the hexagonal tiles hs = list(tris(r3)) # select t and h, and look for a solution for (t, h) in product(ts, hs): solve(t, h)Solution: The triangular tiles have sides of 630mm. The hexagonal tiles have sides of 210mm.
A bit more analysis (see below), shows us that the probabilities are the same when the triangular tiles have sides that are 3 times the sides of the hexagonal tiles. And as long as the disc is small enough to fit inside the tiles its size does not matter.
So we are just looking for a pair of even triangular numbers (t, h) where t = 3h, which can be found manually or with a simple program.
LikeLike
Jim Randell 8:27 am on 2 April 2021 Permalink |
[Note: See my next comment for a better way of approach the problem and deriving the relationship between t and h].
Wolfram Alpha [ link ] simplifies the calculation of x to:
Which gives a faster program:
from itertools import product from enigma import irange, inf, sqrt, fdiv, printf # root 3 r3 = sqrt(3) # find the radius of a disc that makes the probabilities equal def solve(t, h): if 3 * h <= t and t <= 3 * h: # output solution printf("t={t}mm h={h}mm") # generate even triangular numbers def tris(f): t = 0 for i in irange(1, inf): t += i if t * f > 1000: break if t % 2 == 0: yield t # collect possible sides for the triangular tiles ts = list(tris(0.5 * r3)) # collect possible sides for the hexagonal tiles hs = list(tris(r3)) # select t and h, and look for a solution for (t, h) in product(ts, hs): solve(t, h)LikeLike
Frits 10:42 am on 2 April 2021 Permalink |
@Jim,
Could you explain the line 9 formula (which actually says if t == 3 * h)?
If we forget about triangular numbers and we choose t=300 and h=100 and a disc so that exactly 3 discs fit in the triangle (touching the sides) do you now say that both chances are not the same?
LikeLike
Jim Randell 11:39 am on 2 April 2021 Permalink |
@Frits: It looks like the size of the disc doesn’t matter, as long as t = 3h the probabilities will be the same. I’ll look again at my equations to see why x didn’t drop out. (Line 9 is just a restatement of the inradius conditions).
John Crabtree pointed me towards a better derivation of the relationship:
If the triangular tiles have a side t, then the area of one tile is: A(t) = T⋅t², where T = (√3)/4
And the inradius is: r = t/(2√3), so the disc has a radius less than this: x < r
We make a smaller triangle with inradius = (r − x), it has sides of length: u = (t − 2(√3)x)
If the centre of the disc lands within this triangle the entire disc will be inside the tile.
So the area of this smaller triangle is: A(u) = T⋅u²
And the probability of the disc falling entirely within the triangle (P) is the ratio of these areas:
If the hexagonal tiles have a side h, then the area of the hexagon is: B(h) = H⋅h², where H = (3/2)(√3) (as it is composed of 6 equilateral triangles).
And the inradius is: s = h(√3)/2, so the radius of the disc is also less than this: x < s
We make a smaller hexagon with inradius = (s − x), it has sides of length: i = (h − 2x/√3), and the area is: B(i)
So the probability of the disc falling entirely within the hexagon (Q) is the ratio of these two areas:
The probabilities are equal when their square roots are equal:
Hence the solution is found when t = 3h (and 0 < x < (√3)h/2), and we just need to find two even triangular numbers in the required range, where one is 3 times the other:
from enigma import (irange, inf, sqrt, divf, printf) # max tile size M = divf(2000, sqrt(3)) # collect even triangular numbers ts = set() t = 0 for i in irange(1, inf): t += i if t > M: break if t % 2 == 0: (h, r) = divmod(t, 3) if r == 0 and h in ts: printf("t={t}mm h={h}mm") ts.add(t)LikeLike
Frits 9:55 pm on 1 April 2021 Permalink |
[corrected]
# get triangular root tri = lambda n: 0.5 * ((8 * n + 1) ** 0.5 - 1.0) # For the same inner circle the side length of the (smallest outer) triangle # must be three times the side length of the (smallest outer) hexagon. # check triangular numbers for i in range(1, 50): lHex = (i * (i + 1)) // 2 lTri = 3 * lHex # both sides must be even if lHex % 2 or lTri % 2: continue # the tiles being less than 1m across. # length across triangle: lTri, length across hexagon: lHex * sqrt(3) if lTri > 999: break if tri(3 * lHex) % 1 == 0 : print(f"lengths of the sides of the triangular and hexagonal tiles: " f"{lTri} mm and {lHex} mm")LikeLike
Jim Randell 10:36 pm on 1 April 2021 Permalink |
@Frits: I don’t think that can be correct, because the answers have to be even numbers (that are also triangular).
LikeLike
Frits 10:53 pm on 1 April 2021 Permalink |
@Jim, I didn’t see that (about even).
I calculated that for the same inner circle the side length of the (smallest outer) triangle must be three times the side length of the (smallest outer) hexagon. I hoped that would answer the probability question as well.
LikeLike
Jim Randell 6:28 pm on 3 April 2021 Permalink |
Another derivation using sectors of a regular n-gon:
For a regular n-gon with a side length of s, we can consider a 1/n sector.
The angle at the centre is 2θ = 360°/n ⇒ θ = 180°/n
And the area of the entire sector is:
Reducing the height of the sector by the radius of the disc x gives:
And the probability of the disc landing entirely within the complete tile is P = na/nA = a/A
For the triangle tan(θ) = tan(60°) = √3, and the side length is t.
For the hexagon tan(θ) = tan(30°) = 1/√3, and the side length is h.
And the probabilities are equal when:
Here’s a graphical demonstration of the probabilities when 3h = t.
On the left, the hexagonal tile (green) fits exactly in the triangular tile (red), and we see that if each small triangle has area Z, then the hexagonal tile has an area 6Z and the triangular tile has an area 9Z.
On the right there is also a smaller version of each tile, that is one radius of the disc away from the perimeter of the corresponding actual tile. If the small triangles have area z, then the small version of the hexagonal tile has an area 6z and the small version of the triangular tile has an area of 9z.
The probability then of the disc falling in the hexagonal tile is 6z / 6Z = z/Z, and the probability of the disc falling in the triangular tile is 9z / 9Z = z/Z. Hence the probabilities are the same for each tile.
LikeLike
Tony Brooke-Taylor 10:03 am on 4 April 2021 Permalink |
I finally satisfied myself by working in terms of the vertical height of the triangles. Referring to Jim’s first diagram, for the triangular tiles, the vertical height of the inner triangle has the relationship:
Mt’ = Mt-3x
This is because the triangles are congruent and have the same centroid, the centroid being 1/3 of the way along the vertical height.
For each of the six triangles in the hexagon, the inner triangle has vertical height:
Mh’ = Mh-x
This is because we only need to have a border for the circular disc at the outer edge of the hexagon, or the ‘bottom’ of each triangular sector.
The area of each triangle is proportionate to the square of any relevant length, so we can ignore all constants of proportionality and state that:
(Mt’/Mt)^2 = (Mh’/Mh)^2
implies ((Mt-3x)/Mt)^2 = ((Mh-x)/Mh)^2
This condition is satisfied if we make the substitution Mt=3Mh (or just take square roots of each side of the equation and rearrange).
To find the solution, I just looped over possible values for h out of the set of even triangular numbers, setting the limit assuming the ‘across’ distance was measured from flat to flat, like a spanner.
h_lim = 1000/3**(1/3)#limit width of a horizontal tile i_lim = int(((8*h_lim+1)**(1/2)-1)/2)+1#implied limit of possible triangular numbers result=[h for h in [member for item in [[i*(i+1)/2,(i+2)*(i+1)/2] for i in range(3,i_lim,4)] for member in item] if ((h*24+1)**(1/2)-1)%2==0] print("The triangles have side",result[0]*3,"mm; the hexagons",result[0],"mm")LikeLike