to solve the problem we must establish two equations.
let x be the mass of the 20 cents almonds
y be the mass of the 36 cents mixture
first equation is:
x + 40 = y
the second equation is:
0.2x + 40(0.4) = 0.36y
solving the equations simultaneously
x = 10 lb of the 20 cents almonds is needed to mix