Let the height of the lighthouse be \( h \) metres. Let the distance between the lighthouse and the first ship be \( x_1 \), and the distance between the lighthouse and the second ship be \( x_2 \). The distance between the two ships is given as 50 metres, so:
\[
x_2 - x_1 = 50.
\]
Triangle 1: For the first ship
From the angle of depression \( 30^\circ \) and using the tangent function, we get:
\[
\tan(30^\circ) = \frac{h}{x_1}.
\]
Since \( \tan(30^\circ) = \frac{1}{\sqrt{3}} \), we have:
\[
\frac{1}{\sqrt{3}} = \frac{h}{x_1} \quad \Rightarrow \quad x_1 = \sqrt{3}h.
\]
Triangle 2: For the second ship
From the angle of depression \( 45^\circ \) and using the tangent function again, we get:
\[
\tan(45^\circ) = \frac{h}{x_2}.
\]
Since \( \tan(45^\circ) = 1 \), we have:
\[
1 = \frac{h}{x_2} \quad \Rightarrow \quad x_2 = h.
\]
Set up the equation for the distance between the ships
Now, substitute \( x_1 = \sqrt{3}h \) and \( x_2 = h \) into the equation \( x_2 - x_1 = 50 \):
\[
h - \sqrt{3}h = 50.
\]
Factor out \( h \):
\[
h(1 - \sqrt{3}) = 50.
\]
Solve for \( h \):
\[
h = \frac{50}{1 - \sqrt{3}}.
\]
Multiply both the numerator and denominator by \( 1 + \sqrt{3} \) to rationalize the denominator:
\[
h = \frac{50(1 + \sqrt{3})}{(1 - \sqrt{3})(1 + \sqrt{3})} = \frac{50(1 + \sqrt{3})}{1 - 3} = \frac{50(1 + \sqrt{3})}{-2}.
\]
Thus:
\[
h = -25(1 + \sqrt{3}) \, \text{metres}.
\]
Since the height of the lighthouse cannot be negative, we take the positive value, and the height of the lighthouse is:
\[
h = 25(1 + \sqrt{3}) \, \text{metres}.
\]
Conclusion:
The height of the lighthouse is \( 25(1 + \sqrt{3}) \, \text{metres}. \)