In a table, there are 3 rows with 3 square in each row.

Mary wishes to fill some colors into the blocks.

Now only red, blue and green colors are available, find the number of ways to fill the table if no adjacent blocks are filled with the same color.

Thanks.

To find the number of ways to fill the table with the given conditions, we can use the concept of permutations with restrictions.

Let's analyze each row separately:

In the first row, Mary has 3 choices for coloring the first square. In the second row, she has 2 choices for coloring the first square, as it cannot have the same color as the square above it. In the third row, she again has 2 choices for coloring the first square.

Following the same reasoning, for all 3 rows, Mary has 3 choices for coloring the second square and 2 choices for coloring the third square.

To find the total number of ways, we need to multiply the number of choices for each square together. So, the total number of ways to fill the table without any adjacent blocks having the same color is:

3 (choices for the first square in the first row) * 2 (choices for the second square in the first row) * 3 (choices for the first square in the second row) * 2 (choices for the second square in the second row) * 3 (choices for the first square in the third row) * 2 (choices for the second square in the third row) = 3 * 2 * 3 * 2 * 3 * 2 = 72

Thus, there are 72 ways to fill the table with the given conditions.