Lets do it this way

Find the total number of ways you can paint the wall.

Then find the number of favorable cases over the total cases.

So lets have walls

1 (3 ways to paint it red, green or blue)

2 (3 ways)

3 (3 ways)

4 (3 ways)

5 (3 ways)

So 3^5 = 243 total ways you can paint it

Now we try to find the number of ways we can paint it that has no two adjacent walls that are same color

1 (3 ways to paint it red, green, or blue)

2 (2 ways to paint it, different than first one)

3 (2 ways to paint it, different than second one)

4 (2 ways to paint it, different than third one)

5 ( 1 way to paint it different than first and fourth)

So 3 * 2 * 2 * 2 * 1 = 24

HOWEVER, the above example is when the first wall is DIFFERENT than the fourth wall.

So we also have to add cases where they are the same.

1 (3 ways to paint it red, green, or blue)

2 (2 ways to paint it, different than first one)

3 (2 ways to paint it, different than second one)

4 (1 ways to paint it, same as first)

5 ( 2 ways to paint it, because the first and fourth are the same)

So 3 * 2 * 2 * 1 * 2 = 24

So 24 + 24 = 48 ways to paint it with no adjacent wall same

48/243 = 16/81

The answer is \(\boxed{\frac{16}{81}}\)??????? Someone check this