Question: $$|x-2|+|x+3|= 5$$

What are the real values of $x$ satisfies the equation?

I tried doing this but it somehow did not work. Could someone explaim why please? Here's my workings :

$$|x-2|+|x+3|=5$$
$$\Rightarrow (x-2)+(x+3)=5$$
$$\Rightarrow x+2+x+3=5$$
$$\Rightarrow x=6$$
$$\Rightarrow x=3$$

The answer is $[-3,2]$

Answer: 
Hint:

For a number to be bigger than $340$.

The first digit can be either $3$ or $4$.

If the first digit is $3$, the second digit must be $4$ and the last digit can be anything.

If the first digit is $4$, the last two digit can be anything.

Can you compute the probability now?
In general suppose we have an alphabet of $n$ characters and a fixed permutation $a\_1,a\_2,\dots, a\_k$ of them. We select a permutation of length $k$ of the alphabet randomly, what is the probability it is less than or equal to $a\_1,a\_2,\dots, a\_n$?

This is given by the formula:

$$\frac{1+\sum\limits\_{i=1}^{k-1} f\_i(n-i)^{\underline {k-i}}}{n^{\underline k}}$$

where $x^{\underline n}$ is the falling factorial and $f\_i$ is the number of letters larger than $a\_n$ in the alphabet that do not appear among $a\_0,a\_1,\dots, a\_n$.

This can be calculated in time $\mathcal O (k\log(k))$