Sunday, 18 December 2016

Splendid Matrices

A Splendid Matrix of order N is a special kind of matrix having dimensions 2N X 2N filled in a specific manner. Splendid Matrices of order 1, 2 and 3 are shown below-
Splendid Matrix of order 1

1   2
3   4


Splendid Matrix of order 2

1   2   5   6
3   4   7   8
9   10  13  14
11  12  15  16


Splendid Matrix of order 3

1   2   5   6   17  18  21  22
3   4   7   8   19  20  23  24
9   10  13  14  25  26  29  30
11  12  15  16  27  28  31  32
33  34  37  38  49  50  53  54
35  36  39  40  51  52  55  56
41  42  45  46  57  58  61  62
43  44  47  48  59  60  63  64
Can you state an algorithm to construct a Splendid Matrix of order N? 

Without constructing a Splendid Matrix of order N, how would you go about finding the location (i.e. the row and column nos. of the matrix) of a given value in [1..4N]. 

Conversely, given a location i.e. a row and column no. pair (R,C) such that R and C lie in the interval [1..2N], how would you find the value at that location, again, without constructing the matrix?

View Solution: Solution To "Splendid Matrices"


No comments:

Post a Comment