Find an efficient mental estimation algorithm for tips.

189 Views Asked by At

Context: let's say we want to compute the total, with tip, approximately, and in our head. What is the best method you can construct to find the following.

Given $x \in \mathbb{R}^+$, construct $y$ such that $1.14x \leq y \leq 1.21x$ as simply$^1$ as possible.

  1. "Simply" meaning that the goal is to find a method for transforming $x$ into a satisfactory $y$ in an "optimal" way for mental computation. The width of the target codomain should be exploited to facilitate this.

I suspect that the use of some Floor and Ceiling operations interspersed with the necessary multiplication may be beneficial, as well as perhaps log_10 or other operations.

Feel free to generalize to a parameterized window (tip percentages) if you wish. Also, note that we are not computing the tip itself and then adding it to the total, but rather simply skipping to the final result of total+tip.

1

There are 1 best solutions below

3
On

Mental arithmetic is mainly concerned with small numbers, so to approximate y such that $ax\le y\le bx$ for a given x we should try to find some rational number $a\le\frac mn\le b$ with m and n small. n should preferably be of the form $2^a5^b$ (i.e. $\frac1n$ should have a finite decimal expansion).

We should then divide x by n and multiply the result by m to get y. Having n in the form stated earlier allows us to reduce the division to shifting decimal points, doubling and halving – the easiest of all mental operations. For the same reason, while multiplying these easy operations should be left to the last.

In our case, with $a=1.14$ and $b=1.21$, we note that $\frac65=1.2$ lies between a and b, so we can use that multiplier. Suppose $x=147$. This is what we do:

  • Divide by 10 and multiply by 2: 147 → 14.7 → 29.4. This is the same as dividing by 5.
  • Multiply by 3: 29.4 → 88.2.
  • Multiply by 2: 88.2 → 176.4. We have multiplied by 6.

1.2 is also close to the upper bound of 1.21, so this result is a conservative estimate of what we must pay.

The same idea can be used for other tip percentages, but note that for smaller numbers it is easier to compute the tip separately and add that to the total, as the number to be multiplied by tends to be larger in that case. For example, if $1.03x\le y\le1.07x$, the most appropriate multiplier would be $\frac{21}{20}=1.05$, but multiplying by 3 and then by 7 (to get the numerator of 21) is not very easy for an ordinary person…