Alice and Bob each have a certain amount of money. If Alice receives n dollars from Bob, then she will have 7 times as much money as Bob. If, on the other hand, she gives n dollars to Bob, then she will have 2 times as much money as Bob. If neither gives the other any money, what is the ratio of the amount of money Alice has to the amount Bob has?

Let A be the amount of money Alice has and let B be the amount of money Bob has.

From the first statement, we have the equation A + n = 7(B - n)
Expanding and simplifying this equation gives A + n = 7B - 7n, or A + 8n = 7B
From the second statement, we have the equation A - n = 2(B + n)
Expanding and simplifying this equation gives A - n = 2B + 2n, or A - 2n = 2B
We can solve this system of equations for A and B by adding the two equations:
(A + 8n) + (A - 2n) = 7B + 2B
Simplifying, we get 2A + 6n = 9B
We can further simplify this equation to get A = (9/2)B - 3n
If neither gives the other any money, then n = 0 and we have A = (9/2)B.
Therefore, the ratio of the amount of money Alice has to the amount Bob has is 9:2.

Let's assume that Alice has x dollars, and Bob has y dollars.

According to the given information, if Alice receives n dollars from Bob, she will have 7 times as much money as Bob. This can be expressed as:
x + n = 7(y - n)

Similarly, if Alice gives n dollars to Bob, she will have 2 times as much money as Bob. This can be expressed as:
x - n = 2(y + n)

Now, let's solve these two equations to find the values of x and y.

Expanding the first equation, we get:
x + n = 7y - 7n

Rearranging terms, we have:
x + 8n = 7y

Expanding the second equation, we get:
x - n = 2y + 2n

Rearranging terms, we have:
x - 3n = 2y

Now we have a system of equations:
x + 8n = 7y
x - 3n = 2y

To eliminate x, let's multiply the second equation by 4:
4(x - 3n) = 4(2y)
4x - 12n = 8y

Now, subtract the first equation from this new equation:
(4x - 12n) - (x + 8n) = 8y - 7y
4x - x - 12n - 8n = y

Simplifying the equation, we have:
3x - 20n = y

Since Alice and Bob don't give each other any money, we can set n = 0 in the equation above:
3x - 20(0) = y
3x = y

So, we find that y = 3x, which means the ratio of the amount of money Alice has to the amount Bob has is 3:1.