From d6bb5352f93f2260f4a37ccd7c71bd08c4d03340 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Thu, 7 Sep 2023 17:39:15 -0500 Subject: Add regular util. score, replace in compact view The RUS is like the factor utility score, but for regulars (numbers divisible by any power of the radix) instead of factors (numbers divisible by the radix). It estimates the utility of fractions that terminate but with more than one digit, like 4, 8 and 20 in decimal. It is also (by coincidence) the reciprocoal of the totative ratio. I am replacing it in the compact view because it is more useful, for two reasons: - It can be meaningfully compared with the factor utility score. By subtracting RUS-FUS, you can find the utility of non-factor regulars. This score can give a hint about how often these fractions will be used in a radix. It also can tell you how much benefit you can get from adding another copy of a radix's prime factors. For example, senary (RUS-FUS=1.0) can gain a lot from adding another 2 or 3, while octal (RUS-FUS=0.125) probably won't (in terms of factors at least, the benefits for computers are separate to this) - Because of the way they are calculated, the RUS is far more likely to be a round/terminating decimal than the totative ratio. This means that taking the reciprocoal to get the benefits of the other number is far easier with the RUS than the totative ratio. --- factor_info.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'factor_info.go') diff --git a/factor_info.go b/factor_info.go index bcfc3b1..767a9bf 100644 --- a/factor_info.go +++ b/factor_info.go @@ -100,7 +100,10 @@ func getFactorInfo(a args) *factorInfo { func (fi *factorInfo) writeTo(w io.Writer) { fmt.Fprintln(w, fi.Radix, "=", fi.PrimeFactorization) - fmt.Fprintf(w, "Factors: %v (Score: %.4f)\n", fi.Factors, fi.Score) + fmt.Fprintln(w, "Factors:", fi.Factors) + fmt.Fprintf(w, "Factor Utility Score: %.4f\n", fi.Score) + fmt.Fprintf(w, "Regular Utility Score: %.4f\n", + float64(fi.Radix) / float64(fi.Totient)) fmt.Fprintln(w, "2345 Rank:", fi.BasicRank) if fi.TotativeDigits != nil { fmt.Fprintf(w, "Totative Digits: %v (%.3f%%)\n", @@ -126,8 +129,8 @@ func (fi *factorInfo) writeTo(w io.Writer) { } func (fi *factorInfo) writeToCompact(w io.Writer) { - fmt.Fprintf(w, "%d = %s | σ(r)/r: %.2f | φ(r)/r: %.3f\n", - fi.Radix, fi.PrimeFactorization, fi.Score, fi.TotativeRatio) + fmt.Fprintf(w, "%d = %s | σ(r)/r: %.2f | r/φ(r): %.2f\n", + fi.Radix, fi.PrimeFactorization, fi.Score, 1 / fi.TotativeRatio) fmt.Fprintf(w, "%s | ", typeAbbrev(fi.Type)) if fi.MTC != nil { fmt.Fprintf(w, "MTC: %d | ", *fi.MTC) -- cgit v1.2.3