Talk:Fairshare between two and more

From Rosetta Code
Revision as of 11:42, 26 June 2020 by rosettacode>Horst.h (removed lengthy edit)

Perl 6 count of how many turns each person gets

Whilst important to some degree, the sequence minimises any advantage that going first/going earlier might give. I've blogged twice, here, and here about it and the sequence appears many times in science and maths. (Try this paper (PDF), for example. --Paddy3118 (talk) 23:54, 1 February 2020 (UTC)

I have to say, I kind of missed the point of the task initially so was not really sure what it was demonstrating. The actual algorithm was simple, the reason for it escaped me. After reading your links, the lightbulb lit. I removed the "number of times each person goes" which was kind-of pointless, and added a "fairness correlation" calculation showing the relative fairness to the Perl 6 entry. --Thundergnat (talk) 13:43, 2 February 2020 (UTC)
Great :-)
--Paddy3118 (talk) 18:26, 2 February 2020 (UTC)
I tried to clearify things to me, like Paddy3118 described in his links.Without different values, it makes no sense.
Rest removed, explanation by Paddy3118 (Horst.h) Horst.h (talk) 11:42, 26 June 2020 (UTC)

Fairness example and cycles

I saw Horsts' Perl program above, and recognized that the idea of fairness is hard to bring across so I thought I might do an example by hand.

The set of numbers in this case are not a linear progression, so we (maybe), see the emergence of Thue-Morse as being the most "fair" calculated as the spread in final amounts per person.

For all cases we will have have three people A B and C to choose the best at their turn, from the same, ever decreasing pots of money.

18 then 27 Fibonacci numbers

Numbers: [2584, 1597, 987, 610, 377, 233, 144, 89, 55, 34, 21, 13, 8, 5, 3, 2, 1, 1]

  Order: ABC_ABC_ABC_ABC_ABC_ABC : Simple Repetition
    A gets: 2584 + 610 + 144 + 34 +  8 +  2 = 3382
    B gets: 1597 + 377 + 89 + 21 +  5 +  1 = 2090
    C gets: 987 + 233 + 55 + 13 +  3 +  1 = 1292
  Maximum difference in amounts = 2090

  Order: ABC-BCA-CAB_ABC-BCA-CAB : Simple Rotation
    A gets: 2584 + 233 + 89 + 34 +  3 +  1 = 2944
    B gets: 1597 + 610 + 55 + 21 +  8 +  1 = 2292
    C gets: 987 + 377 + 144 + 13 +  5 +  2 = 1528
  Maximum difference in amounts = 1416

  Order: ABC-BCA-CAB-BCA-CAB-ABC : Thue-Morse Fairshare
    A gets: 2584 + 233 + 89 + 13 +  5 +  2 = 2926
    B gets: 1597 + 610 + 55 + 34 +  3 +  1 = 2300
    C gets: 987 + 377 + 144 + 21 +  8 +  1 = 1538
  Maximum difference in amounts = 1388

Numbers: [196418, 121393, 75025, 46368, 28657, 17711, 10946, 6765, 4181, 2584, 1597, 987, 610, 377, 233, 144, 89, 55, 34, 21, 13, 8, 5, 3, 2, 1, 1]

  Order: ABC_ABC_ABC_ABC_ABC_ABC_ABC_ABC_ABC : Simple Repetition
    A gets: 196418 + 46368 + 10946 + 2584 + 610 + 144 + 34 +  8 +  2 = 257114
    B gets: 121393 + 28657 + 6765 + 1597 + 377 + 89 + 21 +  5 +  1 = 158905
    C gets: 75025 + 17711 + 4181 + 987 + 233 + 55 + 13 +  3 +  1 = 98209
  Maximum difference in amounts = 158905

  Order: ABC-BCA-CAB_ABC-BCA-CAB_ABC-BCA-CAB : Simple Rotation
    A gets: 196418 + 17711 + 6765 + 2584 + 233 + 89 + 34 +  3 +  1 = 223838
    B gets: 121393 + 46368 + 4181 + 1597 + 610 + 55 + 21 +  8 +  1 = 174234
    C gets: 75025 + 28657 + 10946 + 987 + 377 + 144 + 13 +  5 +  2 = 116156
  Maximum difference in amounts = 107682

  Order: ABC-BCA-CAB-BCA-CAB-ABC-CAB-ABC-BCA : Thue-Morse Fairshare
    A gets: 196418 + 17711 + 6765 + 987 + 377 + 144 + 21 +  8 +  1 = 222432
    B gets: 121393 + 46368 + 4181 + 2584 + 233 + 89 + 13 +  5 +  2 = 174868
    C gets: 75025 + 28657 + 10946 + 1597 + 610 + 55 + 34 +  3 +  1 = 116928
  Maximum difference in amounts = 105504

Thue-Morse is best in this case.

Hmmm, I feel a blog coming on...

--Paddy3118 (talk) 03:50, 26 June 2020 (UTC)