A digital black and white image is composed of small squares (pixels) whose colour ranges from white to black through all shades of grey. Each shade is coded by a real number $x$ as follows:
- $x = 0$ for white;
- $x = 1$ for black;
- $x = 0.01; x = 0.02$ and so on up to $x = 0.99$ in steps of 0.01 for all intermediate shades (from light to dark).
A function $f$ defined on the interval $[0; 1]$ is called a ``retouching function'' if it has the following four properties:
- $f(0) = 0$;
- $f(1) = 1$;
- $f$ is continuous on the interval $[0; 1]$;
- $f$ is increasing on the interval $[0; 1]$.
A shade coded $x$ is said to be darkened by the function $f$ if $f(x) > x$, and lightened if $f(x) < x$.
Part A
- We consider the function $f_{1}$ defined on the interval $[0; 1]$ by: $$f_{1}(x) = 4x^{3} - 6x^{2} + 3x$$ a) Prove that the function $f_{1}$ is a retouching function. b) Solve graphically the inequality $f_{1}(x) \leq x$, using the graph given in the appendix, to be returned with your answer sheet, showing the necessary dotted lines. Interpret this result in terms of lightening or darkening.
- We consider the function $f_{2}$ defined on the interval $[0; 1]$ by: $$f_{2}(x) = \ln[1 + (e - 1)x]$$ We admit that $f_{2}$ is a retouching function. We define on the interval $[0; 1]$ the function $g$ by: $g(x) = f_{2}(x) - x$. a) Establish that, for all $x$ in the interval $[0; 1]$: $g'(x) = \frac{(e - 2) - (e - 1)x}{1 + (e - 1)x}$; b) Determine the variations of the function $g$ on the interval $[0; 1]$. Prove that the function $g$ has a maximum at $\frac{e - 2}{e - 1}$, a maximum whose value rounded to the nearest hundredth is 0.12. c) Establish that the equation $g(x) = 0.05$ has two solutions $\alpha$ and $\beta$ on the interval $[0; 1]$, with $\alpha < \beta$. We will admit that: $0.08 < \alpha < 0.09$ and that: $0.85 < \beta < 0.86$.
Part B
We note that a modification of shade is visually perceptible only if the absolute value of the difference between the code of the initial shade and the code of the modified shade is greater than or equal to 0.05.
- In the algorithm described below, $f$ denotes a retouching function. What is the role of this algorithm? \begin{verbatim} Variables : x (initial shade) y (retouched shade) E (difference) c (counter) k Initialization : c takes the value 0 Processing: For k ranging from 0 to 100, do x takes the value k/100 y takes the value f(x) E takes the value |y - x| If E >= 0.05, do c takes the value c + 1 End if End for Output: Display c \end{verbatim}
- What value will this algorithm display if applied to the function $f_{2}$ defined in the second question of part $\mathbf{A}$?
Part C
In this part, we are interested in retouching functions $f$ whose effect is to lighten the image overall, that is, such that, for all real $x$ in the interval $[0; 1]$, $f(x) \leq x$. We decide to measure the overall lightening of the image by calculating the area $\mathscr{A}_{f}$ of the portion of the plane between the x-axis, the curve representing the function $f$, and the lines with equations $x = 0$ and $x = 1$ respectively. Between two functions, the one that has the effect of lightening the image the most is the one corresponding to the smallest area. We wish to compare the effect of the following two functions, which we admit are retouching functions:
$$f_{3}(x) = x\mathrm{e}^{(x^{2} - 1)} \quad f_{4}(x) = 4x - 15 + \frac{60}{x + 4}$$
- a) Calculate $\mathscr{A}_{f_{3}}$. b) Calculate $\mathscr{A}_{f_{4}}$
- Of these two functions, which one has the effect of lightening the image the most?