The engineer is awakened by a smell and gets up to check it. He finds a fire in the hallway, sees a nearby fire extinguisher and after extinguishing it, goes back to bed.
Later that night, the physicist gets up, again because of the smell of fire. He quickly gets up and sees the fire in the hallway. After calculating air pressure, flame temperature and humidity as well as distance to the fire and projected trajectory, he extinguishes the fire with the least amount of fluid.
At last, the mathematician awakes, only again to find a fire in the hallway. He instantly sees the extinguisher and thinks, “A solution exists!”, and heads back into his room.