In how many ways can we fill a 4 X 4 grid where each cell co
In how many ways can we fill a 4 X 4 grid, where each cell contains either 0 or 1, and the sum of each row and each column is an even number?
Solution
Solution:- Given that a grid contains 4rows and 4columns. First fill 3 rows arbitrarily with 0 or 1.
Given that, sum of each row and each coloumn is even.
There are 23 ways to do it for each row, for a total of (23)2=26.
Now, fill the last row to make all coloumn sums even,There is a unique way to do this.
Since n is even, the sum of first three rows is even, so again last row sum is also even.
4X4 grid contains 4 rows and 4 coloumns,thus a magic square of order 4 always contains 42 numbers.
The constant, that is the sum of every row , coloumn and diagonal is called magic constant (M) or magic sum.
Every normal sqaure has a constant dependent on n, calculated by the formula M=n(n2+1) /2
Here, the given grid is a 4X4, which means n=4, so magic sum is 4(42+1) /2= 4(17) /2=34.
