According to the given situation, the computation of two number in a given ratio is shown below:-
We assume the numbers is x and y
Given that

x = 3y
and

With the help of above formula we will put the value and be able to find the values of x and y
x - y = 6
3y - y = 6
2y = 6
y = 3
x = 3y = 9
x = 9, y = 3
Therefore the correct answer is x = 9 where as y = 3