We are given the linear equation:
\[
x + py + q = 0 \quad \Rightarrow \quad y = -\frac{1}{p}x - \frac{q}{p}
\]
This is the slope-intercept form: \( y = mx + c \), where:
- Slope \( m = -\frac{1}{p} \)
- Intercept \( c = -\frac{q}{p} \)
From the graph:
- The line passes through the points \( (-2, 0) \) and \( (0, 4) \)
Using these two points, calculate the slope:
\[
m = \frac{4 - 0}{0 - (-2)} = \frac{4}{2} = 2 \quad \Rightarrow \quad -\frac{1}{p} = 2 \quad \Rightarrow \quad p = -\frac{1}{2}
\]
Now substitute \( p = -\frac{1}{2} \) into the intercept equation:
\[
y = -\frac{1}{p}x - \frac{q}{p} \quad \Rightarrow \quad y = 2x - 2q
\]
We know the line passes through \( (0, 4) \), so:
\[
4 = 2(0) - 2q \quad \Rightarrow \quad q = -2
\]
Oops! This contradicts the earlier value. Let’s instead directly substitute the known points into the original equation \( x + py + q = 0 \) and solve for \( p \) and \( q \).
From point \( (-2, 0) \):
\[
-2 + p(0) + q = 0 \quad \Rightarrow \quad q = 2
\]
From point \( (0, 4) \):
\[
0 + p(4) + 2 = 0 \quad \Rightarrow \quad 4p = -2 \quad \Rightarrow \quad p = -\frac{1}{2}
\]
Hence, \( p = -\frac{1}{2}, \ q = 2 \) is the correct pair.