Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+5 votes

"where the digit displayed in each square is the absolute value of the difference between that square's row number and its column number?"

asked in CSC201 Spring 2021 by (1 point)

3 Answers

+3 votes

Every number shown is the positive difference between the numbers for row and column for that number's location

Look at column 3 row 2. There is a 1 shown there because 3-2 is 1.

Look at row 4 column 1. There is a 3 shown there because 4-1 is 3.

(Hint: the answer takes a similar form to the house warm-up puzzle From Friday.)

answered by (1.2k points)
+2

Thank you so much! :)

+3 votes

for example:
Suppose the output is:

      ` 01234
        10123
        21012
        32101
        43210 `

In row 1, column 1, you get 0 because abs(1-1)=0.
In row 1, column 2, you get 1 because abs(1-2)=1.
In row 2, column 3, you get 1 because abs(2-3)=1
In row 4, column 1, you get 3 because abs(4-1)=3

answered by (1 point)
+2

Thank you!

+3 votes

That could be explained like every shown number in the sequence of each row is the absolute value of subtraction between numbers in a row and its column.
For example:
Row 1 & Column 1 => |1-1| = 0 shown in the first line of sequence.
Row 1 & Column 2 =>|2-1|=1 shown in the second line of sequence.
Row 4 & Column 3 =>|3-4|=1 shown in the third line of sequence.
Row 2 & Column 4 =>|2-4|=2 shown in the fouth line of sequence.
That's how it works! Hope this helps!

answered by (1 point)
+2

Thank you!

...