You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print("The maximum number of totally mixed Nash equilibria for a " | toString(d) |
366
+
" game is " | toString(mv));
367
+
mv
368
+
)
369
+
370
+
beginDocumentation()
371
+
372
+
doc ///
373
+
Node
374
+
Key
375
+
GameTheory
376
+
Headline
377
+
a Package
378
+
Description
379
+
Text
380
+
Computations in game theory.
381
+
Caveat
382
+
Nothing here yet.
383
+
Subnodes
384
+
"Ideals of Nash equilibria"
385
+
Node
386
+
Key
387
+
"Ideals of Nash equilibria"
388
+
Headline
389
+
computing the idealof a totally mixed Nash equilibria
390
+
Description
391
+
Text
392
+
This package provides methodsfor constructing the mixed probability polynomial rings and computing the Nash equilibrium polynomials and ideals, as well as the maxnumberof isolated totally mixed Nash Equilibra via polyhedral methods. It depends on the Polyhedrapackage. An introduction together with the relevant definitions is given in Chapter 6, Sturmfels, Bernd, @EM"Solving Systems of Polynomial Equations"@. American Mathematical Society, 2002. ISBN 978-0-8218-3251-6.
393
+
Text
394
+
This package uses the following functions in the @TOPolyhedra@ package:
395
+
Text
396
+
@UL {
397
+
{TO convexHull},
398
+
{TOdirectProduct},
399
+
{TO mixedVolume},
400
+
{TO simplex},
401
+
}@
402
+
Subnodes
403
+
nashEquilibriumRing
404
+
nashEquilibriumIdeal
405
+
maxNumberEquilibria
406
+
Node
407
+
Key
408
+
(nashEquilibriumRing, List)
409
+
nashEquilibriumRing
410
+
Headline
411
+
make the Nash Equilibrium ring
412
+
Usage
413
+
nashEquilibriumRing L
414
+
Inputs
415
+
L:List
416
+
a listof n-@TO Tensor@s with uniform dimensions
417
+
Outputs
418
+
:Ring
419
+
a polynomial ring generated from the mixed probabilities
420
+
Description
421
+
Text
422
+
An $n$-player game consists of players labeled with $0,1,\cdots, n-1$. The $i$-th player can choose from $d_i$ pure strategies. Let $p_{i,j}$ be the probablility of the $i$-th player choosing the $j$-the strategy, where $j=0,\cdots, d_j-1$. The idealof the totally mixed Nash equilibria of the game is defined in the polynomial ring over a field $k$ with generators $\{p_{i,j}:0\leq i\leq n-1, 0\leq j\leq d_j-1\}$.
423
+
424
+
This method computes this ring over $k=\mathbb{Q}$ from a listof tensors representing the payoff matrices ofall the $n$ players. The ringgenerators are ordered lexicographically.
425
+
Example
426
+
tensors = apply(3, i -> randomTensor {2,4,3})
427
+
R = nashEquilibriumRing tensors
428
+
baseRing R
429
+
gens R
430
+
Node
431
+
Key
432
+
(nashEquilibriumIdeal, Ring, List)
433
+
nashEquilibriumIdeal
434
+
Headline
435
+
make the Nash Equilibrium ideal
436
+
Usage
437
+
nashEquilibriumIdeal(R, L)
438
+
Inputs
439
+
R:Ring
440
+
the Nash Equilibrium ring. Typically obtained via @TO nashEquilibriumRing@
441
+
L:List
442
+
a listof payoff tensors
443
+
Outputs
444
+
:Ideal
445
+
An idealin the Nash Equilibrium ring R generated by the Nash equilibrium polynomials, along with the linear relationsof those probabilities variables, that the probabilities of each players sumto1
446
+
Description
447
+
Text
448
+
For an $n$-player game, the totally mixed Nash equilibria are the zero loci in the interior of the polytope of a system of polynomials in the variables $\{p_{i,j}:0\leq i\leq n-1, 0\leq j\leq d_j-1\}$. The coefficientsof these polynomials are differences of the entriesof the payoff matrices. From an algebraic-geometric point of view, these polynomials, together with the linear constraints that $\sum_j p_{i,j}=1$ for each $i$, generate an idealin the polynomial ring computed by @TO nashEquilibriumRing@.
449
+
450
+
This method computes this Nash equilibrium ideal by generating the polynomials from the payoff matrices first, and appending the linear relations that the sumof probabilities for each player is one.
451
+
Example
452
+
tensors = apply(3, i -> randomTensor {2,2,2})
453
+
R = nashEquilibriumRing tensors
454
+
gens R
455
+
I = nashEquilibriumIdeal(R, tensors)
456
+
Text
457
+
Here the embient ring $R$ is explicitly computed before finding the ideal $I$. Alternatively, one can assign both the ringand the idealto variables in the same line:
compute the maximum numberof totally mixed Nash equilibria
467
+
Usage
468
+
maxNumberEquilibria L
469
+
Inputs
470
+
L:List
471
+
a listof integers representing the dimensions of the game
472
+
Outputs
473
+
:ZZ
474
+
an integer value, the mixed volume, representing the maximum numberof totally mixed Nash equilibria
475
+
Description
476
+
Text
477
+
For an $n$-player game where the $i$-th player has $d_i$ pure strategies, the maximum numberof isolated totally mixed Nash equilibria is given by the mixed volume of the following listof polytopes:
This function first generates a tuple of delta polytopes from d, computes their mixed volume, prints a summary message, and returns the mixed volume. The mixed volume is computed via the function @TO mixedVolume@ in the @TO polyhedra@ package. This function currently runs very slow for higher dimension and requires improvement.
486
+
Example
487
+
d = {2,2,2}
488
+
mv = maxNumberEquilibria d
489
+
Text
490
+
Alternatively, if you have a tensor $T$, you can compute its maximum number as follows:
491
+
Example
492
+
T = randomTensor {2,2,2}
493
+
mv2 = maxNumberEquilibria format T
494
+
Node
495
+
Key
496
+
Tensor
497
+
Headline
498
+
representing the payoff matrices
499
+
///
500
+
501
+
TEST ///
502
+
-- Test nashEquilibriumRing with a list of tensors
503
+
tensorList = apply(3, i -> randomTensor {2,2,2})
504
+
R5 = nashEquilibriumRing tensorList
505
+
assert(numgens R5 > 0)
506
+
507
+
-- Test nashEquilibriumIdeal construction
508
+
I = nashEquilibriumIdeal(R5, tensorList)
509
+
assert(isIdeal I)
510
+
511
+
-- Test maxNumberEquilibria (prints and returns the mixed volume)
512
+
mv = maxNumberEquilibria {2,2,2}
513
+
assert(mv == 2)
514
+
515
+
-- Test maxNumberEquilibria using a tensor's format
0 commit comments