Finding a sequence of numbers of fixed length spanning a...b with the lowest average squared difference of ratios between subsequent ones.

24 Views Asked by At

The context is a design of gears in a bike cassette. The problem:
Design n-cog cassette (n is usually 11 or 12) with set lowest and biggest cog size so the average squared difference of gear change ratios is the lowest. In other words: where the standard deviation of those ratios is the lowest. The goal is to get as similar in size gear changes as possible across the whole cassette.

For example, a standard popular 11-34 bike cassette from a big manufacturer has the following cogs:

[11,13,15,17,19,21,23,25,27,30,34]

The ratios between subsequent gears are: 13/11, 15/13, 17/15 etc. I wrote a simple script to illustrate the results:

11 speed cassette
['11   ', '13   ', '15   ', '17   ', '19   ', '21   ', '23   ', '25   ', '27   ', '30   ', '34   ']
['1.182', '1.154', '1.133', '1.118', '1.105', '1.095', '1.087', '1.080', '1.111', '1.133']
average jump: 1.120
Std dev: 0.030

Here is an "improved" cassette with a lower standard deviation:

11 speed cassette
['11   ', '12   ', '13   ', '15   ', '17   ', '19   ', '21   ', '24   ', '27   ', '30   ', '34   ']
['1.091', '1.083', '1.154', '1.133', '1.118', '1.105', '1.143', '1.125', '1.111', '1.133']
average jump: 1.120
Std dev: 0.021

The question: is there a formula or an algorithm to determine an "optimal" (as in having the smallest std dev of gear ratio changes) bike cassette?

1

There are 1 best solutions below

0
On

The question is analogous to choosing $9$ geometric means between $11$ and $34$.

The common ratio of such a sequence would be $(\frac{34}{11})^\frac{1}{10} \approx 1.11946$

Unfortunately, the size of each cog is an integer, which makes it much harder to get a perfect solution.

However, if you are looking for a nearly-perfect answer, you can simply round the geometric means to the nearest integers.

This would give you the sequence: $$11, 12, 14, 15, 17, 19, 22, 24, 27, 30, 34$$ with a standard deviation of $0.0285$

Any better sequences will have corresponding terms that vary by at most $1$ unit. You can utilize a brute-force approach to find these sequences, but the complexity of the problem grows with the order $\mathcal{O}(2^n)$