Assume we need 10L of 40% solution
Let the 20% solution required be x L
Therefore, 50% solution required, will be (10-x)L
Required ratio is x : (10-x)
Calculating value of x:
xL of 20% solution and (10-x)L of 50% solution will form 10L of 40% solution
Therefore,
x * (20/100) + (10-x) * (50/100) = 10*(40/100)
0.2x+5-0.5x=4
x=1/0.3=10/3
Required ratio=10/3 : (10-10/3)
=1 : 2