- Joined
- Aug 16, 2023
- Messages
- 1
- Reaction score
- 0
Constraints:
% 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)]);
- x1 + x2 + x5 + x10 + x12 + x13 + x14 = 10 (Total bet is 10€)
- x1 >= x2 + x5 + x10 + x12 + x13 + x14 (1 covers the potential loss from other numbers)
- x2 >= x1 + x5 + x10 + x12 + x13 + x14 (2 covers the potential loss from other numbers)
- x5 >= x1 + x2 + x10 + x12 + x13 + x14 (5 covers the potential loss from other numbers)
- x10 >= x1 + x2 + x5 + x12 + x13 + x14 (10 covers the potential loss from other numbers)
- x12 >= x1 + x2 + x5 + x10 + x13 + x14 (12 covers the potential loss from other numbers)
- x13 >= x1 + x2 + x5 + x10 + x12 + x14 (13 covers the potential loss from other numbers)
- x14 >= x1 + x2 + x5 + x10 + x12 + x13 (14 covers the potential loss from other numbers)
- 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)]);