I want to arbitrage the 2024 election prediction market. There are 2 candidates: Kamala and Trump.
There are 2 markets: Election outcome and Popular vote winner.
Write a program in a language most suitable for this, to find arbitrage opportunities, given the current prices of Yes and No shares for each outcome. 

I got this code, but it always outputs a [0, 0, 0, 0, 0, 0, 0, 0] vector:

import itertools

# Define the markets and outcomes
markets = ['Election Outcome', 'Popular Vote Winner']
outcomes = ['Yes', 'No']

# Example current prices for Yes and No shares in each market
# These can be updated with real-time data
current_prices = {
    'Election Outcome': {'Yes': 0.6, 'No': 0.5},       # Kamala wins: $0.6, Trump wins: $0.5
    'Popular Vote Winner': {'Yes': 0.55, 'No': 0.65},  # Kamala popular: $0.55, Trump popular: $0.65
}

# Define all possible election outcomes
# Each outcome is a tuple: (Election Outcome, Popular Vote Winner)
all_possible_outcomes = list(itertools.product(outcomes, repeat=2))

# Function to check arbitrage
def find_arbitrage(current_prices, all_possible_outcomes):
    # We'll use linear programming to solve for arbitrage
    # Variables: number of Yes and No shares to buy/sell in each market
    # Constraints:
    #   For each possible outcome, the payoff >= 0
    #   Cost <= 0
    # Objective: maximize profit
    
    from scipy.optimize import linprog
    import numpy as np

    # Decision variables:
    # x1: Buy Yes shares in Election Outcome
    # x2: Sell Yes shares in Election Outcome
    # x3: Buy No shares in Election Outcome
    # x4: Sell No shares in Election Outcome
    # x5: Buy Yes shares in Popular Vote Winner
    # x6: Sell Yes shares in Popular Vote Winner
    # x7: Buy No shares in Popular Vote Winner
    # x8: Sell No shares in Popular Vote Winner

    # For simplicity, we define variables as buys positive and sells negative
    # So variables: x = [Buy_EO_Yes, Buy_EO_No, Buy_PV_Yes, Buy_PV_No]
    # Negative values imply selling

    # Cost equation: sum (Buy * price) - sum (Sell * price) <= 0
    c = [current_prices['Election Outcome']['Yes'],
         current_prices['Election Outcome']['No'],
         current_prices['Popular Vote Winner']['Yes'],
         current_prices['Popular Vote Winner']['No']]

    # Constraints for each outcome: payoff >= 0
    # Payoff calculations based on outcome
    A = []
    b = []

    for outcome in all_possible_outcomes:
        eo, pv = outcome
        payoff = []
        # Election Outcome payoff
        if eo == 'Yes':
            payoff_eo = 1
        else:
            payoff_eo = 1
        # Popular Vote Winner payoff
        if pv == 'Yes':
            payoff_pv = 1
        else:
            payoff_pv = 1
        # The total payoff for each outcome is:
        # (x1 * eo_yes_payoff) + (x2 * eo_no_payoff) + ...
        # But since we're using buys as positive and sells as negative:
        # For each outcome, calculate the payoff based on the investment

        # For this simplified case, let's assume:
        # If you buy a Yes share and outcome is Yes, you get 1
        # If you buy a Yes share and outcome is No, you get 0
        # Similarly for No shares

        # Therefore, payoff for this outcome:
        # x1 (Buy EO Yes) * payout if Yes (1) + 
        # x2 (Buy EO No) * payout if No (1) +
        # x3 (Buy PV Yes) * payout if Yes (1) + 
        # x4 (Buy PV No) * payout if No (1)
        # Similar for sells: x2 and x4 would be negative if selling

        # To represent buys and sells in linprog, we split variables into buys and sells
        # To avoid complexity, let's redefine variables as:
        # x = [Buy_EO_Yes, Sell_EO_Yes, Buy_EO_No, Sell_EO_No,
        #      Buy_PV_Yes, Sell_PV_Yes, Buy_PV_No, Sell_PV_No]
        
    # Redefine the problem with more detailed variables
    # x1: Buy EO Yes
    # x2: Sell EO Yes
    # x3: Buy EO No
    # x4: Sell EO No
    # x5: Buy PV Yes
    # x6: Sell PV Yes
    # x7: Buy PV No
    # x8: Sell PV No
    c = [
        current_prices['Election Outcome']['Yes'],   # x1
        -current_prices['Election Outcome']['Yes'],  # x2
        current_prices['Election Outcome']['No'],    # x3
        -current_prices['Election Outcome']['No'],   # x4
        current_prices['Popular Vote Winner']['Yes'],# x5
        -current_prices['Popular Vote Winner']['Yes'],# x6
        current_prices['Popular Vote Winner']['No'], # x7
        -current_prices['Popular Vote Winner']['No']  # x8
    ]

    A = []
    b = []

    for outcome in all_possible_outcomes:
        eo, pv = outcome
        # Payoff for Election Outcome
        if eo == 'Yes':
            payoff_eo_yes = 1
            payoff_eo_no = 0
        else:
            payoff_eo_yes = 0
            payoff_eo_no = 1
        # Payoff for Popular Vote Winner
        if pv == 'Yes':
            payoff_pv_yes = 1
            payoff_pv_no = 0
        else:
            payoff_pv_yes = 0
            payoff_pv_no = 1
        # Total payoff:
        # x1 * payoff_eo_yes - x2 * payoff_eo_yes +
        # x3 * payoff_eo_no - x4 * payoff_eo_no +
        # x5 * payoff_pv_yes - x6 * payoff_pv_yes +
        # x7 * payoff_pv_no - x8 * payoff_pv_no >= 0
        row = [
            payoff_eo_yes,  # x1
            -payoff_eo_yes, # x2
            payoff_eo_no,   # x3
            -payoff_eo_no,  # x4
            payoff_pv_yes,  # x5
            -payoff_pv_yes, # x6
            payoff_pv_no,   # x7
            -payoff_pv_no   # x8
        ]
        A.append([-val for val in row])  # Convert to <= by multiplying by -1
        b.append(0)

    # Cost constraint: x1 * price + x3 * price + x5 * price + x7 * price
    # -x2 * price -x4 * price -x6 * price -x8 * price <= 0
    # Which is equivalent to c^T x <= 0
    # Already handled in c by setting up the objective

    # We want to maximize 0, subject to A x <= b and c x <= 0
    # In linprog, we minimize, so set objective to zero
    res = linprog(c=[0]*8, A_ub=A, b_ub=b, A_eq=None, b_eq=None, bounds=(None, None), method='highs')

    if res.success:
        # Check if there's a non-zero solution where c^T x <= 0 and payoffs >=0
        # This requires more detailed analysis; linprog alone may not suffice
        # Instead, we can check for feasibility
        # Alternatively, use dual variables or other methods
        print("Arbitrage opportunity detected.")
        print("Portfolio:", res.x)
    else:
        print("No arbitrage opportunity detected.")

# Example usage
find_arbitrage(current_prices, all_possible_outcomes)