Let the price at the start of day 1 be $P_0 = 100$.
Let the price at the end of day 5 be $P_5 = 110$.
The total price change over 5 days is $P_5 - P_0 = \text{Rs } 10$.
Each day, the price changes by either $+10$ (an 'up' day) or $-10$ (a 'down' day).
Let $U$ be the number of up days and $D$ be the number of down days.
We have a system of two equations:
- MATH7 (total number of days)
- MATH8 (total price change) MATH9
Solving these equations, we get $2U = 6 \implies U = 3$ and $D = 2$.
So, there were 3 up days and 2 down days.
Now, let's analyze the change in cash for each trader.
Let $\Delta C_H$ be the change in Harshit's cash and $\Delta C_D$ be the change in Dhara's cash.
Harshit's strategy: Sells 10 shares on up days, buys 10 shares on down days.
$\Delta C_H = 10 \times (\sum P_{\text{up}}) - 10 \times (\sum P_{\text{down}})$
where $\sum P_{\text{up}}$ is the sum of closing prices on the 3 up days, and $\sum P_{\text{down}}$ is the sum of closing prices on the 2 down days.
Dhara's strategy: Sells 10 shares if price > 110, buys 10 shares if price < 90.
$\Delta C_D = 10 \times (\sum P_{ \gt 110}) - 10 \times (\sum P_{ \lt 90})$
We are given that Harshit ended with Rs 1300 more cash than Dhara. Since they started with the same amount, their change in cash must differ by 1300.
$\Delta C_H = \Delta C_D + 1300$
$10 \times (\sum P_{\text{up}} - \sum P_{\text{down}}) = 10 \times (\sum P_{ \gt 110} - \sum P_{ \lt 90}) + 1300$
Dividing by 10, we get the main condition:
$(\sum P_{\text{up}} - \sum P_{\text{down}}) = (\sum P_{ \gt 110} - \sum P_{ \lt 90}) + 130$
Let's test the possible price paths. A path is a sequence of 3 'U's and 2 'D's. There are $\frac{5!}{3!2!} = 10$ such paths.
Consider the case where Dhara makes no trades. This occurs if the price on all 5 days remains within the range [90, 110]. For this case, $\sum P_{ \gt 110} = 0$ and $\sum P_{ \lt 90} = 0$. The condition simplifies to:
$\sum P_{\text{up}} - \sum P_{\text{down}} = 130$
Let's check the paths where the price stays within [90, 110]:
- Path U, D, D, U, U:
Prices: $100 \to 110 \to 100 \to 90 \to 100 \to 110$. All prices are in [90, 110].
Up days (1, 4, 5) prices: 110, 100, 110. $\sum P_{\text{up}} = 320$.
Down days (2, 3) prices: 100, 90. $\sum P_{\text{down}} = 190$.
$\sum P_{\text{up}} - \sum P_{\text{down}} = 320 - 190 = 130$.
The condition is satisfied. For this path, the price at the end of day 4 is Rs $100$.
- Path U, D, U, D, U:
Prices: $100 \to 110 \to 100 \to 110 \to 100 \to 110$. All prices are in [90, 110].
Up days (1, 3, 5) prices: 110, 110, 110. $\sum P_{\text{up}} = 330$.
Down days (2, 4) prices: 100, 100. $\sum P_{\text{down}} = 200$.
$\sum P_{\text{up}} - \sum P_{\text{down}} = 330 - 200 = 130$.
The condition is satisfied. For this path, the price at the end of day 4 is Rs $100$.
- Path D, U, U, D, U:
Prices: $100 \to 90 \to 100 \to 110 \to 100 \to 110$. All prices are in [90, 110].
Up days (2, 3, 5) prices: 100, 110, 110. $\sum P_{\text{up}} = 320$.
Down days (1, 4) prices: 90, 100. $\sum P_{\text{down}} = 190$.
$\sum P_{\text{up}} - \sum P_{\text{down}} = 320 - 190 = 130$.
The condition is satisfied. For this path, the price at the end of day 4 is Rs $100$.
- Path D, U, D, U, U:
Prices: $100 \to 90 \to 100 \to 90 \to 100 \to 110$. All prices are in [90, 110].
Up days (2, 4, 5) prices: 100, 100, 110. $\sum P_{\text{up}} = 310$.
Down days (1, 3) prices: 90, 90. $\sum P_{\text{down}} = 180$.
$\sum P_{\text{up}} - \sum P_{\text{down}} = 310 - 180 = 130$.
The condition is satisfied. For this path, the price at the end of day 4 is Rs $100$.
Any path where the price goes outside the [90, 110] range will cause Dhara to trade. For example, path D, D, U, U, U gives prices $90, 80, 90, 100, 110$. Dhara buys at Rs 80.
$\sum P_{\text{up}} = 90+100+110=300$. $\sum P_{\text{down}} = 90+80=170$.
$\sum P_{ \gt 110}=0$. $\sum P_{ \lt 90}=80$.
Checking the condition: $(300-170) = (0-80)+130 \implies 130 = 50$, which is false.
It can be verified that any path where Dhara trades will not satisfy the cash difference condition.
Therefore, the only possible scenarios are the four paths listed above where Dhara does not trade. In all of these valid scenarios, the price at the end of day 4 is Rs $100$.