0
$\begingroup$

I have a problem that I'm working on. I have an arbitrary number of pins in a straight line. I need to place a gear on each pin such that the first gear drives the last gear. The last gear must go at double the speed of the first gear. In other words, the last gear must be half the size of the first gear (I think).

It's simple to figure this out by brute force for integers. For instance, if you have a pin at point 4, 30 and 50, the first gear would be 12, the second 14 and the last 6.

This becomes much more complex in the case where the gear size is a fraction. I'm trying to figure out some formula or algorithm which I can use figure it out.

Also, it's not always possible to have a solution. For instance, 4, 17, 50 has no solution.

1 Answers 1

0

Suppose there are $n$ pins. Let $x_i$ be the position of the $i$-th pin and $g_i$ the radius of the $i$-th gear. Suppose all the $x_i$s are rational numbers. (Since you want to deal with gear sizes that are fractions.) Then you have:

$$ g_i + g_{i+i} = x_{i+1} - x_{i} ~~~\text{ for } 1 \leq i < n \enspace.$$

This gives you $n-1$ equations. The $n$-th equation is $g_1 = 2g_n$. If this linear system admits a solution with all positive values, then there's a choice of gear sizes that solves the problem if fractional values are allowed.

Note that the matrix of this system is full rank. Hence, the system has one solution and you only need to check whether it's positive.

If the pin positions and the gear sizes are restricted to integers, then you are dealing with a system of linear Diophantine equations. It's still the case, though, that the system has one solution in $\mathbb{Q}$. Hence, if that solution is not integral or is not positive, then there's no solution.

  • 0
    I am not proficient in mathematics but I think this does not answer the question. This is a way to verify a correct answer. The possible radius or diameter of the first gear are still missing.2017-05-25
  • 0
    @abbas This assumes that the pin number and positions are given.2017-05-25
  • 0
    That's exactly my point, the question is how'd you calculate radius of the *first gear*.2017-05-25
  • 0
    If you fix the pins you use up all your degrees of freedom. Try two pins at distance 1. The first gear has radius 2/3 and the second gear has radius 1/3. There's no other solution. This generalized to more than two pins. As I wrote above, the matrix is full rank.2017-05-25