Sally and Marta had the same number of postcards. After Sally sold 18 pf her cards, Marta had 4 times as many postcards as Sally. How many postcards did each girl have to begin with?

Let's assume the number of postcards Sally and Marta initially had is "x".

After Sally sold 18 postcards, the number of postcards she had left is "x - 18".

According to the problem, Marta had 4 times as many postcards as Sally, so Marta had 4 * (x - 18) postcards.

Since both Sally and Marta initially had the same number of postcards, we can set up an equation:

x = 4 * (x - 18)

Let's solve this equation step-by-step:

1. Distribute the 4 to both terms inside the parentheses:
x = 4x - 72

2. Move the "4x" term to the left side by subtracting 4x from both sides:
x - 4x = -72

Combine like terms:
-3x = -72

3. Divide both sides of the equation by -3 to solve for x:
-3x/-3 = -72/-3
x = 24

So, both Sally and Marta initially had 24 postcards each.

To solve this problem, let's assign variables to represent the number of postcards Sally and Marta had initially.

Let's say the number of postcards they both had is "x".

According to the problem, after Sally sold 18 postcards, Marta had 4 times as many postcards as Sally. This can be expressed as:

(x - 18) = 4 * (x)

Now let's solve for x:

x - 18 = 4x

Rearranging the equation, we get:

0 = 4x - x - 18

Combining like terms, we have:

0 = 3x - 18

Adding 18 to both sides, we get:

18 = 3x

Dividing both sides by 3, we find:

x = 6

Therefore, both Sally and Marta had 6 postcards initially.