(a) Let in the beginning Eric had 3x red pens and Kai had x blue pens
2/5 * 3x = 6x/5
Eric gave 6x/5 red pens to Kai.
Now Eric has 3x - 6x/5 = 9x/5 red pens.
Kai gave x/2 blue pens to Eric
Now Eric has a 9x/5 + x/2 = (18x + 5x)/10 = 23x/10
Now Kai has x - x/2 = x/2 blue pens.
Now Kai has total x/2 + 6x/5 = 17x/10 pens.
required fraction = (x/2)/(17x/10) = x/2 * 10/17x = 5/17
5/17 is the answer.
(b) After another round of transfer Eric has total 23x/10 - 15 pens and Kai has total 17x/10 + 15 pens.
23x/10 - 15 = 17x/10 + 15
(23x - 150)/10 = (17x + 150)/10
23x - 150 = 17x + 150
6x = 300
3x = 150
Eric had 150 pens in the beginning.