4. What do the following function calls return? Briefly explain your answer.
(a) SecondBest $( [ 2,2,3 ] , 3 )$
(b) SecondBest $( [ 3,2,2 ]$, 3)
5. Give one example of an input array A with exactly 3 elements for which the call SecondBest (A, 3) returns a wrong answer. What is this wrong answer? What is the correct answer? 6. Let $F$ be the set of points on the plane with coordinates ( $x , y$ ) such that $| | x | - | y | | + | x | + | y | = 4$. What is the number of points in $F$ with integer coordinates? 7. We select three points at random on the circumference of a circle. What is the probability that $\triangle A B C$ contains the centre $O$ in the interior? 8. Let $\alpha$ be a fixed real number and let $f$ be a function from $\mathbb { R } ^ { 2 }$ to $\mathbb { R } ^ { 2 }$ defined as
$$f ( x , y ) = ( x \cos \alpha - y \sin \alpha , x \sin \alpha + y \cos \alpha ) .$$
Write down an expression for $f ^ { 10 } ( x , y )$, where $f ^ { 10 }$ denotes the function obtained by composing $f$ with itself 10 times. 9. "I've defeated more than 10 FIDE masters," a chess player boasted. "Surely, it must be fewer than 10," said the referee. "Well, I suppose it was at least one," said the Grand Master. If exactly one of them spoke the truth, how many FIDE masters did the chess player actually defeated? 10. A supplier of art material has four reams of handmade paper, three boxes of acrylic colors and two printing blocks. The two artists in the shop want to buy one item each, but insist on having the same kind of art material. How many items does the supplier have to take out to be sure that the artists' demand is met? 11. In a farmer's stable three animals, a donkey, a cow and a horse had to share two types of feed bags, one containing hay and the other containing grain, as follows:
- If the donkey ate grain then the horse ate what the cow ate.
- If the horse ate grain then then donkey ate what the cow did not eat.
- If the cow ate hay, then the donkey ate what the horse ate.
Among all the assignments of feedbags that satisfy the above condition which animal always gets to eat from the same feedbag? 12. There are 7 elevators in a large shopping mall, each stopping at ground floor and at most six other floors. If at least 3 elevators stop at each floor and if it is possible to go from any floor to any other floor without changing elevators, what is the maximum number of floors in the mall? 13. Consider the following expression
$$\sqrt { x + 2 \sqrt { x - 1 } } + \sqrt { x - 2 \sqrt { x - 1 } }$$
Find two real numbers $a , b$ such that the above expression is constant for $a \leq x \leq b$. 14. You are given a strange, analogue wall clock whose hour and minute hands are identical. Both the hands move continuously and there is no second hand. How many times are there from noon to midnight when it is not possible to tell what time is it by looking at the clock at that instant? For example, at 06 : 00 pm one can be sure that the upper hand is the minute hand, for otherwise at $12 : 30 \mathrm { pm }$ the top hand is between 12 and 1 . However, a bit after $1 : 15 \mathrm { pm }$ and $3 : 06 \mathrm { pm }$ the clock looks identical and you wouldn't be able to tell the exact time. 15. Does there exist a polynomial $q ( x )$ with integer coefficients such that $q ( 1 ) = 2$ and $q ( 3 ) = 5$ ? Given an example if there is one. Justify, if there is not. 16. Find the number of all 4-digit natural numbers formed with exactly two distinct digits. 17. An electronic card shuffling machine always rearranges the cards in the same way relative to the order in which they are placed in it. One iteration of shuffling means that the cards are placed in the machine and they are taken out after the rearrangement. Two iterations means that you place the cards in the machine immediately after the first iteration. The ace through the king of hearts are arranged in order with the ace on top and the king at the bottom. After 2 iterations the order of the cards, from top to bottom, is
$$10,9 , Q , 8 , K , 3,4 , A , 5 , J , 6,2,7 .$$
What will be the order after 13 iterations?
Questions 18-20 are based on the following description.
In June 2017, a cyberattack named NotPetya spread all over the world. Big companies like Marex, Merck, and FedEx's TNT Express lost a lot of money because of this attack.
\begin{table}[h]
| Company | \begin{tabular}{ c } Pre-attack Average |
| Monthly Revenue |
| (USD million) |
&
| Post-Attack Average |
| Monthly Revenue |
| (USD million) |
\hline Marex & 1000 & 700 Merc & 800 & 480 TNT Expanse & 500 & 250 \hline \end{tabular}
Table 1: Financial impact of NotPetya attack on three major companies\end{table}
- Which company experienced the smallest percentage decrease in total revenue over a one month period relative to its estimated total revenue loss over the same period?
- Calculate the overall percentage decrease in revenue across all three companies in one month period following the NotPetya attack.
- Assuming the monthly revenue of Marex follows a Gaussian distribution with a standard deviation of 75 , (i) what is the probability that Marex's revenue will be less than $\$ 850$ million in the pre-attack scenario, and (ii) what is the probability that Marex's revenue will be more than $\$ 850$ million in the post-attack scenario?
\begin{table}[h]
| $z$ | $P ( Z \leq z )$ |
| - 2 | 0.0227 |
| - 1 | 0.1586 |
| 0 | 0.5000 |
| 1 | 0.8413 |
| 2 | 0.9772 |
Table 2: Note that $Z \sim N ( 0,1 )$\end{table}