Learn R Programming

EcoVirtual (version 1.1)

extGame: Zero-sum game

Description

Simulates a zero-sum game between two competitors with a fixed amount of resource.

Usage

extGame(bet = 1, total = 100, tmax = 2)

Arguments

bet

bet size of each competitor on each time.

total

total amount of resource.

tmax

maximum game time.

Value

'extGame' returns a graphic with the amount of resource of each competitor on each time.

'extGame' also returns an invisible vector with the results of the loser on each time.

Details

A zero-sum game is a mathematical representation of a situation in which a participant's gain (or loss) of resource is exactly balanced by the losses (or gains) of the resource of the other participant(s). If the total gains of the participants are added up, and the total losses are subtracted, they will sum to zero.

References

http://en.wikipedia.org/wiki/Zero-sum_game

See Also

simHub, randWalk, http://ecovirtual.ib.usp.br

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
extGame(bet=1,total=20)
extGame(bet=1,total=100)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab