TreeGamePayoff
✖
TreeGamePayoff
gives the expected payoff for each player in the tree game tgame with strategy profile strat.
gives the expected payoff for each player in the tree game tgame with the incomplete strategy profile strat and the adversary type adv.
Details

- TreeGamePayoff is also known as the expected payoff or the expected utility of a sequential game.
- TreeGamePayoff is typically used to evaluate expected payoffs for players given strategies for each of the players.
- A tree game strategy <…,playeri<{ni,1}pri,1,…,{ni,mi}pri,mi >,… > specifies the action probabilities pri,j for playeri in action node ni,j for playeri.
- The expected payoff pi for player i at the action node nj with mj choices is given by pi[{nj}]=
pi[{nj,k}].prj,k, while the expected payoff pi for player i at the end node nt is given by its specified payoff: pi[{nt}]=pi,j.
- An incomplete tree strategy is a tree game strategy where only a subset of the action nodes have specified probabilities.
- For an incomplete strategy, the following specifications can be given for unspecified actions adv:
-
"Perfect" the payoffs of a random trial assuming an optimal choice for unspecified actions "PerfectExpectation" the average payoffs assuming an optimal random choice for unspecified actions "Random" the payoffs of a random trial assuming a uniform random choice for unspecified actions "RandomExpectation" the average payoffs assuming a uniform random choice for unspecified actions
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Generate a three-player tree game:

https://wolfram.com/xid/08uokgdd4v8czxf-p22le

Find the expected payoffs for a given strategy:

https://wolfram.com/xid/08uokgdd4v8czxf-xxvrz

Payoffs for Revolution where players act optimally, using an empty association for a "perfect" strategy:

https://wolfram.com/xid/08uokgdd4v8czxf-f6v4ik

Payoffs for Beer-Quiche where "Weak" is chosen by the "Nature" player and all others act randomly:

https://wolfram.com/xid/08uokgdd4v8czxf-ezisz4

Scope (3)Survey of the scope of standard use cases
Generate a two-player tree game:

https://wolfram.com/xid/08uokgdd4v8czxf-ix72io

Find the expected payoffs for a given strategy:

https://wolfram.com/xid/08uokgdd4v8czxf-cs84kh

Consider a two-player game with probabilities:

https://wolfram.com/xid/08uokgdd4v8czxf-sjtwz

Find the expected payoffs for a given strategy:

https://wolfram.com/xid/08uokgdd4v8czxf-9gzwl

Compute the expected payoffs for random players in a Centipede game:

https://wolfram.com/xid/08uokgdd4v8czxf-efyu0d

Applications (5)Sample problems that can be solved with this function
Social Games (3)
The Centipede game has two players who alternate in making decisions. At each turn, a player can choose between going "down" and ending the game or going "across" and continuing it (except at the last node where going "across" also ends the game). The longer the game goes on, the higher the total utility. A player who ends the game early will get a larger share of what utility there is. Consider a centipede game of three actions per player:

https://wolfram.com/xid/08uokgdd4v8czxf-togse

While the game-theoretic best solution is the pessimistic first choice, note that random players have a similar expected payoff. Compare the expected output of random and perfect players:

https://wolfram.com/xid/08uokgdd4v8czxf-b3xp92


https://wolfram.com/xid/08uokgdd4v8czxf-rqm4h

The tree game of Matching Pennies is a game where each of two people chooses either Head or Tail. If the choices differ, person 1 pays person 2 a dollar; if they are the same, person 2 pays person 1 a dollar. Generate a tree game of Matching Pennies:

https://wolfram.com/xid/08uokgdd4v8czxf-hdx5rm


https://wolfram.com/xid/08uokgdd4v8czxf-dhmfy0

Clearly, this game gives an advantage to player 2, making it impossible to get a better payoff against a perfect player. Imagine being player 1. Try several strategies to attempt to beat a perfect player (to have a payoff of 1):

https://wolfram.com/xid/08uokgdd4v8czxf-en7elr


https://wolfram.com/xid/08uokgdd4v8czxf-j8fk6m


https://wolfram.com/xid/08uokgdd4v8czxf-eexkgt

An entry game is a game where an entrant decides whether to enter a market or not, and the incumbent decides whether to fight or accommodate the entrant if he enters. Generate an entry game:

https://wolfram.com/xid/08uokgdd4v8czxf-fsyxii


https://wolfram.com/xid/08uokgdd4v8czxf-cdxj7y

Suppose that you are the incumbent player, and your strategy is to always fight (first choice). Find the expected payoff against a random player:

https://wolfram.com/xid/08uokgdd4v8czxf-bwjqig

Perfect players assume perfect subgame equilibrium. Since that strategy is suboptimal, it turns out that the perfect player may have a worse payoff than the random player. Find the expected payoff against a perfect player:

https://wolfram.com/xid/08uokgdd4v8czxf-erq3h

Recreational Games (2)
Rock Paper Scissors is a zero-sum game, where either one player wins and the other loses, or there is a tie. Generate the tree version of this game, where the second player can choose an action considering the action of the first player:

https://wolfram.com/xid/08uokgdd4v8czxf-ubinn


https://wolfram.com/xid/08uokgdd4v8czxf-dyl7at

Clearly, in the case of the tree game of Rock Paper Scissors, the second player can always choose the best action, and thus the first player is at a disadvantage by playing first. Write the perfect strategy in this version of Rock Paper Scissors:

https://wolfram.com/xid/08uokgdd4v8czxf-dbk6o

Consider the game of tic-tac-toe. Design a function to generate the partial tic-tac-toe game between players A and B:

https://wolfram.com/xid/08uokgdd4v8czxf-dd9gx5
Consider a partially completed game of tic-tac-toe:

https://wolfram.com/xid/08uokgdd4v8czxf-dw968s
Form a TreeGame based on it:

https://wolfram.com/xid/08uokgdd4v8czxf-by41zt

If both players play perfectly, Player B wins:

https://wolfram.com/xid/08uokgdd4v8czxf-cmntih

If both players play randomly, player 2 is more likely to win only by a small margin:

https://wolfram.com/xid/08uokgdd4v8czxf-bhypnq

Wolfram Research (2025), TreeGamePayoff, Wolfram Language function, https://reference.wolfram.com/language/ref/TreeGamePayoff.html.
Text
Wolfram Research (2025), TreeGamePayoff, Wolfram Language function, https://reference.wolfram.com/language/ref/TreeGamePayoff.html.
Wolfram Research (2025), TreeGamePayoff, Wolfram Language function, https://reference.wolfram.com/language/ref/TreeGamePayoff.html.
CMS
Wolfram Language. 2025. "TreeGamePayoff." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TreeGamePayoff.html.
Wolfram Language. 2025. "TreeGamePayoff." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TreeGamePayoff.html.
APA
Wolfram Language. (2025). TreeGamePayoff. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TreeGamePayoff.html
Wolfram Language. (2025). TreeGamePayoff. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TreeGamePayoff.html
BibTeX
@misc{reference.wolfram_2025_treegamepayoff, author="Wolfram Research", title="{TreeGamePayoff}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/TreeGamePayoff.html}", note=[Accessed: 16-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_treegamepayoff, organization={Wolfram Research}, title={TreeGamePayoff}, year={2025}, url={https://reference.wolfram.com/language/ref/TreeGamePayoff.html}, note=[Accessed: 16-April-2025
]}