In a department store, there were a certain number of red T-shirts, blue T-shirts, and yellow T-shirts. 3/7 of the T-shirts were red, 1/3 of them were blue and the rest were yellow. If there were 20 more red T-shirts than blue T-shirts, how many yellow T-shirts were there?

Let the number of T-shirts be

R, B, Y
R=(3/7)(R+B+Y)...(1)
B=(1/3)(R+B+Y)...(2)
Y=(1-3/7-1/3)(R+B+Y)...(3)
=(5/21)(R+B+Y)
R-B=20 ...(4)

Start with the last equation (4):
(3/7-1/3)(R+B+Y)=20
2/21(R+B+Y)=20
Solve for (R+B+Y), I get 210.

Substitute (R+B+Y)=210 into (1), (2) and (3) to get the number of t-shirts of each colour.

To solve this problem, let's break it down step by step.

Step 1: Define the variables.
Let's use the following variables:
R = number of red T-shirts
B = number of blue T-shirts
Y = number of yellow T-shirts

Step 2: Set up equations using the given information.
From the problem, we have three pieces of information:
1) 3/7 of the T-shirts were red, so we can write the equation R = (3/7) * (R + B + Y).
2) 1/3 of the T-shirts were blue, so we can write the equation B = (1/3) * (R + B + Y).
3) There were 20 more red T-shirts than blue T-shirts, so we can write the equation R = B + 20.

Step 3: Solve the system of equations.
We have three equations with three variables, so we can solve this system of equations using substitution or elimination method.

Let's start by substituting the value of R from the third equation into the first equation:
B + 20 = (3/7) * (B + 20 + B + Y)

Next, simplify the equation:
B + 20 = (3/7) * (2B + 20 + Y)
B + 20 = (6/7) * B + (6/7) * 20 + (3/7) * Y
B + 20 = (6/7) * B + 120/7 + (3/7) * Y

Now, let's solve for Y by multiplying through by 7 to get rid of the denominators:
7B + 140 = 6B + 120 + 3Y
7B - 6B = 120 - 140 + 3Y
B = -20 + 3Y

Next, we substitute the value of B in terms of Y into the second equation:
-20 + 3Y = (1/3) * (B + 20 + B + Y)
-20 + 3Y = (1/3) * (2B + 20 + Y)
-20 + 3Y = (2/3) * B + (2/3) * 20 + (1/3) * Y
-20 + 3Y = (2/3) * B + 40/3 + (1/3) * Y

Again, we solve for Y by multiplying through by 3 to get rid of the denominators:
-60 + 9Y = 2B + 40 + Y
-60 + 9Y = 2(-20 + 3Y) + 40 + Y
-60 + 9Y = -40 + 6Y + 40 + Y
-60 + 9Y = 7Y

Rearrange the equation to solve for Y:
9Y - 7Y = 60
2Y = 60
Y = 60/2
Y = 30

Therefore, there were 30 yellow T-shirts in the department store.