Let the number of years Hoang has been in the hospital be H
Let the number of years Bill has been in the hospital be B
The question says Hoang has been in the hospital 6 years longer than Bill.
Mathematically,
H = B + 6 (equation 1)
The question also says 4 years ago, Hoang was at the hospital twice as long as Bill;
4 years ago, Bill's age was = B - 4
4 years ago, Hoang's age was = H - 4
Therefore, we can interprete the statement as:
2 x Bill's age 4 years ago = Hoang's age 4 years ago
Mathematically,
2 x (B - 4) = H - 4
2B - 8 = H - 4
Add 8 to both sides and subtract H from both sides
2B - H = 8 - 4
2B - H = 4 (equation 2)
Substitute the expression for H in equation 1 into equation 2.
2B - H = 4,
But H = B + 6
2B - (B + 6) = 4
2B - B - 6 = 4
Add 6 to both sides
B = 4 + 6 = 10
This means that Bill's years of being in the hospital is 10 years.
Now to find Hoang's years (H),
Using equation 1,
B + 6 = H
But B = 10
10 + 6 = H
H = 16
Thus, Hoang's number of years is 16.
The final answer is: Hoang's number of years = 16, Bill's number of years = 10