I cant solve this, what is the closest to 10

Discussion in 'Probability and Statistics' started by whiteshowz66, Aug 17, 2023.

  1. whiteshowz66

    whiteshowz66

    Joined:
    Aug 17, 2023
    Messages:
    1
    Likes Received:
    0
    Constraints:

    1. x1 + x2 + x5 + x10 + x12 + x13 + x14 = 10 (Total bet is 10€)
    2. x1 >= x2 + x5 + x10 + x12 + x13 + x14 (1 covers the potential loss from other numbers)
    3. x2 >= x1 + x5 + x10 + x12 + x13 + x14 (2 covers the potential loss from other numbers)
    4. x5 >= x1 + x2 + x10 + x12 + x13 + x14 (5 covers the potential loss from other numbers)
    5. x10 >= x1 + x2 + x5 + x12 + x13 + x14 (10 covers the potential loss from other numbers)
    6. x12 >= x1 + x2 + x5 + x10 + x13 + x14 (12 covers the potential loss from other numbers)
    7. x13 >= x1 + x2 + x5 + x10 + x12 + x14 (13 covers the potential loss from other numbers)
    8. x14 >= x1 + x2 + x5 + x10 + x12 + x13 (14 covers the potential loss from other numbers)
    9. All x variables are non-negative


    % Define the problem parameters
    payouts = [1, 2, 5, 10, 11, 12, 13, 14];
    probabilities = [21/54, 13/54, 7/54, 4/54, 4/54, 2/54, 2/54, 1/54];
    target_budget = 10;
    num_numbers = length(payouts);

    % Define the optimization problem
    f = -payouts;
    Aeq = ones(1, num_numbers);
    beq = target_budget;

    % Additional inequality constraints for covering potential losses
    A = -eye(num_numbers);
    b = zeros(num_numbers, 1);

    % Upper and lower bounds for bet amounts
    lb = zeros(num_numbers, 1);
    ub = target_budget * ones(num_numbers, 1);

    % Solve the optimization problem
    options = optimoptions('linprog', 'Display', 'off');
    x = linprog(f, A, b, Aeq, beq, lb, ub, [], options);

    % Display the results
    disp('Bet distribution:');
    disp(x);
    disp(['Total payout: ', num2str(-f * x)]);
    disp(['Total bet: ', num2str(target_budget)]);
     
    whiteshowz66, Aug 17, 2023
    #1
  2. whiteshowz66

    HallsofIvy

    Joined:
    Nov 6, 2021
    Messages:
    160
    Likes Received:
    78
    You have 7 numbers that add to 10.
    The first condition, that [math]x_1\ge x_2+ x_5+ x_{10}+ x_{12}+ x_{13}+ x_{14}[/math], is equivalent to [math]x_X-
     
    HallsofIvy, Sep 10, 2023
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.
Loading...