We know the formula for mean is given by
[tex]\text{Mean}=\frac{\text{Sum of all observations}}{\text{Total number of observations}}[/tex]
Using the above mentioned formula, the mean of 27 and 5 is given by
[tex]\text{Mean}=\frac{27+5}{2} \\ \\ \text{Mean}=\frac{32}{2}\\ \\ \text{Mean}=16[/tex]
Similarly, mean of 8 and x is given by
[tex]\frac{8+x}{2}[/tex]
Now, we have been given that 8 and x have the same mean as 27 and 5. Therefore, we have
[tex]\frac{8+x}{2} =16\\ \\ 8+x=32\\ \\ x=24[/tex]
Therefore, the x value is 24