I cant solve this, what is the closest to 10

Joined
Aug 16, 2023
Messages
1
Reaction score
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)]);
 
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-
 


Write your reply...

Members online

No members online now.

Forum statistics

Threads
2,530
Messages
9,859
Members
696
Latest member
fairdistribution
Back
Top