Using the formula for the probability of the union of two events:
\[
P(A \cup B) = P(A) + P(B) - P(A \cap B)
\]
Since \( A \) and \( B \) are independent events:
\[
P(A \cap B) = P(A) \cdot P(B)
\]
Substitute the values:
\[
0.7 = 0.4 + P(B) - 0.4 \cdot P(B)
\]
Simplify the equation:
\[
0.7 = 0.4 + P(B)(1 - 0.4)
\]
\[
0.7 = 0.4 + 0.6P(B)
\]
\[
0.3 = 0.6P(B)
\]
\[
P(B) = \frac{0.3}{0.6} = 0.5
\]