Using proportion...
length of barn length of tree
-------------------------------- = --------------------------------
length of barn's shadow length of tree's shadow
20 x
---- = ---
12 8
Using cross-multiplication...
20 x 8 = 12x
160 = 12x
x = 13 1/3 or 13.3333
The tree is 13 1/3 meters long.