tom , working alone , can paint a room in 8 hours . peter and john , working independently , can paint the same room in 4 hours and 2 hours , respectively . tom starts painting the room and works on his own for two hour . he is then joined by peter and they work together for two hour . finally , john joins them and the three of them work together to finish the room , each one working at his respective rate . what fraction of the whole job was done by peter ?
"let the time when all three were working together be t hours . then : tom worked for t + 4 hour and has done 1 / 8 * ( t + 4 ) part of the job ; peter worked for t + 2 hour and has done 1 / 4 * ( t + 2 ) part of the job ; john worked for t hours and has done 1 / 2 * t part of the job : 1 / 8 * ( t + 4 ) + 1 / 4 * ( t + 2 ) + 1 / 2 * t = 1 - - > multiply by 8 - - > ( t + 4 ) + ( 2 t + 2 ) + 4 t = 8 - - > t = 2 / 7 ; hence peter has done 1 / 4 * ( 2 / 7 + 2 ) = 1 / 4 * 16 / 7 = 16 / 28 = 8 / 14 = 4 / 7 answer : a"
divide(const_4, add(multiply(const_4, 2), const_1))