let x be the first number and
y be the second number
xy = 162
x+y = 27
x+y = 27
y = 27 - x
so, xy = 162
x( 27 - x) = 162
27x -x² = 162
x² -27x+162 = 0
(x-18) (x-9) = 0
x-18 = 0 and x-9 = 0
x = 18 and x = 9
if x = 18 and if x = 9
y = 27 - x y = 27 - x
= 27 - 18 = 27 - 9
y = 9 y = 18
so the answer or the ratio is 1 : 2 or 2 :1.