Given problem in the picture, you have a tree (2d array) of all possibilities. 1 = Tails 2 = Heads How would you go about analyzing this graph? Is there a way for me to programmatically create a dictionary that keeps track of the possible winning paths for each round (or row in this case), to see how many paths will lead to a win/draw for Alice and Bob. Or maybe there is a better way to analyzing it. (code below, **but it should not matter**. the **only important** thing is that it **returns the 2d array** in the picture). ```python import sys import pandas as pd import numpy as np from math import sqrt, floor # 1 = Tail # 2 = Head def fill_array(array): fill = [1, 2] rows, cols = array.shape mid_cols = cols//2 exp = 2 insert = fill index = int(mid_cols - len(fill)/2) for i in range(rows): # update row "i" from index with the length of insert array[i, index:index+len(insert)] = insert insert = fill*exp exp = exp*2 index = int(mid_cols - len(insert)/2) if index ") sys.exit(1) try: # Get the input from the command-line argument input_number = int(sys.argv[1]) except ValueError: print("Please provide a valid integer.") sys.exit(1) size = input_number cols = size**2 if size % 2 == 0 else size**2-1 assert cols % 2 == 0, "cols must be even" array_2d = np.full((size, cols), np.nan) # fill array array_2d = fill_array(array_2d) # draw array df = pd.DataFrame(array_2d) print(df) ```
Are you just simulating all possible games or what?