1. You can set up 2 equations like so:

You can then subsitute the y in the second equation with the first one.

And then you can multiply both sides by the reciprocal of 5/3.

Then you can put this x into one of the equations to get the y like so:

So your two numbers would be 18 and 27.
2. This is going to be similar to the first problem so I will cut down on the descriptions and just show the work.

Subsitute again.

Subtract 5.

Plug 6 back into one of the equations.

Your two numbers are 11 and 6.
3. This is a bit more complicated but the same logic applies here.

Subsitute again and solve for x.

Then plug it in again.

Your two numbers are 2 and 10.
4. For this one, I'm going to have the $1 bills as y and the $5 bills as x.

Subsitute and solve for x.

Plug x back into an equation.

Thus, Dan has 40 $1 bills and 8 $5 bills. I hope this helps.