To find the coordinates of vertex C of triangle ABC, we start with the coordinates of vertices A and B and use the formula for the centroid of a triangle.
The formula for the centroid (G) of a triangle with vertices at (x₁, y₁), (x₂, y₂), and (x₃, y₃) is given by:
\[ G = \left(\frac{x_1 + x_2 + x_3}{3}, \frac{y_1 + y_2 + y_3}{3}\right) \]
In this case, we have:
- Vertex A at (3, 8)
- Vertex B at (3, 2)
- Centroid P at (4, 5)
Let the coordinates of vertex C be (x₃, y₃).
Now we can set up the equations for the centroid:
- For the x-coordinate of the centroid: \[ \frac{3 + 3 + x_3}{3} = 4 \]
Multiplying both sides by 3 gives: \[ 3 + 3 + x_3 = 12 \] \[ 6 + x_3 = 12 \] \[ x_3 = 12 - 6 = 6 \]
- For the y-coordinate of the centroid: \[ \frac{8 + 2 + y_3}{3} = 5 \]
Multiplying both sides by 3 gives: \[ 8 + 2 + y_3 = 15 \] \[ 10 + y_3 = 15 \] \[ y_3 = 15 - 10 = 5 \]
Thus, the coordinates of vertex C are (6, 5).
Therefore, the answer is: \[ \text{(6, 5)} \]