# Inequalities, intervals and formulas with cases

> <, ≤, ± and intervals, "if and only if", min and max, formulas with cases, fences, payback as the first month that clears a bar, and tiered rates with effective vs marginal.

- Course: [Math for Statistics and Unit Economics](https://productovi.com/courses/math-basics.md)
- Module: The language of formulas
- Lesson 8/36, ~34 min
- Source: https://productovi.com/courses/math-basics/inequalities-and-intervals

## Less than, at most, plus or minus

**Alex Tutor:** Still on Klasna's product team. The A/B test reports the school reads use more than the equals sign.

**Sofia:** Formulas so far were all "equals". But the A/B lessons are full of <, ≤ and ±. How strict are they?

**Alex Tutor:** Very strict, and the difference is one value. p < 0.05 excludes 0.05 itself; p ≤ 0.05 includes it. **≤** reads "at most", **≥** "at least". At a boundary, the sign decides which side a number falls on.

**Alex Tutor:** Try a case right on the boundary.

> **Exercise:** A team's rule: "call the test significant if p < 0.05". A test returns p = 0.05 exactly. Is it called significant?

**Alex Tutor:** **±** gives two numbers at once. A lift of 1.3 pp ± 0.9 pp means from 1.3 − 0.9 = 0.4 to 1.3 + 0.9 = 2.2 pp. Written as an interval: [0.4; 2.2]. Square brackets include the ends, round ones exclude them.

**Alex Tutor:** Turn a ± into its two ends.

> **Exercise:** A test reports a lift of 1.8 pp ± 1.1 pp. What is the lower end of the interval, in pp?

**Sofia:** And why do test reports care whether the interval contains 0?

**Alex Tutor:** Because 0 means "no effect". If the whole interval is above 0, like [0.4; 2.2], the data rule out "no effect". If 0 ∈ [−0.3; 1.9], where ∈ reads "is in", they don't. ∉ means "is not in".

![Three intervals on a line around 0: [0.4; 2.2] lies entirely above 0, [−0.3; 1.9] contains 0, and [−1.6; −0.2] lies entirely below 0.](https://productovi.com/courses/math-basics/diagrams/m2-l4-intervals.png)

*Only an interval that doesn't contain 0 rules out "no effect".*

**Alex Tutor:** One more sign: **⇔**, "if and only if". "Reject H₀ ⇔ p < α" works both ways: a small p means you reject, and rejecting means p was small. No third case.

> **Exercise:** Which lift intervals, in percentage points, lie entirely above 0? Select all that apply.

## Formulas with cases

**Alex Tutor:** Some formulas branch. The median is one: with n odd, it's the middle value x₍₍ₙ₊₁₎/₂₎; with n even, the mean of the two middle ones. A curly bracket on the left lists the cases.

$$
\text{median} = \begin{cases} x_{((n+1)/2)} & \text{if } n \text{ is odd} \\ \dfrac{x_{(n/2)} + x_{(n/2+1)}}{2} & \text{if } n \text{ is even} \end{cases}
$$

*Read the condition on the right first, then use the formula on its left. For 4, 6, 7, 9 (n = 4): (6 + 7) ÷ 2 = 6.5.*

**Alex Tutor:** Apply the cases to a list of even length.

> **Exercise:** Four learners took 3, 8, 5 and 12 lessons. Using the median formula with cases, what is the median?

**Alex Tutor:** Outlier fences are two inequalities. A value is flagged if x < Q₁ − 1.5·IQR or x > Q₃ + 1.5·IQR, where IQR = Q₃ − Q₁. With Q₁ = 6 and Q₃ = 10 lessons, IQR = 4 and the fences are 0 and 16, so a learner with 18 lessons is flagged.

**Sofia:** Quartiles come in module 3, right? Here I only need the inequality.

> **Exercise:** Weekly lessons per tutor have Q₁ = 12 and Q₃ = 20. What is the upper fence, Q₃ + 1.5·IQR, above which a tutor is flagged?

## min, max and "the first month when"

**Alex Tutor:** **max** and **min** pick the larger or smaller value. max(0, x − 50) is a cap from below: a fee on usage above 50 hours is zero until you pass 50, then grows. A plan with three tracks lasting 5, 8 and 6 weeks takes max(5, 8, 6) = 8 weeks.

**Alex Tutor:** Compute one overage charge before we get to payback.

> **Exercise:** A tool charges 30 UAH for every hour above 50 hours a month: charge = 30 × max(0, h − 50). In May a team used h = 64 hours. What is the charge, in UAH?

**Alex Tutor:** Payback combines Σ with an inequality: the first month k where the running total of margin reaches the acquisition cost, Σ ≥ CAC. Margins 120, 100 and 90 give running totals 120, 220 and 310; against a CAC of 300, payback is month 3.

> **Exercise:** Acquiring a learner costs CAC = 450 UAH. Margin per month is 140, 120, 110, 100 and 90 UAH. In which month k does the running total first satisfy Σ ≥ CAC?

## Tiered rates: effective vs marginal

**Alex Tutor:** Klasna pays sales partners a tiered commission: 10% on the first 100,000 UAH of monthly sales, 15% on the part from 100,000 to 300,000, and 20% above 300,000. Each rate applies only to its own slice.

**Alex Tutor:** For 380,000: 10% × 100,000 = 10,000; 15% × 200,000 = 30,000; 20% × 80,000 = 16,000. Total **56,000 UAH**. The **effective rate** is 56,000 ÷ 380,000 = 14.74%; the **marginal rate**, on the next hryvnia, is 20%.

![Sales of 380,000 split into slices: 100,000 at 10% (10,000), 200,000 at 15% (30,000) and 80,000 at 20% (16,000), 56,000 in all; effective rate 14.74%, marginal 20%.](https://productovi.com/courses/math-basics/diagrams/m2-l4-tiers.png)

*Each rate touches only its own slice.*

**Sofia:** So "you're in the 20% bracket" doesn't mean 20% of everything. 20% × 380,000 would be 76,000, which overpays by 20,000.

> **Exercise:** Under Klasna's partner scheme (10% up to 100,000, 15% from 100,000 to 300,000, 20% above), what commission does a partner earn on 250,000 UAH of sales?

**Alex Tutor:** Write it down and check a manager's budget for a bigger month.

**Sofia:** The top rate is the trap, I think.

**Alex Tutor:** Usually. And remember the effective rate is always below the marginal one when rates rise with the slices.

> **Exercise:** A manager budgets a partner's commission for 420,000 UAH of sales as 20% × 420,000 = 84,000 UAH. The scheme is 10% up to 100,000, 15% from 100,000 to 300,000 and 20% above 300,000. Compute the correct commission, give the effective and the marginal rate, and explain the manager's mistake in one sentence.

## Case: a quality bonus with cases

**Alex Tutor:** Time for the module case. Hanna, Klasna's head of finance, has drafted a quality bonus for tutors. It uses everything from this module: indices, a sum, rearranging and inequalities.

**Sofia:** So I'll check the rule before it goes out to tutors.

**Alex Tutor:** Yes. Watch the boundaries: a rating of exactly 4.5 or 4.8 must land on a clear side.

> **Exercise:** Write a short note to Hanna that checks her bonus rule.

## Where you will meet this

> **In short**
>
> - **<** excludes the boundary, **≤** includes it. **±** gives an interval: a ± b = [a − b; a + b].
> - An interval **entirely above 0** rules out "no effect"; one that contains 0 doesn't. **⇔** works both ways.
> - Formulas with **cases**: check the condition first. Fences: x < Q₁ − 1.5·IQR or x > Q₃ + 1.5·IQR.
> - **max/min** pick the larger or smaller value: max(0, x − limit) is zero until the limit. Payback is the first k with **Σ ≥ CAC**.
> - **Tiered rates** apply to their own slice only. Effective rate = total ÷ base; marginal rate = the rate on the next unit.

> **These lessons use it**
>
> - [Mean, median and mode](/courses/statistics-for-pm-and-marketers/typical-value): the median for odd and even n.
> - [Outliers and skewed data](/courses/statistics-for-pm-and-marketers/outliers-and-skew): Tukey fences.
> - [p-value and statistical significance](/courses/statistics-for-pm-and-marketers/p-value): reject H₀ ⇔ p < α.
> - [95% confidence intervals](/courses/statistics-for-pm-and-marketers/confidence-intervals): x̄ ± margin of error.
> - [Case: reading a finished test](/courses/product-analytics/reading-a-test): an interval entirely above 0, or not.
> - [CAC, payback and ROI](/courses/product-analytics/cac-payback-roi): payback as the first month where the running total reaches CAC.

**Alex Tutor:** That's module 2. Next: averages and shares of shares, starting with the mean, the median and where a value sits in a list.

- Previous lesson: [Rearranging a formula: solve for what you need](https://productovi.com/courses/math-basics/rearranging-a-formula.md)
- Next lesson: [Typical value and position: mean, median, quartiles](https://productovi.com/courses/math-basics/mean-median-trimmed-mean.md)

---
Productovi Learning. Free, no sign-up needed to read.
