Final answer:
It takes the painter 16 hours to paint the room by himself.
Step-by-step explanation:
Let's assume that the painter's friend can paint the room in x hours. According to the given information, the painter alone would take 12 hours less than his friend to complete the task. Therefore, the painter would take (x - 12) hours to paint the room alone.
When the painter and his friend work together, they can complete the task in 8 hours. We can express this information using the formula:
1 / (x - 12) + 1 / x = 1 / 8
To solve this equation, we multiply through by 8x(x - 12) to eliminate the fractions:
8(x - 12) + 8x = x(x - 12)
Simplifying further, we get:
16x - 96 = x² - 12x
Rearranging the equation and solving for x, we find:
x² - 28x + 96 = 0
Using the quadratic formula, x = 16 or x = 6. As the painter's friend cannot paint the room in less time than the painter, we discard the solution x = 6. Therefore, it takes the painter 16 hours to paint the room alone.