All problems

Absolute Difference in Conversion Rate

easyPythonA/B Testing

The finance director at Marlow & Finch does not want the headline lift. She wants the plain gap: out of every 100 people who reach checkout, how many more of them place an order on the new page than on the old one? That is the absolute difference between the two conversion rates, and it is measured in percentage points, not in percent.

That distinction is the single most common muddle in A/B testing, so here it is in ordinary words. Percent describes one rate held against the other, so it depends on how big the starting rate was. Percentage points describe the gap on the rates' own scale, ignoring where either rate started. The very same result can be told both ways and sound dramatic one way and modest the other.

The conventions:

  • Direction is Variant B against Variant A, so B doing better gives a positive answer and B doing worse gives a negative one.
  • The answer is in percentage points, not a proportion: a gap of one visitor in every hundred is 1.0, not 0.01.
  • Round once, at the end, to 2 decimals.

Task: Print the absolute difference between the two conversion rates, in percentage points, rounded to 2 decimals.

Input

The first line holds Variant A's conversion rate as a proportion between 0 and 1. The second line holds Variant B's, in the same form.

Output

One line holding the gap in percentage points, rounded to 2 decimals and printed the way Python prints a float — 1.5, never 1.50.

Example:

Input:
0.05
0.065

Output:
1.5

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…