User:Eliora/Worst EDOs: Difference between revisions
Created page with "<code>import numpy as np import matplotlib.pyplot as plt phi = (1 + np.sqrt(5)) / 2 tau = 1 / phi**2 alpha = 2 * phi beta = 1 x = np.linspace(0, 0.5, 1000) y = x**alpha * (0.5 - x)**beta y /= y.max() plt.figure(figsize=(8,4)) plt.plot(x, y, lw=2) plt.axvline(tau, color='red', ls='--', label=r'$\tau=1/\varphi^2$') plt.xlabel("Error") plt.ylabel("Score") plt.title("Golden-ratio Beta-style bump") plt.grid(True) plt.legend() plt.show()</code> <code>import numpy as np..." |
No edit summary |
||
| Line 94: | Line 94: | ||
plt.grid(True) | plt.grid(True) | ||
plt.show()</code> | plt.show()</code> | ||
== Recordholders == | |||
Record-holder progression: | |||
1-EDO score = 0.79348366 distance from ideal = 0.20651634 | |||
8-EDO score = 0.83520073 distance from ideal = 0.16479927 | |||
54-EDO score = 0.89628624 distance from ideal = 0.10371376 | |||
175-EDO score = 0.93106554 distance from ideal = 0.06893446 | |||
225-EDO score = 0.94135007 distance from ideal = 0.05864993 | |||
1514-EDO score = 0.95731194 distance from ideal = 0.04268806 | |||
9709-EDO score = 0.95906127 distance from ideal = 0.04093873 | |||
Interestingly, this: | |||
<code># ---------- 1/p^2 weighting ---------- | |||
# Assumes beta_bump(), first_primes(), N and num_primes already exist. | |||
# Odd primes only | |||
primes = first_primes(num_primes + 1)[1:] | |||
# Normalize weights | |||
weights = 1.0 / primes**2 | |||
weights /= weights.sum() | |||
scores_p2 = [] | |||
for edo in range(1, N + 1): | |||
logs = edo * np.log2(primes) | |||
# Distance to nearest integer | |||
errors = np.abs(logs - np.round(logs)) | |||
errors = np.minimum(errors, 1 - errors) | |||
score = np.sum(weights * beta_bump(errors)) | |||
scores_p2.append(score) | |||
scores_p2 = np.array(scores_p2) | |||
# ---------- Record holders ---------- | |||
best_score = -1 | |||
print("Record-holder progression (1/p² weighting):\n") | |||
for edo, score in enumerate(scores_p2, start=1): | |||
if score > best_score: | |||
best_score = score | |||
print(f"{edo:5d}-EDO score = {score:.8f} distance = {1-score:.8f}")</code> | |||
Produces the same sequence: | |||
Record-holder progression (1/p² weighting): | |||
1-EDO score = 0.79730468 distance = 0.20269532 | |||
8-EDO score = 0.81988848 distance = 0.18011152 | |||
54-EDO score = 0.89675569 distance = 0.10324431 | |||
175-EDO score = 0.92591451 distance = 0.07408549 | |||
225-EDO score = 0.92620065 distance = 0.07379935 | |||
1514-EDO score = 0.94713238 distance = 0.05286762 | |||
This indicates that: | |||
{{EDOs|1, 8, 54, 175, 225, 1514}}, hence are the worst edos. | |||