Teaser 2609: String art
From The Sunday Times, 23rd September 2012 [link] [link]
Callum knocked some tacks onto the edge of a circular board. He then used pieces of string to make all possible straight-line connections between pairs of tacks. The tacks were arranged so that no three pieces of string crossed at the same point inside the circle. If he had used six tacks this would have required fifteen pieces of string and it would have created fifteen crossing points inside the circle. But he used more than six and in his case the number of crossing points inside the circle was a single-digit multiple of the number of pieces of string used.
How many tacks did he use?
[teaser2609]
Jim Randell 11:27 am on 10 October 2024 Permalink |
See also: Enigma 77, Enigma 1769.
There is a line between each pair of tacks, so the number of lines is:
Each crossing point is defined by two of the lines (any four different points form the vertices of a quadrilateral, the diagonals of which give the crossing lines), and each line is defined by two tacks.
So the number of crossings is given by:
And we are interested in when (for some single digit k):
So we need to find two consecutive numbers (≥ 3), that give a suitable value for k = 2..9.
The only candidate is k = 6:
Hence n = 11.
Solution: Callum used 11 tacks.
The next solution would occur at n = 14.
but the multiple is not a single digit number.
Here is a program that considers increasing n values:
from enigma import (irange, inf, C, printf) # consider number of tacks for n in irange(7, inf): # calculate number of lines and number of crossings (L, X) = (C(n, 2), C(n, 4)) (k, r) = divmod(X, L) if k > 9: break if r != 0: continue # output solution printf("n={n}: L={L} X={X}; k={k}")Alternatively here is a program that solves the equation:
from enigma import (Polynomial, irange, printf) # make the polynomial p(n) = (n - 2)(n - 3) n = Polynomial('n', var='n') p = (n - 2) * (n - 3) # consider possible single digit multiples k for k in irange(2, 9): # find integer roots of the polynomial p(n) = 12k for r in p.find_roots(12 * k, domain='Z'): # look for values > 6 if r > 6: # output solution printf("n={r} [k={k}]")LikeLike
Ruud 7:29 am on 11 October 2024 Permalink |
import math import itertools for number_of_tacks in itertools.count(7): number_of_crossing_points = math.comb(number_of_tacks, 4) number_of_pieces_of_string = math.comb(number_of_tacks, 2) if number_of_crossing_points / number_of_pieces_of_string > 9: break if number_of_crossing_points % number_of_pieces_of_string == 0: print(f"{number_of_tacks=} {number_of_pieces_of_string=} {number_of_crossing_points=} {number_of_crossing_points//number_of_pieces_of_string=}")LikeLike