FA-81101 / Music interval and transposition theory / Open access
Pythagorean ratio for a chain of fifths: flatward chains lifted by a single octave · case 01
Two fifths down returns 8/9 (below unison) instead of 16/9.
ROOT CAUSE
Ratios below unity are raised by one octave at most instead of repeatedly.
VERIFIED REPAIR
Restore the upward octave reduction step so that it reads `while r < 1: r *= 2`.
Unsuccessful approach: Looping on r <= 1 also doubles the unison, so zero fifths returns 2/1.
Case contract
Input an integer k with |k| <= 24 (booleans rejected). Return (3/2)**k octave-reduced into [1, 2) as [numerator, denominator]; out-of-range or non-integer input returns None.
Why this case matters
Pythagorean and meantone tuning tools stack fifths and octave-reduce the result.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(x):
if not isinstance(x, int) or isinstance(x, bool) or abs(x) > 24:
return None
r = Fraction(3, 2) ** x
while r >= 2:
r /= 2
if r < 1:
r *= 2
return [r.numerator, r.denominator]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[(0, [1, 1]), (1, [3, 2]), (2, [9, 8]), (3, [27, 16]), (4, [81, 64]), (5, [243, 128]), (-2, [16, 9]), (-5, [256, 243])], [(0, [1, 1]), (4, [81, 64]), (5, [243, 128]), (6, [729, 512]), (7, [2187, 2048]), (12, [531441, 524288]), (-3, [32, 27]), (-6, [1024, 729])], [(0, [1, 1]), (7, [2187, 2048]), (12, [531441, 524288]), (-1, [4, 3]), (-5, [256, 243]), (-12, [1048576, 531441]), (24, [282429536481, 274877906944]), (25, None)], [(0, [1, 1]), (-6, [1024, 729]), (24, [282429536481, 274877906944]), (-24, [549755813888, 282429536481]), (25, None), (-25, None), (30, None), (True, None)], [(0, [1, 1]), (-2, [16, 9]), (-3, [32, 27]), (-12, [1048576, 531441]), (30, None), (True, None), ('1', None), (1.0, None)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("oracle %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 0 | [1, 1] | [1, 1] | Passed |
| oracle 1 | [3, 2] | [3, 2] | Passed |
| oracle 2 | [9, 8] | [9, 8] | Passed |
| oracle 3 | [27, 16] | [27, 16] | Passed |
| oracle 4 | [81, 64] | [81, 64] | Passed |
| oracle 5 | [243, 128] | [243, 128] | Passed |
| oracle 6 | [8, 9] | [16, 9] | Failed |
| oracle 7 | [64, 243] | [256, 243] | Failed |
SHA-256 / 1281d2e6a2092d95c8c78553eb1f6dba0fb63609ef9fb54bde75922ee15e6d96
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(x):
if not isinstance(x, int) or isinstance(x, bool) or abs(x) > 24:
return None
r = Fraction(3, 2) ** x
while r >= 2:
r /= 2
while r <= 1:
r *= 2
return [r.numerator, r.denominator]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[(0, [1, 1]), (1, [3, 2]), (2, [9, 8]), (3, [27, 16]), (4, [81, 64]), (5, [243, 128]), (-2, [16, 9]), (-5, [256, 243])], [(0, [1, 1]), (4, [81, 64]), (5, [243, 128]), (6, [729, 512]), (7, [2187, 2048]), (12, [531441, 524288]), (-3, [32, 27]), (-6, [1024, 729])], [(0, [1, 1]), (7, [2187, 2048]), (12, [531441, 524288]), (-1, [4, 3]), (-5, [256, 243]), (-12, [1048576, 531441]), (24, [282429536481, 274877906944]), (25, None)], [(0, [1, 1]), (-6, [1024, 729]), (24, [282429536481, 274877906944]), (-24, [549755813888, 282429536481]), (25, None), (-25, None), (30, None), (True, None)], [(0, [1, 1]), (-2, [16, 9]), (-3, [32, 27]), (-12, [1048576, 531441]), (30, None), (True, None), ('1', None), (1.0, None)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("oracle %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 0 | [2, 1] | [1, 1] | Failed |
| oracle 1 | [3, 2] | [3, 2] | Passed |
| oracle 2 | [9, 8] | [9, 8] | Passed |
| oracle 3 | [27, 16] | [27, 16] | Passed |
| oracle 4 | [81, 64] | [81, 64] | Passed |
| oracle 5 | [243, 128] | [243, 128] | Passed |
| oracle 6 | [16, 9] | [16, 9] | Passed |
| oracle 7 | [256, 243] | [256, 243] | Passed |
SHA-256 / b4ce5b42443ee97aed373377ddc89da3cd058f78dacbffd9c020bb9ea022febe
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(x):
if not isinstance(x, int) or isinstance(x, bool) or abs(x) > 24:
return None
r = Fraction(3, 2) ** x
while r >= 2:
r /= 2
while r < 1:
r *= 2
return [r.numerator, r.denominator]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[(0, [1, 1]), (1, [3, 2]), (2, [9, 8]), (3, [27, 16]), (4, [81, 64]), (5, [243, 128]), (-2, [16, 9]), (-5, [256, 243])], [(0, [1, 1]), (4, [81, 64]), (5, [243, 128]), (6, [729, 512]), (7, [2187, 2048]), (12, [531441, 524288]), (-3, [32, 27]), (-6, [1024, 729])], [(0, [1, 1]), (7, [2187, 2048]), (12, [531441, 524288]), (-1, [4, 3]), (-5, [256, 243]), (-12, [1048576, 531441]), (24, [282429536481, 274877906944]), (25, None)], [(0, [1, 1]), (-6, [1024, 729]), (24, [282429536481, 274877906944]), (-24, [549755813888, 282429536481]), (25, None), (-25, None), (30, None), (True, None)], [(0, [1, 1]), (-2, [16, 9]), (-3, [32, 27]), (-12, [1048576, 531441]), (30, None), (True, None), ('1', None), (1.0, None)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("oracle %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 0 | [1, 1] | [1, 1] | Passed |
| oracle 1 | [3, 2] | [3, 2] | Passed |
| oracle 2 | [9, 8] | [9, 8] | Passed |
| oracle 3 | [27, 16] | [27, 16] | Passed |
| oracle 4 | [81, 64] | [81, 64] | Passed |
| oracle 5 | [243, 128] | [243, 128] | Passed |
| oracle 6 | [16, 9] | [16, 9] | Passed |
| oracle 7 | [256, 243] | [256, 243] | Passed |
SHA-256 / 9fec36c0bcd9309831223aa85f37a3d536cf0ab3fd724d1ebe4a4eb2e5bff6da
Verification & scope
A deterministic bounded teaching model with a stipulated toy contract; it is not a complete music notation or theory engine. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:49:59.894992+00:00.
Case digest / ecbbf73ed43823f21b106a51c59732990c6c08be5e5a83d14f726a8b2c412404