∇ProvenDecisions
Ctrl K

Kelly criterion bet size: a convex optimization example, solved and checked

The Kelly criterion bet size is a classic convex optimization problem. Here it is solved by a real solver (CLARABEL) and checked: every constraint, and the optimality certificate. Change the numbers below and solve your own.

Answer. You asked for: optimal stake fraction f. The largest objective value is 0.0201355, at f = 0.200024. All 2 constraints are satisfied exactly. Optimal, numerically checked.

Solve your own version free, no account needed

The problem

A bet pays even money and wins with probability 0.6. What fraction of your bankroll should you stake each time to maximize long-run growth?

How the model was built

The objective as written from the problem, before the numbers are multiplied out:

The model

Each line has a plain-language note on the right.

make this as large as possible
fraction of bankroll staked on each bet (fraction) cannot be negative
fraction of bankroll staked on each bet (fraction) is at most 0.99

What is being decided

There is one decision variable.

VariableTypeMeaning
freal numberfraction of bankroll staked on each bet (fraction)

Goal and limits

Maximize the objective subject to 2 constraints, of which 2 are simple bounds on a single variable.

Problem type

Conic (convex), complexity level 4: convex nonlinear functions such as log, exp, square roots or powers. Solved with CLARABEL at the Medium solver tier.

The answer at a glance

The optimal value of each decision, as the solver returned it.

f0.200024

Which constraints hold the answer in place

No constraint is binding. Changing a binding constraint changes the answer; a slack one can move a little without effect.

#ConstraintValueLimitSlackBinding
1f >= 00.20002400.200024
2f <= 0.990.2000240.990.789976

Algebraic model (low level)

Decision variables, objective and every constraint written out; this is exactly what the solver receives.

Model code (cvxpy)

The same model in cvxpy, ready to run.

import cvxpy as cp

f = cp.Variable(name='f')  # fraction of bankroll staked on each bet (fraction)

objective = cp.Maximize(0.4*cp.log(1 - f) + 0.6*cp.log(f + 1))
constraints = [
    f >= 0,
    f <= 0.990000000000000,
]
problem = cp.Problem(objective, constraints)
problem.solve(solver='CLARABEL')
print(problem.status, problem.value)
print('f =', f.value)

Solve your own

This is the model as the app reads it. Change any number and solve it in the free box on the front page (no account needed).

maximize 0.6*log(1 + f) + 0.4*log(1 - f)
subject to
f >= 0
f <= 0.99
# f = fraction of bankroll staked on each bet (fraction)
# asked: optimal stake fraction f

Change the numbers and solve it

Checked: the app's answer matches the reference answer in our test set, which two solvers (CLARABEL, SCS) agree on. Built 2026-11-10.

Related examples

All 50 solved examples

Try ProvenDecisions free: type, photograph or say an optimization problem; every answer is checked by a solver.

What do you want to optimize?

Type the math, describe it in words, snap a photo or say it. ProvenDecisions builds the model, solves it, checks it and walks you through it.

One constraint per line, or separated by commas. Add integer: x, y or binary: z for whole-number decisions. LaTeX works too.

Try: