Algorithm Search⌘K

Algorithmcore

Adjusted winner procedure

Also called Brams-Taylor adjusted winner.

Two agents spread 100 points over divisible goods. Each good goes to the higher bidder, then goods move by point ratio until both have equal points.

Time
Θ(m log m) worst
Space
Θ(m) extra
Where
m = the number of goods
Properties
deterministicofflineiterative

The adjusted winner procedure divides a set of divisible goods between two agents. Each agent spreads 100 points over the goods to show how much it values them. Each good first goes to the agent that gives it more points. Then the agent with more points, the winner, gives goods to the other agent, in the order of the ratio of their points, until both agents have the same number of points; at most one good is split. The result is envy-free, equitable (both agents get the same number of points) and Pareto optimal, if the agents report their true points. Brams and Taylor designed it for disputes such as divorce settlements.

In plain words

Two people must share some things, such as a house, a car and savings. Each person gets 100 points and puts them on the things, more points on the things that matter more to that person. First each thing goes to the person who put more points on it.

Usually one person now has more points. That person must give something back. It gives first the thing where its own points are closest to the points of the other person, because that costs it the least for the most help to the other. It gives things until the points are equal, and it may give only a part of the last thing. In the end both have the same points, neither prefers the share of the other, and no other division is better for both.

The problem

There are mm divisible goods and two agents, AA and BB. Agent AA gives good gg the points pA(g)≥0p_A(g) \ge 0, with ∑gpA(g)=100\sum_g p_A(g) = 100, and likewise pBp_B. Valuations are additive and linear in shares: if AA gets the share sg∈[0,1]s_g \in [0, 1] of each good gg and BB gets 1−sg1 - s_g, then

UA=∑gpA(g) sg,UB=∑gpB(g) (1−sg).U_A = \sum_g p_A(g)\, s_g, \qquad U_B = \sum_g p_B(g)\, (1 - s_g).

The goal is a share vector ss that is equitable (UA=UBU_A = U_B), envy-free (UA≥100−UAU_A \ge 100 - U_A and UB≥100−UBU_B \ge 100 - U_B, since the share of the other agent is worth the rest of the 100 points), and Pareto optimal (no other s′s' gives both agents at least as much and one agent more), with as few split goods as possible.

The algorithm

  1. ADJUSTED-WINNER(p_A, p_B) ▷ points on m goods, each list sums to 100
  2. 1for each good g: give g to A if p_A(g) ≥ p_B(g), else to B
  3. 2T_A, T_B ← the points of A and of B for their own goods
  4. 3if T_A = T_B then return the shares
  5. 4W ← the agent with more points; L ← the other agent
  6. 5G ← the goods of W with p_W(g) > 0, sorted by p_W(g)/p_L(g) increasing (p_L(g) = 0 counts as ∞)
  7. 6for each good g of G, in order do
  8. 7if T_W − p_W(g) ≥ T_L + p_L(g) then move all of g to L
  9. 8else move the share α = (T_W − T_L)/(p_W(g) + p_L(g)) of g to L ▷ now T_W = T_L; stop
  10. 9return the shares

Line L1 gives ties to AA; any fixed rule works. Each good of WW has pW(g)≥pL(g)p_W(g) \ge p_L(g), so every ratio in line L5 is at least 1. Moving a good with a small ratio costs WW few points for each point that LL gains. Line L7 moves a whole good when WW still has at least as many points after the move, and updates TWT_W and TLT_L. Line L8 solves TW−αpW(g)=TL+αpL(g)T_W - \alpha p_W(g) = T_L + \alpha p_L(g) for α\alpha.

Example

Two agents split a house, a pension, a car and a boat.

good pAp_A pBp_B after L1 ratio pA/pBp_A/p_B
house 50 40 A 1.25
pension 20 30 B
car 15 10 A 1.5
boat 15 20 B

After line L1, TA=50+15=65T_A = 50 + 15 = 65 and TB=30+20=50T_B = 30 + 20 = 50, so W=AW = A. The goods of AA in the order of line L5 are the house (1.25) and the car (1.5). For the house, 65−50=15<50+40=9065 - 50 = 15 < 50 + 40 = 90, so line L8 moves the share

α=65−5050+40=16\alpha = \frac{65 - 50}{50 + 40} = \frac{1}{6}

of the house to BB. Agent AA keeps 5/65/6 of the house and the car, with 50⋅5/6+15=170/3≈56.6750 \cdot 5/6 + 15 = 170/3 \approx 56.67 points. Agent BB gets 1/61/6 of the house, the pension and the boat, with 40/6+30+20=170/340/6 + 30 + 20 = 170/3 points. Both get more than 50, so neither envies the other.

If instead pA=(40,30,20,10)p_A = (40, 30, 20, 10) and pB=(10,20,30,40)p_B = (10, 20, 30, 40), line L1 gives the first two goods to AA and the last two to BB, with 70 points each, and line L3 returns at once.

Correctness

Equitable. Each whole move of line L7 keeps TW≥TLT_W \ge T_L, and line L8 makes them equal. If every good of GG moved whole, WW would hold only goods with pW(g)=0p_W(g) = 0, so TW=0≤TLT_W = 0 \le T_L, and the last move would have been a move of line L8. So the loop ends with TW=TLT_W = T_L.

Pareto optimal. Let r≥1r \ge 1 be the ratio of the last good that moved (or r=1r = 1 if none moved). At the end, WW holds a share only of goods with ratio pW/pL≥rp_W/p_L \ge r, and LL holds a share only of goods with ratio at most rr. Such a division maximizes UW+r ULU_W + r\, U_L over all share vectors, because each good goes to the agent with the larger weighted points. A division that is better for one agent and not worse for the other would give a larger value of UW+r ULU_W + r\, U_L, since r>0r > 0. So none exists.

Envy-free. Let TT be the common number of points. If T<50T < 50, each agent values the share of the other at 100−T>T100 - T > T, so swapping the shares makes both agents better off, which contradicts Pareto optimality. So T≥50T \ge 50, and each agent values its share at least as much as the other share. The full proof is in proofs/correctness.md.

Proof: Adjusted winner is equitable, Pareto optimal and envy-free, with at most one split goodfull

Setting. There are mm goods and two agents. The points pA(g),pB(g)p_A(g), p_B(g) are nonnegative, and ∑gpA(g)=∑gpB(g)=100\sum_g p_A(g) = \sum_g p_B(g) = 100. A share vector gives agent AA the share sg∈[0,1]s_g \in [0, 1] of good gg and agent BB the share 1−sg1 - s_g. We write UA(s)=∑gpA(g)sgU_A(s) = \sum_g p_A(g) s_g and UB(s)=∑gpB(g)(1−sg)U_B(s) = \sum_g p_B(g)(1 - s_g), so UA(s)+UA(1−s)=100U_A(s) + U_A(1 - s) = 100, where 1−s1 - s is the share of BB. We refer to the lines L1 to L9 of the page. After line L4, WW is the agent with more points and LL the other, and xgx_g is the share of WW in good gg. The running totals TW,TLT_W, T_L always equal the points of WW and LL for their current shares.

Lemma 1 (the goods of each agent after line L1). Every good gg held by WW after line L1 has pW(g)≥pL(g)p_W(g) \ge p_L(g), and every good held by LL has pL(g)≥pW(g)p_L(g) \ge p_W(g). A good held by WW with pW(g)=0p_W(g) = 0 has pL(g)=0p_L(g) = 0.

Proof. Line L1 gives gg to the agent with more points on it, and ties to AA. So the holder has at least as many points as the other agent. If the holder has 0 points, so does the other agent. □\square

So the goods left out of GG in line L5 are worth 0 to both agents, and every ratio pW(g)/pL(g)p_W(g)/p_L(g) of a good of GG is at least 1.

Lemma 2 (the loop ends with equal points at a good with pL>0p_L > 0). Suppose line L3 does not return, so TW>TLT_W > T_L when the loop of line L6 starts. Then the loop reaches a good gg with pL(g)>0p_L(g) > 0 at which either line L7 makes TW=TLT_W = T_L or line L8 runs, and in both cases TW=TLT_W = T_L after that good, and the loop stops. Before that good, TW>TLT_W > T_L holds after each move.

Proof. A move of line L7 is made only if TW−pW(g)≥TL+pL(g)T_W - p_W(g) \ge T_L + p_L(g), so it keeps TW≥TLT_W \ge T_L; if it gives equality, the loop stops. If line L7 does not apply, then TW−TL<pW(g)+pL(g)T_W - T_L < p_W(g) + p_L(g), and since TW>TLT_W > T_L, the share α=(TW−TL)/(pW(g)+pL(g))\alpha = (T_W - T_L)/(p_W(g) + p_L(g)) lies strictly between 0 and 1. After the move, TW−αpW(g)=TL+αpL(g)T_W - \alpha p_W(g) = T_L + \alpha p_L(g), so the totals are equal.

Suppose that the loop moves every good of GG with pL(g)>0p_L(g) > 0 whole and still has TW>TLT_W > T_L. By Lemma 1, LL now holds all goods with pL(g)>0p_L(g) > 0, so TL=100≥TWT_L = 100 \ge T_W, a contradiction. So the loop stops at the latest at the last good of GG with pL(g)>0p_L(g) > 0. The goods with pL(g)=0p_L(g) = 0 come after all others in the order of line L5, so the loop stops before it reaches them. □\square

Theorem 1 (equitable, with at most one split good). The output has UA=UBU_A = U_B, and at most one good has a share strictly between 0 and 1.

Proof. If line L3 returns, the totals are equal and no good is split. Otherwise Lemma 2 gives TW=TLT_W = T_L at the end. Line L1 gives whole goods, line L7 moves whole goods, and line L8 runs at most once, because the loop stops after it. So at most one good is split. □\square

Theorem 2 (Pareto optimal). No share vector s′s' has UA(s′)≥UA(s)U_A(s') \ge U_A(s) and UB(s′)≥UB(s)U_B(s') \ge U_B(s) with one of the two strict, where ss is the output.

Proof. Let r=1r = 1 if line L3 returns. Otherwise let r=pW(g∗)/pL(g∗)r = p_W(g^*)/p_L(g^*) for the good g∗g^* at which the loop stops; by Lemma 2, pL(g∗)>0p_L(g^*) > 0, so rr is finite, and r≥1r \ge 1 by Lemma 1. (If line L3 returns, take W=AW = A and L=BL = B.) We claim that at the end

  • every good with xg>0x_g > 0 has pW(g)≥r pL(g)p_W(g) \ge r\, p_L(g), and
  • every good with xg<1x_g < 1 has pW(g)≤r pL(g)p_W(g) \le r\, p_L(g).

A good with xg>0x_g > 0 is a good of WW after line L1 that was not moved whole. It is either g∗g^*, with pW=rpLp_W = r p_L; or a good of GG after g∗g^* in the order, with ratio at least rr; or a good outside GG, with pW=pL=0p_W = p_L = 0. A good with xg<1x_g < 1 is either a good of LL after line L1, which has pW(g)≤pL(g)≤r pL(g)p_W(g) \le p_L(g) \le r\, p_L(g) by Lemma 1 and r≥1r \ge 1; or a good of GG that was moved in whole or in part, which comes no later than g∗g^* and has ratio at most rr. If line L3 returns, the same holds with r=1r = 1 by Lemma 1 alone.

Now let Φ(y)=UW(y)+r UL(y)=∑g(pW(g) yg+r pL(g)(1−yg))\Phi(y) = U_W(y) + r\, U_L(y) = \sum_g \big(p_W(g)\, y_g + r\, p_L(g)(1 - y_g)\big), where ygy_g is the share of WW. Each term is linear in ygy_g, with slope pW(g)−r pL(g)p_W(g) - r\, p_L(g). By the claim, xg=1x_g = 1 when the slope is positive, unless gg is split, and the split good g∗g^* has slope 0; and xg=0x_g = 0 when the slope is negative. So xx maximizes every term and Φ(x)≥Φ(y)\Phi(x) \ge \Phi(y) for every yy. If yy were at least as good as xx for both agents and better for one, then Φ(y)>Φ(x)\Phi(y) > \Phi(x) because r>0r > 0, a contradiction. □\square

Theorem 3 (envy-free). Each agent values its own share at least as much as the share of the other agent.

Proof. Let T=UA(s)=UB(s)T = U_A(s) = U_B(s) by Theorem 1. Agent AA values the share of BB at 100−T100 - T, and agent BB values the share of AA at 100−T100 - T. If T<50T < 50, the swapped vector s′=1−ss' = 1 - s gives each agent 100−T>T100 - T > T, which contradicts Theorem 2. So T≥50≥100−TT \ge 50 \ge 100 - T. □\square

Corollary (the value is unique). All equitable Pareto optimal share vectors give the same number of points TT. If two of them gave T1<T2T_1 < T_2, the second would give both agents more than the first, so the first would not be Pareto optimal. Hence the output of the procedure is the equitable point of the Pareto frontier.

Running time. Lines L1 to L4 take O(m)O(m) operations, the sort of line L5 takes O(mlog⁡m)O(m \log m), and the loop takes O(m)O(m), because each good is visited at most once. ■\blacksquare

Complexity

Lines L1 and L2 take O(m)O(m) time. The sort of line L5 takes O(mlog⁡m)O(m \log m), and the loop of lines L6 to L8 takes O(m)O(m). So the time is Θ(mlog⁡m)\Theta(m \log m) in the worst case, and O(m)O(m) if the goods are already sorted by ratio. Extra space is O(m)O(m).

Properties

  • Equitable, envy-free and Pareto optimal for the reported points, as proved above. For two agents, all equitable Pareto optimal divisions give the same number of points, so no other rule with these two goals gives either agent more.
  • At most one split good. Only line L8 splits a good, and it runs once.
  • At least 50 points each. Both agents get the same T≥50T \ge 50, often more.
  • Not strategyproof. An agent that knows the points of the other can gain by false points, for example by putting points just below the bids of the other on goods that it will lose anyway. Then its reported points on the goods that it wins are lower, and the step that makes the points equal gives it more of these goods. An agent that reports its true points is still sure of at least 50 true points, whatever the other reports, because the result is envy-free for the reported points.
  • Divisible goods. The guarantees need the split of one good. With indivisible goods, a split can be replaced by joint ownership, a sale or a lottery, or by the weaker goals of indivisible goods allocation.

Variants and improvements

  • More agents. The procedure works for two agents only. With three or more agents, envy-free, equitable and Pareto optimal divisions of goods with linear values need not exist together, and other rules are used, such as the competitive equilibrium from equal incomes or maximum Nash welfare.
  • Proportional allocation of points. Brams and Taylor also describe a simpler point rule that gives each good to the two agents in proportion to their points. It is equitable but in general not Pareto optimal.
  • Divide and choose. For one heterogeneous good, such as a cake, divide and choose is the classic two-agent rule. It is envy-free but not equitable.
  • A link to knapsack. The order of line L5 is the order of a greedy rule for the fractional knapsack problem: the winner gives up the goods with the lowest value per point gained by the other, and only the last item is split.

When to use it

Use adjusted winner for two parties who must share several divisible goods or issues and can state their values in points, as in a divorce, a business breakup or a negotiation on several issues. It suits cases where the parties want equal satisfaction and no waste. It needs honest points to keep its guarantees, so it fits best when parties cannot learn much about the points of the other, or when a mediator checks the reports.

Pitfalls

  • Points that do not sum to 100. The test for envy uses the totals. If one agent spreads 120 points, its share must be compared with the rest of its own total.
  • The wrong order. Moving goods in an order other than increasing pW/pLp_W/p_L still gives equal points, but the result need not be Pareto optimal: both agents could get more by moving a different good.
  • Moving goods with pW=0p_W = 0. They give LL points at no cost to WW, but WW holds such a good only if pL=0p_L = 0 too (by line L1), so they do not matter. Code that leaves them out of line L5 avoids a division by zero in the order.
  • Floating point. The share α\alpha and the test of line L7 should use exact rationals; with floats the totals may differ by a rounding error, and the test for equality fails.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

adjusted_winner.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/adjusted-winner/. The authors are listed in prov/8XAEP1.jsonl.

from fractions import Fraction
from typing import Sequence

TOTAL = Fraction(100)


def adjusted_winner(pa: Sequence, pb: Sequence) -> list[Fraction]:
    """Brams and Taylor's adjusted winner for agents A and B.

    pa[g] and pb[g] are the nonnegative points of A and B on good g; each
    list sums to 100. Returns s, where s[g] is the share of good g that A
    gets and 1 - s[g] is the share of B. At most one s[g] is strictly
    between 0 and 1, and both agents get the same number of points.
    """
    p = [[Fraction(x) for x in pa], [Fraction(x) for x in pb]]
    m = len(p[0])
    if len(p[1]) != m or any(x < 0 for x in p[0] + p[1]):
        raise ValueError("two lists of the same length with nonnegative points")
    if sum(p[0]) != TOTAL or sum(p[1]) != TOTAL:
        raise ValueError("the points of each agent must sum to 100")
    s = [Fraction(1) if p[0][g] >= p[1][g] else Fraction(0) for g in range(m)]  # @line L1
    t = [sum(p[0][g] * s[g] for g in range(m)), sum(p[1][g] * (1 - s[g]) for g in range(m))]  # @line L2
    if t[0] == t[1]:  # @line L3
        return s
    w = 0 if t[0] > t[1] else 1  # @line L4
    lo = 1 - w

    def held_by_w(g: int) -> bool:
        return s[g] == 1 if w == 0 else s[g] == 0

    def ratio_key(g: int) -> tuple:
        # pW / pL in increasing order; pL = 0 means an infinite ratio
        if p[lo][g] == 0:
            return (1, Fraction(0), g)
        return (0, p[w][g] / p[lo][g], g)

    goods = sorted((g for g in range(m) if held_by_w(g) and p[w][g] > 0), key=ratio_key)  # @line L5
    for g in goods:  # @line L6
        if t[w] - p[w][g] >= t[lo] + p[lo][g]:  # @line L7
            share_to_lo = Fraction(1)
        else:
            share_to_lo = (t[w] - t[lo]) / (p[w][g] + p[lo][g])  # @line L8
        t[w] -= share_to_lo * p[w][g]
        t[lo] += share_to_lo * p[lo][g]
        s[g] = s[g] - share_to_lo if w == 0 else s[g] + share_to_lo
        if t[w] == t[lo]:
            break
    return s  # @line L9


def points(pa: Sequence, pb: Sequence, s: Sequence[Fraction]) -> tuple[Fraction, Fraction]:
    """The points of A and of B under the shares s."""
    ta = sum(Fraction(pa[g]) * s[g] for g in range(len(s)))
    tb = sum(Fraction(pb[g]) * (1 - s[g]) for g in range(len(s)))
    return ta, tb
test_adjusted_winner.py 126 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/adjusted-winner/. The authors are listed in prov/8XAEP1.jsonl.

import itertools
import random
from fractions import Fraction

import pytest

from adjusted_winner import adjusted_winner, points

F = Fraction


def random_points(rng: random.Random, m: int) -> list[int]:
    cuts = sorted(rng.randint(0, 100) for _ in range(m - 1))
    edges = [0] + cuts + [100]
    return [edges[g + 1] - edges[g] for g in range(m)]


def equitable_po_value(pa, pb) -> Fraction:
    """A second method: walk along the goods in decreasing order of pA/pB.

    A takes a prefix of this order and B the rest, with one good split. The
    points of A grow and the points of B fall along the walk, so the walk
    meets equality once. Every point of the walk is Pareto optimal, and two
    agents have only one equitable Pareto optimal value.
    """
    m = len(pa)
    order = sorted(range(m), key=lambda g: (pb[g] == 0, F(pa[g], pb[g]) if pb[g] else F(0)), reverse=True)
    for j, g in enumerate(order):
        ua = sum(F(pa[h]) for h in order[:j])
        ub = sum(F(pb[h]) for h in order[j + 1 :])
        # with a share f of good g for A: ua + f pa[g] = ub + (1 - f) pb[g]
        if pa[g] + pb[g] == 0:
            continue
        f = (ub + pb[g] - ua) / (pa[g] + pb[g])
        if 0 <= f <= 1:
            return ua + f * pa[g]
    raise AssertionError("no equitable point on the walk")


def dominated_on_grid(pa, pb, s, steps: int) -> bool:
    """Brute force: does a share vector on the grid Pareto dominate s?"""
    ta, tb = points(pa, pb, s)
    grid = [F(k, steps) for k in range(steps + 1)]
    for y in itertools.product(grid, repeat=len(pa)):
        ya, yb = points(pa, pb, list(y))
        if ya >= ta and yb >= tb and (ya > ta or yb > tb):
            return True
    return False


def check(pa, pb, s) -> None:
    m = len(pa)
    assert len(s) == m and all(0 <= x <= 1 for x in s)
    assert sum(1 for x in s if 0 < x < 1) <= 1  # at most one good is split
    ta, tb = points(pa, pb, s)
    assert ta == tb  # equitable
    # envy-free: each agent values its own share at least as much as the other share
    assert ta >= 100 - ta and tb >= 100 - tb
    # Pareto optimal: an exchange certificate. No good g held (in part) by A
    # and good h held (in part) by B have pA(g) pB(h) < pA(h) pB(g).
    for g in range(m):
        for h in range(m):
            if s[g] > 0 and s[h] < 1:
                assert F(pa[g]) * pb[h] >= F(pa[h]) * pb[g] or (pa[g] == 0 and pb[g] == 0)
    assert ta == equitable_po_value(pa, pb)


def test_example() -> None:
    pa, pb = [50, 20, 15, 15], [40, 30, 10, 20]
    s = adjusted_winner(pa, pb)
    assert s == [F(5, 6), 0, 1, 0]
    assert points(pa, pb, s) == (F(170, 3), F(170, 3))
    check(pa, pb, s)
    assert not dominated_on_grid(pa, pb, s, 6)


def test_no_transfer_needed() -> None:
    pa, pb = [40, 30, 20, 10], [10, 20, 30, 40]
    s = adjusted_winner(pa, pb)
    assert s == [1, 1, 0, 0] and points(pa, pb, s) == (70, 70)


def test_identical_points() -> None:
    pa = [25, 25, 50]
    s = adjusted_winner(pa, pa)
    assert points(pa, pa, s) == (50, 50)
    check(pa, pa, s)


def test_zero_points() -> None:
    pa, pb = [100, 0, 0], [0, 0, 100]
    s = adjusted_winner(pa, pb)
    assert points(pa, pb, s) == (100, 100)
    pa, pb = [0, 60, 40], [50, 50, 0]
    s = adjusted_winner(pa, pb)
    check(pa, pb, s)


def test_random_against_brute_force() -> None:
    rng = random.Random(77)
    for _ in range(40):
        m = rng.randint(1, 4)
        pa, pb = random_points(rng, m), random_points(rng, m)
        s = adjusted_winner(pa, pb)
        check(pa, pb, s)
        assert not dominated_on_grid(pa, pb, s, 4)


def test_random_more_goods() -> None:
    rng = random.Random(78)
    for _ in range(300):
        m = rng.randint(1, 7)
        pa, pb = random_points(rng, m), random_points(rng, m)
        check(pa, pb, adjusted_winner(pa, pb))


def test_bad_input() -> None:
    with pytest.raises(ValueError):
        adjusted_winner([50, 50], [100])
    with pytest.raises(ValueError):
        adjusted_winner([50, 40], [50, 50])
    with pytest.raises(ValueError):
        adjusted_winner([150, -50], [50, 50])

History

Steven Brams and Alan Taylor introduced adjusted winner in their 1996 book Fair Division, where Chapter 4 proves its properties and Chapter 5 applies it to disputes. They wrote about it for a general readership in The Win-Win Solution (1999). The procedure brings the goals of the cake cutting problem (envy-freeness, equitability and efficiency) to the division of several goods by points.

References

  1. Steven J. Brams and Alan D. Taylor, Fair Division, From Cake-Cutting to Dispute Resolution, Cambridge University Press, 1996, Chapter 4, Envy-freeness and equitability for n = 2 (the point-allocation procedures and adjusted winner), and Chapter 5, Applications of the point-allocation procedures

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • History with a source
  • at least three sources
  • a scene preset for the example