Skip to content

Commit fa527fa

Browse files
authoredMar 16, 2023
Add files via upload
1 parent 462c6e0 commit fa527fa

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
 

‎Nash_Equilibrium_Example_Game.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#num = 1400
2+
import matplotlib.pyplot as plt
3+
4+
nums = []
5+
nash_eq = []
6+
7+
for num in range(100, 500, 13): # Try playing around with changing these initial, final points, and the step gap
8+
9+
print("The initial number is:", num)
10+
nums.append(num)
11+
12+
while num >= 1:
13+
14+
num *= 2
15+
num /= 3
16+
17+
nash_eq.append(num)
18+
print("The Nash Equilibrium floating value is:", num)
19+
print()
20+
21+
plt.figure(figsize=(50,50))
22+
plt.plot(nums, nash_eq)
23+
plt.plot(nums, nash_eq, 'ro', markersize=4.7)
24+
plt.title('Nash Equilibrium final floating point value for different initial seed values')
25+
plt.show()
26+
27+
print("The final floating point value interestingly seems to be always greater than 0.5 (closer to 1) ...")

0 commit comments

Comments
 (0)