I have a random variable $X$ which has the following CDF: $$F(y) = \left\{\begin{array}{ll} 0 & : y \lt 0\\ \frac{y}{30} & : 0 \le y \lt 20\\ \frac{2}{3} + \frac{y-20}{60} & : 20 \le y \lt 40\\ 1 & : y \ge 40 \end{array} \right.$$
To find the median of $X$, I know I need to plug $q_2$ into the CDF and set it equal to 0.5: $$ F(q_2) = 0.5 $$ and solve for $q_2$. But which interval of the CDF should I use? My intuition tells me it would be the third interval since 20 falls in the middle of 0 and 40 and this is the interval that would be used for $F(20)$, but I have a feeling this is wrong. Which one should I use for $q_2$, as well as $q_1$ and $q_3$?
I found the answer so I'll go ahead and post it here:
The easy way is just to make a guess and plug in the quartile using any of the intervals. If the result falls within the interval you chose, it is correct. If not, pick a different one.