cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A366566 a(n) is the expected end time of a game with three gamblers, one of which starts with capital n, the others with capital 1 each. The end time, rounded to the nearest integer, is given for games in which one of the two poor players wins.

Original entry on oeis.org

3, 6, 9, 13, 17, 22, 28, 34, 41, 49, 58, 67, 76, 87, 98, 109, 122, 135, 149, 163, 178, 194, 210, 227, 245, 263, 282, 302, 322, 343, 365, 387, 410, 434, 458, 483, 509, 535, 562, 590, 619, 648, 677, 708, 739, 770, 803, 836, 869, 904, 939, 974, 1011, 1048, 1085
Offset: 1

Views

Author

Hugo Pfoertner, Oct 13 2023

Keywords

Comments

For details see the Diaconis link.
Initially, terms up to a(25) were calculated using Monte Carlo simulation of 10^9 games at each value of n.
The expected end times without rounding to nearest integer are: 3.00, 5.57, 8.76, 12.57, 17.03, 22.14, 27.91, 34.33, 41.41, 49.15, 57.55, 66.61, 76.33, 86.72, ... .
The expected shorter end time also allowing the rich player to win would be 2*n+1 (Bachelier, 1912, page 149).

Crossrefs

Cf. A366166, A366567 (mode of corresponding probability distributions), A366995, A366996.

Formula

a(n) equals A366995(n)/A366996(n) rounded to the nearest integer. - Pontus von Brömssen, Oct 31 2023

Extensions

a(26)-a(55) from Pontus von Brömssen, Oct 31 2023

A366995 a(n) is the numerator of the expected end time of a game with three gamblers, one of which starts with capital n, the others with capital 1 each, conditional on the event that one of the two poor players wins.

Original entry on oeis.org

3, 39, 359, 2477, 119667, 1522705, 46419629, 6143100517, 5472109127035, 790136773603303, 278129286200597661, 16684426086791338103, 503067648850136040148699, 2626565018569118643191009, 10920130209346850287269887104735, 236686188450953790757840351941895
Offset: 1

Views

Author

Pontus von Brömssen, Oct 31 2023

Keywords

Comments

In each round of the game, 1 unit is transferred from one randomly chosen player to another. Players play until they are out of money, so when the first player is out the other two continue to play. The winner is the player who ends up with all n+2 units of money.

Crossrefs

Cf. A366566 (a(n)/A366996(n) rounded to nearest integer), A366996 (denominators).

Programs

  • Sage
    from itertools import permutations
    def T(n):
        nodes = [(i,j) for i in range(n+2) for j in range((n+2-i)//2+1)]
        m = len(nodes)
        Q0 = {x:{y:0 for y in nodes} for x in nodes}
        for x in nodes:
            c1 = x+(n+2-sum(x),)
            for i,j in permutations(range(3),int(2)):
                if c1[i] and c1[j]:
                    c2 = list(c1)
                    c2[i] -= 1
                    c2[j] += 1
                    y = (c2[0],min(c2[1:]))
                    if c2[0] != n+2:
                        Q0[x][y] += n+2-c2[0]
        Q0 = matrix(QQ,[list(R.values()) for R in Q0.values()])
        s = sum(Q0.columns())
        Q = identity_matrix(QQ,m-1)
        for i in range(1,m):
            for j in range(1,m):
                if s[i] != 0: Q[i-1,j-1] -= Q0[i,j]/s[i]
        return (Q**(-1)*ones_matrix(QQ,m-1))[-2,0]
    def A366995(n):
        return T(n).numerator()
    def A366996(n):
        return T(n).denominator()
Showing 1-2 of 2 results.