# Enigmatic Code

Programming Enigma Puzzles

## Enigma 1717: On the beach

From New Scientist #2884, 29th September 2012 [link]

Clearing my attic, I found my old 8mm cine-projector and films of our children. It still worked. The film moves through the projecting gate at an essentially constant speed from the stock spool to an identical take-up spool. The empty spool has a 4-centimetre diameter and the spool when full has a diameter (to the outside of the film) of 12 cm. The playing time is 17 minutes. Each spool has five spokes, so it is easy to compare speeds of rotation. A scene of children playing on the beach started when the ratio of the speed of rotation of the take-up spool to that of the stock spool was 5:3 and ended when it was 3:5.

How long did the scene last?

[enigma1717]

### One response to “Enigma 1717: On the beach”

1. Jim Randell 26 September 2012 at 5:03 pm

Another fairly straightforward puzzle, once you’ve worked out the algebra involved.

```from fractions import Fraction
from enigma import printf

# the fraction of film on a spool with film of radius x is:
# f = (x^2 - 2^2) / (6^2 - 2^2) = (x^2 - 4) / 32

# so the radius of a spool with the fraction f of film on it is:
# x = sqrt(32.f + 4) = 2.sqrt(8.f + 1)

# at a rotational speed of r, and radius x a spool is taking up film at
# a rate of:
# v = krx
# r = v/kx

# so if the rotational speeds are in a ratio of r1 : r2 it follows:
# r1 : r2 = v/k.x1 : v/k.x2 = x2 : x1

# and the frational amount of film on the spools will be f and 1-f

# r1 / r2 = 2.sqrt(8.(1-f) + 1) / 2.sqrt(8.f + 1)
# r1^2 / r2^2 = (9 - 8.f) / (8.f + 1)
# 8.r1^2.f + r1^2 = 9.r2^2 - 8.r2^2.f
# (8.r1^2 + 8.r2^2).f = 9.r2^2 - r1^2
# f = (9.r2^2 - r1^2) / 8.(r1^2 + r2^2)

def f(a, b):
(a2, b2) = (a * a, b * b)
return Fraction(9 * b2 - a2, 8 * (a2 + b2))

# what fraction of the film has played at the start and end of the scene?
f1 = f(5, 3)
f2 = f(3, 5)

# a full reel runs to 17 minutes so the scene length is...
s = 17 * (f2 - f1)
printf("scene length is {s} minutes [f1={f1} f2={f2}]")
```

Solution: The scene was 10 minutes long.

This site uses Akismet to reduce spam. Learn how your comment data is processed.