To calculate the median, the values in the set have to be arranged in ascending order.
Elements of set P can be arranged as 4,7,10,18. The median is the average of 7 and 10. Median of set P = 8.5
Elements of set Q can be arranged as 4,7,10,18, 25. Note that we need to decide the location of x depending on the median.
We know that the median of set Q is 4 more than the median of set P. Therefore, median of set Q = 12.5.
Set Q has 6 elements, hence the median will be the average of the 3rd and 4th value in the set.
If x<4 OR x>25, 3rd value = 10 and 4th value = 18. Median ≠ 12.5. Therefore, x is neither less than 4 nor greater than 25.
If 4<x<10 OR 18<x<25, a similar conclusion may be drawn.
Therefore, x has to be between 10 and 18 and hence Median = \(\frac{10 + x }{ 2}\) = 12.5.
Simplifying, we get x = 15.
The correct answer option is D.
Hope that helps!