Skip to content

Tray of Coins Math Specification ​

Internal game name: tray_of_coins | Display name: "Tray of Gold"

Overview ​

Tray of Coins is a coin-toss game. N coins (default 30) are tossed onto a tray divided into three regions. The region holding the most coins wins, and players bet on which region wins.

RegionLabel (UI)Description
REDBet on RedLeft region
BLUEBet on BlueCenter water region
BLACKBet on BlackRight region

Coin Distribution ​

Each coin lands independently in one of the three regions (a multinomial distribution). Per-character landing weights are configurable and normalized to 1:

Characterw_redw_bluew_black
Gentleman0.360.280.36
Lady0.400.240.36

For coin i, P(lands in region r) = w_r. The count in region r follows the joint multinomial Multinomial(N, {w_red, w_blue, w_black}).

Win Condition ​

Current rule is majority:

text
winner = region with strictly the greatest coin count

Outcome Probability ​

The probability that region r wins is the sum of the multinomial probability mass over every distribution where C_r is strictly greater than every other region:

text
P(r wins) = sum of Multinomial(c_red, c_blue, c_black)
            over all (c_red, c_blue, c_black) where c_r is the strict maximum

The math module computes this exactly (closed-form summation; N is small) and also provides a Monte-Carlo simulator to cross-check.

Indicative values for default weights (exact values come from the math module):

OutcomeIndicative P
Red wins~42%
Black wins~42%
Blue wins~8%
Draw~2%

Odds Derivation ​

text
fair_odds(r) = 1 / P(r wins)
paid_odds(r) = fair_odds(r) * RTP_target          // RTP_target default 0.95
BetFair oddsPaid odds @ 95% RTP (indicative)
Red1/0.42 ~ 2.38x~2.26x
Black1/0.42 ~ 2.38x~2.26x
Blue1/0.08 = 12.5x~11.88x

RTP(r) = P(r wins) x paid_odds(r) = RTP_target for every bet, by construction.

Draw Handling ​

A draw occurs when no region has a strict majority: coins fall equally into three regions or into any two regions, so no winner can be decided.

draw_resolutionBehaviour
retoss (default)Re-run the same round: the caller re-invokes play with the same round identity (secret + server_seed) and a fresh client_seed. No new balance deduction.

Multiplier (Premium) Coins ​

A configurable set of premium coins (default 2x, 5x, 6x) land on regions like normal coins (weighted) and count toward that region's total. If a premium coin lands on the winning region, its value adds to that region's payout multiplier:

text
total_multiplier(r) = base_multiplier(r) + sum(value of premium coins landing in r)

The math module solves base_multiplier(r) so that the total RTP (base + premium coins

  • bonus) equals RTP_target.

Bonus Mini-Game ​

After a settled round, a bonus round may trigger:

ParameterDefault
bonus_trigger_probability0.10
bonus_coin_multiplier25x
bonus_coins_min / bonus_coins_max1 / 3

bonus_payout = collected_coins x bonus_coin_multiplier x bet. All parameters configurable.

Configurable Parameters ​

ParameterDefaultDescription
total_coins30Coins tossed per round
region_weights (per character)see tableLanding weights, normalized
regions[].is_bettabletrueWhether players may bet on the region
rtp_target0.95Return-to-player target per bet
premium_coins[{2},{5},{6}]Values added to winning side
bonus_*see aboveBonus mini-game parameters