x - the number of pencils
y - the number of pens
She has twice as many pencils as she has pens.
\(x=2y\)
Tom borrows a pen, so she has y-1 pens. Now she has ten less pens than pencils.
\(x-10=y-1 \\
x=y-1+10 \\
x=y+9\)
Set 2y and y+9 equal to each other:
\(2y=y+9 \\
2y-y=9 \\
y=9\)
She has 9 pens.