Method | Description | |
---|---|---|
E_bruteForce ( bool gondalas, int i, int j, int k, int N ) : Utils.math.BigFraction |
The expected money we get while filling out the interval [i, j) so that the last filled gondola is at position (i+k) is:
|
|
P_bruteForce ( bool gondalas, int i, int j ) : Utils.math.BigFraction |
so first let’s look at P(i, j), the probability that j-th gondola will stay empty while we fill up all gondolas from the interval [i, j) assuming each coming person approaches some gondola in inteval [i, j] (note that j is included here)
|
|
P_bruteForce ( bool gondalas, int i, int j, int k ) : Utils.math.BigFraction |
The probability that gondola j stays empty while we fill interval [i, j) and that gondola at position (i+k) is filled last is P(i, j, k) and can be computed as:
|
|
getE_wheelFast ( bool a, int i, int j, int holeCount, int N ) : Utils.Fraction | ||
simulateForWheelFast ( bool gondolas, IList |
||
simulatePermutation ( bool gondolas, IList |
|
|
simulatePermutationExpectedValue ( bool gondolas, IList |
|
public static E_bruteForce ( bool gondalas, int i, int j, int k, int N ) : Utils.math.BigFraction | ||
gondalas | bool | |
i | int | |
j | int | |
k | int | |
N | int | |
return | Utils.math.BigFraction |
public static P_bruteForce ( bool gondalas, int i, int j ) : Utils.math.BigFraction | ||
gondalas | bool | |
i | int | |
j | int | |
return | Utils.math.BigFraction |
public static P_bruteForce ( bool gondalas, int i, int j, int k ) : Utils.math.BigFraction | ||
gondalas | bool | True if filled, false if empty |
i | int | |
j | int | |
k | int | |
return | Utils.math.BigFraction |
public static getE_wheelFast ( bool a, int i, int j, int holeCount, int N ) : Utils.Fraction | ||
a | bool | |
i | int | |
j | int | |
holeCount | int | |
N | int | |
return | Utils.Fraction |
public static simulateForWheelFast ( bool gondolas, IList |
||
gondolas | bool | |
permOrder | IList |
|
N | int | |
return | int |
public static simulatePermutation ( bool gondolas, IList |
||
gondolas | bool | |
permOrder | IList |
|
secondToLastToFill | int | |
N | int | |
return | int |
public static simulatePermutationExpectedValue ( bool gondolas, IList |
||
gondolas | bool | |
permOrder | IList |
|
secondToLastToFill | int | |
N | int | |
return | int |