N2D3P9: Difference between revisions
Dave Keenan (talk | contribs) m Changed "the weighted sum of squares <math>\text{sopfr}</math> gives" to "the weighted sum of squares that <math>\text{sopfr}</math> gives". |
Cmloegcmluin (talk | contribs) add table of top 100 5-rough ratios |
||
| Line 14: | Line 14: | ||
# '''prime-limit''', which is also known as <math>\text{gpf}</math>, which stands for [https://mathworld.wolfram.com/GreatestPrimeFactor.html greatest prime factor]. <math>\text{prime-limit}(175) = 7</math>. Some authors leave <math>\text{prime-limit}(1)</math> undefined; we avoid the question because we define <math>\text{N2D3P9}(\frac{1}{1})</math> ≡ <math>\text{N2D3P9}(\frac{3}{1}) = 1</math>. This is because the ratios in the equivalence class represented by the 5-rough <math>\frac{1}{1}</math> actually have a prime limit of 3. | # '''prime-limit''', which is also known as <math>\text{gpf}</math>, which stands for [https://mathworld.wolfram.com/GreatestPrimeFactor.html greatest prime factor]. <math>\text{prime-limit}(175) = 7</math>. Some authors leave <math>\text{prime-limit}(1)</math> undefined; we avoid the question because we define <math>\text{N2D3P9}(\frac{1}{1})</math> ≡ <math>\text{N2D3P9}(\frac{3}{1}) = 1</math>. This is because the ratios in the equivalence class represented by the 5-rough <math>\frac{1}{1}</math> actually have a prime limit of 3. | ||
So the formula for <math>\text{N2D3P9}</math>(<math>\frac{n}{d}</math>) is: | So the formula for <math>\text{N2D3P9}</math>(<math>\frac{n}{d}</math><nowiki>) is: | ||
$$ | $$ | ||
\begin{cases} | \begin{cases} | ||
| Line 22: | Line 22: | ||
\end{cases} | \end{cases} | ||
$$ | $$ | ||
Note that where | Note that where</nowiki> | ||
<math>n = 5^{n_5}×7^{n_7}×11^{n_{11}}×...</math> | <math>n = 5^{n_5}×7^{n_7}×11^{n_{11}}×...</math> | ||
| Line 42: | Line 42: | ||
''Take the prime factorization of the numerator and divide all the primes by 2, then multiply it out again. Do the same with the denominator but divide the primes by 3 instead of 2. Multiply these two results together then multiply by the prime limit of the ratio and divide by 9.'' | ''Take the prime factorization of the numerator and divide all the primes by 2, then multiply it out again. Do the same with the denominator but divide the primes by 3 instead of 2. Multiply these two results together then multiply by the prime limit of the ratio and divide by 9.'' | ||
<math>\text{N2D3P9}</math> can also be written as: | <math>\text{N2D3P9}</math><nowiki> can also be written as: | ||
$$\text{N2D3P9}(\frac{n}{d})=\frac{nd⋅\text{gpf}(nd)}{2^{Ω(n)}3^{Ω(d) + 2}} $$ | $$\text{N2D3P9}(\frac{n}{d})=\frac{nd⋅\text{gpf}(nd)}{2^{Ω(n)}3^{Ω(d) + 2}} $$ | ||
where <math>nd</math> is established in music theory as a ratio's "product complexity" or [[Benedetti height]]. | where </nowiki><math>nd</math> is established in music theory as a ratio's "product complexity" or [[Benedetti height]]. | ||
The division by 9 does not affect the ranking, but it has the convenient effect that <math>\text{N2D3P9}</math> values are almost the same as the ranks they produce when applied to all 5-rough superunison ratios. Putting it another way, there are approximately <math>N</math> 5-rough pitch ratios with <math>\text{N2D3P9}≤N</math>. For example, <math>\text{N2D3P9}(\frac{77}{5}) = \frac{7}{2} × \frac{11}{2} × \frac{5}{3} × \frac{11}{9} ≈ 39</math>, suggesting there are approximately 38 other 5-rough pitch ratios more popular than <math>\frac{77}{5}</math>. There are actually about 4% fewer than that on average. In this case there are 36. | The division by 9 does not affect the ranking, but it has the convenient effect that <math>\text{N2D3P9}</math> values are almost the same as the ranks they produce when applied to all 5-rough superunison ratios. Putting it another way, there are approximately <math>N</math> 5-rough pitch ratios with <math>\text{N2D3P9}≤N</math>. For example, <math>\text{N2D3P9}(\frac{77}{5}) = \frac{7}{2} × \frac{11}{2} × \frac{5}{3} × \frac{11}{9} ≈ 39</math>, suggesting there are approximately 38 other 5-rough pitch ratios more popular than <math>\frac{77}{5}</math>. There are actually about 4% fewer than that on average. In this case there are 36. | ||
| Line 79: | Line 79: | ||
The overall strategy, then, was to minimize this weighted rank correlation, while also minimizing the complexity of the function, to avoid overfitting. An earlier 5-rough-ratio notational popularity ranking function that had been used by the creators of Sagittal was <math>\text{sopfr}</math> ([https://mathworld.wolfram.com/SumofPrimeFactors.html sum of prime factors with repetition]), and as simple as this function is, it does a remarkably good job of estimating the rank of pitch ratios. For comparison, the weighted sum of squares that <math>\text{sopfr}</math> gives for the Scala stats is about 0.026, while the weighted sum of squares <math>\text{N2D3P9}</math> gives is about 0.010. Functions giving sums of squares as low as 0.008 were found, however, these functions were so complex that they probably were fitting to noise in the Scala stats instead of to the true nature of musical pitch. An informal “chunk” metric was devised to compare function complexity in terms of fit to the data, with considered functions ranging from one chunk (<math>\text{sopfr}</math>) to eight chunks; the winning function <math>\text{N2D3P9}</math> has five chunks. | The overall strategy, then, was to minimize this weighted rank correlation, while also minimizing the complexity of the function, to avoid overfitting. An earlier 5-rough-ratio notational popularity ranking function that had been used by the creators of Sagittal was <math>\text{sopfr}</math> ([https://mathworld.wolfram.com/SumofPrimeFactors.html sum of prime factors with repetition]), and as simple as this function is, it does a remarkably good job of estimating the rank of pitch ratios. For comparison, the weighted sum of squares that <math>\text{sopfr}</math> gives for the Scala stats is about 0.026, while the weighted sum of squares <math>\text{N2D3P9}</math> gives is about 0.010. Functions giving sums of squares as low as 0.008 were found, however, these functions were so complex that they probably were fitting to noise in the Scala stats instead of to the true nature of musical pitch. An informal “chunk” metric was devised to compare function complexity in terms of fit to the data, with considered functions ranging from one chunk (<math>\text{sopfr}</math>) to eight chunks; the winning function <math>\text{N2D3P9}</math> has five chunks. | ||
Several techniques were used to find and decide on | Several techniques were used to find and decide on as the best 5-rough ratio notational popularity rank estimation function. Initial observations about shortcomings of , such as its failure to differentiate balanced ratios from their imbalanced equivalents — such as versus — or those with different prime limits such as and , despite those pairs of ratios exhibiting remarkably different actual ranks in the Scala stats, formed the basis of the investigation. Psychoacoustic plausibility of functions was used as a top-down guide for experimentation. [https://en.wikipedia.org/wiki/Mathematical_optimization Optimization] tools such as [https://www.microsoft.com/en-us/microsoft-365/blog/2009/09/21/new-and-improved-solver/ Excel's Evolutionary Solver] were used to navigate toward ideal values for each parameter. A brute-force technique was also utilized whereby nearly 2 billion functions combined out of constituent "submetrics" were checked automatically. In the end, one of the functions generated from the brute-force checker was recognized as being re-writable in a much simpler form with parameter values rounded to whole numbers without doing much damage to its sum-of-squares, and thus was born. | ||
== Table of Top 100 (5-Rough) Ratios == | |||
{| class="wikitable" | |||
|+ | |||
!5-rough ratio | |||
!N2D3P9 | |||
!estimated rank | |||
!actual rank | |||
|- | |||
|1/1 | |||
|1 | |||
|1 | |||
|1 | |||
|- | |||
|5/1 | |||
|1.39 | |||
|2 | |||
|2 | |||
|- | |||
|7/1 | |||
|2.72 | |||
|3 | |||
|3 | |||
|- | |||
|25/1 | |||
|3.47 | |||
|4 | |||
|4 | |||
|- | |||
|7/5 | |||
|4.54 | |||
|5 | |||
|5 | |||
|- | |||
|11/1 | |||
|6.72 | |||
|6 | |||
|6 | |||
|- | |||
|35/1 | |||
|6.81 | |||
|7 | |||
|7 | |||
|- | |||
|125/1 | |||
|8.68 | |||
|8 | |||
|8 | |||
|- | |||
|13/1 | |||
|9.39 | |||
|9 | |||
|10 | |||
|- | |||
|49/1 | |||
|9.53 | |||
|10 | |||
|9 | |||
|- | |||
|11/5 | |||
|11.2 | |||
|11 | |||
|11 | |||
|- | |||
|25/7 | |||
|11.34 | |||
|12 | |||
|14 | |||
|- | |||
|13/5 | |||
|15.65 | |||
|13 | |||
|16 | |||
|- | |||
|11/7 | |||
|15.69 | |||
|14 | |||
|12 | |||
|- | |||
|49/5 | |||
|15.88 | |||
|15 | |||
|15 | |||
|- | |||
|17/1 | |||
|16.06 | |||
|16 | |||
|13 | |||
|- | |||
|55/1 | |||
|16.81 | |||
|17 | |||
|24 | |||
|- | |||
|175/1 | |||
|17.01 | |||
|18 | |||
|17 | |||
|- | |||
|19/1 | |||
|20.06 | |||
|19 | |||
|18 | |||
|- | |||
|625/1 | |||
|21.7 | |||
|20 | |||
|21 | |||
|- | |||
|13/7 | |||
|21.91 | |||
|21 | |||
|20 | |||
|- | |||
|65/1 | |||
|23.47 | |||
|22 | |||
|50 | |||
|- | |||
|77/1 | |||
|23.53 | |||
|23 | |||
|25 | |||
|- | |||
|245/1 | |||
|23.82 | |||
|24 | |||
|19 | |||
|- | |||
|49/25 | |||
|26.47 | |||
|25 | |||
|23 | |||
|- | |||
|17/5 | |||
|26.76 | |||
|26 | |||
|26 | |||
|- | |||
|25/11 | |||
|28.01 | |||
|27 | |||
|47 | |||
|- | |||
|125/7 | |||
|28.36 | |||
|28 | |||
|33 | |||
|- | |||
|23/1 | |||
|29.39 | |||
|29 | |||
|22 | |||
|- | |||
|91/1 | |||
|32.86 | |||
|30 | |||
|57 | |||
|- | |||
|343/1 | |||
|33.35 | |||
|31 | |||
|31 | |||
|- | |||
|19/5 | |||
|33.43 | |||
|32 | |||
|27 | |||
|- | |||
|13/11 | |||
|34.43 | |||
|33 | |||
|29 | |||
|- | |||
|121/1 | |||
|36.97 | |||
|34 | |||
|42.5 | |||
|- | |||
|17/7 | |||
|37.46 | |||
|35 | |||
|40 | |||
|- | |||
|25/13 | |||
|39.12 | |||
|36 | |||
|52.5 | |||
|- | |||
|77/5 | |||
|39.21 | |||
|38 | |||
|28 | |||
|- | |||
|55/7 | |||
|39.21 | |||
|38 | |||
|34 | |||
|- | |||
|35/11 | |||
|39.21 | |||
|38 | |||
|35.5 | |||
|- | |||
|85/1 | |||
|40.14 | |||
|40 | |||
|78 | |||
|- | |||
|275/1 | |||
|42.01 | |||
|41 | |||
|147 | |||
|- | |||
|875/1 | |||
|42.53 | |||
|42 | |||
|76 | |||
|- | |||
|29/1 | |||
|46.72 | |||
|43 | |||
|32 | |||
|- | |||
|19/7 | |||
|46.8 | |||
|44 | |||
|37.5 | |||
|- | |||
|23/5 | |||
|48.98 | |||
|45 | |||
|44 | |||
|- | |||
|95/1 | |||
|50.14 | |||
|46 | |||
|72 | |||
|- | |||
|143/1 | |||
|51.64 | |||
|47 | |||
|66 | |||
|- | |||
|31/1 | |||
|53.39 | |||
|48 | |||
|30 | |||
|- | |||
|3125/1 | |||
|54.25 | |||
|49 | |||
|52.5 | |||
|- | |||
|91/5 | |||
|54.77 | |||
|51 | |||
|68 | |||
|- | |||
|65/7 | |||
|54.77 | |||
|51 | |||
|102.5 | |||
|- | |||
|35/13 | |||
|54.77 | |||
|51 | |||
|102.5 | |||
|- | |||
|49/11 | |||
|54.9 | |||
|53 | |||
|54 | |||
|- | |||
|343/5 | |||
|55.58 | |||
|54 | |||
|55.5 | |||
|- | |||
|119/1 | |||
|56.19 | |||
|55 | |||
|252.5 | |||
|- | |||
|325/1 | |||
|58.68 | |||
|56 | |||
|604.5 | |||
|- | |||
|385/1 | |||
|58.82 | |||
|57 | |||
|37.5 | |||
|- | |||
|17/11 | |||
|58.87 | |||
|58 | |||
|35.5 | |||
|- | |||
|1225/1 | |||
|59.55 | |||
|59 | |||
|41 | |||
|- | |||
|169/1 | |||
|61.03 | |||
|60 | |||
|86 | |||
|- | |||
|121/5 | |||
|61.62 | |||
|61 | |||
|147 | |||
|- | |||
|77/25 | |||
|65.35 | |||
|62 | |||
|63 | |||
|- | |||
|125/49 | |||
|66.17 | |||
|63 | |||
|63 | |||
|- | |||
|25/17 | |||
|66.9 | |||
|64 | |||
|134.5 | |||
|- | |||
|23/7 | |||
|68.57 | |||
|65 | |||
|47 | |||
|- | |||
|17/13 | |||
|69.57 | |||
|66 | |||
|47 | |||
|- | |||
|125/11 | |||
|70.02 | |||
|67 | |||
|147 | |||
|- | |||
|133/1 | |||
|70.19 | |||
|68 | |||
|329 | |||
|- | |||
|625/7 | |||
|70.89 | |||
|69 | |||
|113 | |||
|- | |||
|115/1 | |||
|73.47 | |||
|70 | |||
|604.5 | |||
|- | |||
|19/11 | |||
|73.54 | |||
|71 | |||
|55.5 | |||
|- | |||
|37/1 | |||
|76.06 | |||
|72 | |||
|42.5 | |||
|- | |||
|49/13 | |||
|76.68 | |||
|73 | |||
|147 | |||
|- | |||
|29/5 | |||
|77.87 | |||
|74 | |||
|59.5 | |||
|- | |||
|455/1 | |||
|82.15 | |||
|75 | |||
|186.5 | |||
|- | |||
|539/1 | |||
|82.35 | |||
|76 | |||
|186.5 | |||
|- | |||
|1715/1 | |||
|83.37 | |||
|77 | |||
|76 | |||
|- | |||
|25/19 | |||
|83.56 | |||
|78 | |||
|79.5 | |||
|- | |||
|143/5 | |||
|86.06 | |||
|80 | |||
|217.5 | |||
|- | |||
|65/11 | |||
|86.06 | |||
|80 | |||
|164 | |||
|- | |||
|55/13 | |||
|86.06 | |||
|80 | |||
|90 | |||
|- | |||
|121/7 | |||
|86.27 | |||
|82 | |||
|164 | |||
|- | |||
|19/13 | |||
|86.91 | |||
|83 | |||
|45 | |||
|- | |||
|187/1 | |||
|88.31 | |||
|84 | |||
|217.5 | |||
|- | |||
|31/5 | |||
|88.98 | |||
|85 | |||
|68 | |||
|- | |||
|91/25 | |||
|91.28 | |||
|86 | |||
|329 | |||
|- | |||
|55/49 | |||
|91.5 | |||
|87 | |||
|39 | |||
|- | |||
|605/1 | |||
|92.43 | |||
|88 | |||
|94.5 | |||
|- | |||
|343/25 | |||
|92.63 | |||
|89 | |||
|68 | |||
|- | |||
|41/1 | |||
|93.39 | |||
|90 | |||
|72 | |||
|- | |||
|119/5 | |||
|93.66 | |||
|92 | |||
|123.5 | |||
|- | |||
|85/7 | |||
|93.66 | |||
|92 | |||
| - | |||
|- | |||
|35/17 | |||
|93.66 | |||
|92 | |||
|217.5 | |||
|- | |||
|125/13 | |||
|97.8 | |||
|94 | |||
|604.5 | |||
|- | |||
|275/7 | |||
|98.03 | |||
|95.5 | |||
|102.5 | |||
|- | |||
|175/11 | |||
|98.03 | |||
|95.5 | |||
|147 | |||
|- | |||
|425/1 | |||
|100.35 | |||
|97 | |||
|329 | |||
|- | |||
|169/5 | |||
|101.71 | |||
|98 | |||
|329 | |||
|- | |||
|121/25 | |||
|102.7 | |||
|99 | |||
|217.5 | |||
|- | |||
|43/1 | |||
|102.72 | |||
|100 | |||
|58 | |||
|} | |||
<math>\text{N2D3P9}</math><math>\text{sopfr}</math><math>\frac{11}{5}</math><math>\frac{55}{1}</math><math>\frac{13}{5}</math><math>\frac{11}{7}</math><math>\text{N2D3P9}</math> | |||