-
Notifications
You must be signed in to change notification settings - Fork 0
/
sasquare.tex
1940 lines (1781 loc) · 89.5 KB
/
sasquare.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[letterpaper, twoside,12pt]{book}
\usepackage[backend=biber,style=apa,autocite=inline]{biblatex}
\DeclareLanguageMapping{english}{english-apa}
\addbibresource{sasquare.bib}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphics}
\usepackage{float}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, calc, matrix, fit}
\usepackage{nicematrix}
\usepackage{colortbl}
\setlength{\parskip}{1em}
\title{Single Array Square Grid (SASQUARE)}
\date{2021-04-28}
\author{Kurt M. Ma. Coll}
\begin{document}
\pagenumbering{gobble}
\maketitle
\newpage
\chapter*{Acknowledgement} % (fold)
\label{cha:acknowledgement}
To my friends and family. To my dad, Demosthenes Jr.
% chapteracknowledgement (end)
\pagenumbering{roman}
\newpage
\tableofcontents
\newpage
\chapter*{Introduction}
In computer science, a developer uses an array to represent a series of elements of the same data type such as integers or characters. It is a data structure that holds a list of elements; each of the elements is indexed to determine its position in the list. In mathematics, the best way to represent an array is to create a row vector, a matrix with only one row. We will use a matrix because a set is unordered and does not use indices to ordinally label its elements.
When representing an n-by-n or a square grid using arrays, a developer will intuitively use two-dimensional arrays to represent the rows and columns. In each array that represents a row, there are arrays that represent different columns. However, we can represent a square grid with only one array that can later be translated into a two-dimensional array.
This paper aims to illustrate the conversion of a row vector with a perfect square number of elements into a perfect square matrix or vice-versa to represent a square grid.
\newpage
\pagenumbering{arabic}
\setcounter{chapter}{-1}
\chapter{Preliminaries}
Most of the following equations in this book are heavily reliant on the ceiling and floor functions. These two functions are used to approximate a number by an integer (\cite{iverson_notation}). We will use his notations for the ceiling function and the floor function.
\section{The Ceiling Function}
We will denote the application of the ceiling function on a rational number like this:
\begin{equation}
y = \left\lceil x \right\rceil
\end{equation}
Let $x$ be any rational number. The value of $y$ will be equal to $x$ only when $x$ is also an integer or a whole number, having no fractional parts or its decimal part is 0. If $x$ is a positive rational number, we will remove its fractional part or turn its decimal part into zero, then we will add 1. If $x$ is a negative rational number, we will just simply remove the fractional part or turn the decimal part into zero.
The number 3.14 is a rational number and has a decimal part of .14, we will remove the decimal part of 3.14 and add 1 to it.
\begin{equation*}
y = \left\lceil 3.14 \right\rceil = 4
\end{equation*}
The number $-6\frac{1}{4}$ is a mixed number and has a fractional part of $\frac{1}{4}$, we will remove the fractional part of $-6\frac{1}{4}$ and do nothing else since $-6\frac{1}{4}$ is a negative number.
\begin{equation*}
y = \left\lceil -6\frac{1}{4} \right\rceil = -6
\end{equation*}
Any improper function must first be solved by dividing the numerator by the denominator. Should there be a remainder, we will increment the quotient by 1, otherwise, we leave the quotient as is.
\begin{equation*}
\begin{split}
y &= \left\lceil \frac{24}{5} \right\rceil \\
y &= \left\lceil 4\frac{4}{5} \right\rceil \\
y &= 5
\end{split}
\end{equation*}
The number $\frac{-49}{5}$ is a negative rational number. The division must be done first. We will just retain the quotient for it is a negative number; the result will be -9.
\begin{equation*}
\begin{split}
y &= \left\lceil \frac{-49}{5} \right\rceil \\
y &= \left\lceil -9\frac{4}{5} \right\rceil \\
y &= -9
\end{split}
\end{equation*}
Whether the number is positive or negative, as long as it is an integer, we will leave it as is.
\begin{equation*}
\begin{split}
y &= \left\lceil 69.0 \right\rceil = 69\\
y &= \left\lceil -69.0 \right\rceil = -69\\
\end{split}
\end{equation*}
\section{The Floor Function}
The floor function is the opposite of the ceiling function. We will denote it like this:
\begin{equation}
y = \left\lfloor x \right\rfloor
\end{equation}
Should $x$ be an integer, we will leave it as is. However, should it be a positive rational number, we will just turn its decimal part into 0 or remove the fractional part. Should it be a negative rational number, not only we will remove the fractional part but we will also subtract 1 from it.
We simply turned the decimal part into 0 since 3.14 is a positive rational number.
\begin{equation*}
y = \left\lfloor 3.14 \right\rfloor = 3
\end{equation*}
The number $-6\frac{1}{4}$ is a negative mixed number, we removed its fractional part and subtracted 1 from -6.
\begin{equation*}
y = \left\lfloor -6\frac{1}{4} \right\rfloor = -7
\end{equation*}
Any improper function must first be solved by dividing the numerator by the denominator. Should there be a remainder, it will be just ignored and the whole part will be the result.
\begin{equation*}
\begin{split}
y &= \left\lfloor \frac{24}{5} \right\rfloor \\
y &= \left\lfloor 4\frac{4}{5} \right\rfloor \\
y &= 4
\end{split}
\end{equation*}
Should there be a remainder and the mixed number itself is negative, we will subtract 1 from the whole number as a result.
\begin{equation*}
\begin{split}
y &= \left\lfloor \frac{-49}{5} \right\rfloor \\
y &= \left\lfloor -9\frac{4}{5} \right\rfloor \\
y &= -10
\end{split}
\end{equation*}
Whether the number is positive or negative, as long as it is an integer, we will leave it as is.
\begin{equation*}
\begin{split}
y &= \left\lfloor 69.0 \right\rfloor = 69\\
y &= \left\lfloor -69.0 \right\rfloor = -69\\
\end{split}
\end{equation*}
\section{Floor and Ceiling of a Zero Whole Part Number}
The equations $\left\lceil x \right\rceil = 1$ and $\left\lfloor x \right\rfloor = 0$ are true when $0 < x < 1$ and $x$ is a rational number.
The equations $\left\lceil x \right\rceil = 0$ and $\left\lfloor x \right\rfloor = 1$ are true when $-1 < x < 0$ and $x$ is a rational number.
\newpage
\chapter{The Square Grid} \label{1_square_grid}
We will represent a single array with square number of indices using a row vector. The array elements shall be indexed from 1 up to the number of elements.\footnote{Programming languages, such as Python or C, often start their array indices from 0 rather than 1. Since this is a math paper, we will start with 1}
\begin{figure}[ht]
\centering
\resizebox{\textwidth}{!}{%
\begin{tikzpicture} [nodes in empty cells,
nodes={minimum width=0.5cm, minimum height=0.5cm},
row sep=-\pgflinewidth, column sep=-\pgflinewidth]
% border/.style={draw}
\matrix(vector)[matrix of nodes, ampersand replacement=\&, % <- added ampersand replacement
row 1/.style={nodes={draw=none, minimum width=0.3cm}},
nodes={draw}]
{ % use \& instead of & as column separator
\tiny{1} \& \tiny{2} \& \tiny{3} \& \tiny{4} \& \tiny{5} \& \tiny{6} \& \tiny{7} \& \tiny{8} \& \tiny{9}\\
\& \& \& \& \& \& \& \& \\
};
\end{tikzpicture}%
}
\caption{A grid representation of a single array} \label{1f1}
\end{figure}
\begin{figure}[ht]
\centering
\resizebox{\textwidth}{!}{$
A =
\begin{bmatrix}
a_{1,1} & a_{1,2} & a_{1,3} & a_{1,4} & a_{1,5} & a_{1,6} & a_{1,7} & a_{1,8} & a_{1,9}
\end{bmatrix}
$}
\caption{The array is represented as a row vector} \label{row_vector_form}
\end{figure}
Let $i_n$ be an array element of sequence $I$; this is the notation for an ordered list of numbers. Since the row vector has only one row, we will use this indexing notation to represent an element of the row vector. For example, we will represent the 7th element of the array as $i_7$ which is $a_{1,7}$ when indexed as an element of a row vector. The sequence form of the array in Figure \ref{row_vector_form} is:
\begin{equation}
A = (i_1,i_2,i_3,i_4,i_5,i_6,i_7,i_8,i_9)
\end{equation}
\section{The Base of the Square} \label{base}
The \textbf{base} of a square is the root of the square. We will use it in most of the following expressions to determine particular parts of a square grid. Throughout the paper, we'll represent the base as $b$.
Let $b^2$ be any natural number. The root of a perfect square can be positive or negative; for the sake of simplicity, we will use positive bases only. The number of elements in a matrix or an array is always an integer.
\section{The Cells} \label{cells}
The \textbf{cells} are the basic building blocks of a grid. Since a square matrix can be thought of as a grid, we will call the elements of an array or a matrix as cells. The number of cells in a square grid counts from 1 up to $b^2$ in either its row vector form or its square matrix form. We shall use integers to index each cell and call each index a \textbf{cell index}.
\begin{equation}
(i_n)^{b^2}_{n\in\mathbb{Z}^+} = (i_1, i_2, \dots ,i_{b^2})
\end{equation}
A square grid has rows and columns. The total number of rows in a square grid is equals to $b$ which is also equal to the total number of columns in a square grid. We will index $b$ number of rows from 1 to $b$; we will call this each index a \textbf{row index}. We will also do the same to the $b$ number of columns and call each index a \textbf{column index}. The aforementioned indices are all natural numbers. Usually an array is expressed as $A_{m \times n}$ or $A_{r \times c}$ in algebra to show the number of rows and columns explicitly.
\begin{figure}[ht]
\centering
\begin{minipage}{0.45\textwidth}
\centering
\begin{tikzpicture}
\matrix[matrix of nodes, nodes={minimum size=1cm, draw, anchor=center}, row sep=-\pgflinewidth, column sep=-\pgflinewidth](mygrid){%
$i_1$ & $i_2$ & $i_3$ \\
$i_4$ & $i_5$ & $i_6$ \\
$i_7$ & $i_8$ & $i_9$ \\
};
\end{tikzpicture}
\end{minipage}
\begin{minipage}{0.45\textwidth}
\centering
\begin{tikzpicture}
\matrix[matrix of nodes, nodes={minimum size=1cm, draw, anchor=center}, row sep=-\pgflinewidth, column sep=-\pgflinewidth](mygrid){%
$a_{1,1}$ & $a_{1,2}$ & $a_{1,3}$ \\
$a_{2,1}$ & $a_{2,2}$ & $a_{2,3}$ \\
$a_{3,1}$ & $a_{3,2}$ & $a_{3,3}$ \\
};
\end{tikzpicture}
\end{minipage}
\caption{Two square grids are labeled differently, they are indexed as elements of a sequence and a matrix respectively} \label{2forms1grid}
\end{figure}
In Figure \ref{2forms1grid}, the base of the square grids is 3 and the total number of cells is 9. In matrix notation, the rows and columns are indexed accordingly. We denote the elements of the right grid with $a_{r,c}$ where $r$ is the row index and $c$ is the column index. In this example, we assume that both grids represent the same array.
\section{The Rows} \label{rows}
The \textbf{rows} are the horizontal arrangement of elements in a matrix. In a row, there are $b$ number of cells. We shall denote a row index as $a_{r,*}$. We shall use function $r$ to determine the row of cell index $n$ in a square grid of base $b$.
\begin{equation}
r(b,n) = \left\lceil \frac{n}{b} \right\rceil
\end{equation}
We can use the function to determine which multiple of $b$ is \emph{higher} than and nearest to cell $n$ by multiplying its results to $b$. All the rightmost cells of the grid is always indexed with a number divisible by $b$. Let $a_{r,b}$ the rightmost cell index of a row.
\begin{equation}
a_{r,b} = b\left\lceil \frac{n}{b} \right\rceil
\end{equation}
\section{The Columns} \label{columns}
The \textbf{columns} are the vertical arrangement of elements in a matrix. In a column, there are $b$ number of cells. We shall denote a column index as $a_{*,c}$. To find the column where a cell belongs, we must first identify the row where it belongs and find the rightmost cell of the row. After finding the rightmost cell of the row, we shall subtract it from the sum of the cell index $n$ and the base. We shall use function $c$.
\begin{equation}
c(b,n) = n + b - b\left\lceil \frac{n}{b} \right\rceil
\end{equation}
All the rightmost cells belong in column index $b$ which is represented as $a_{*,b}$.
\newpage
\section{Example: Row and Column of Cell 17 in 5-Square}
\label{1_example_1}
\begin{figure*}[ht]
\centering
\setcounter{MaxMatrixCols}{25}
\tikzset{highlight/.style={
rectangle,
fill=gray!55,
blend mode = multiply,
rounded corners = 0.7 mm,
inner sep=1pt,
fit = #1}
}
\centering
$I_5 =$
\resizebox{\textwidth}{!}{$
\begin{bNiceMatrix}
i_{1} & i_{2} & i_{3} & i_{4} & i_{5} & i_{6} & i_{7} & i_{8} & i_{9} & i_{10} & i_{11} & i_{12} & i_{13} & i_{14} & i_{15} & i_{16} & i_{17} & i_{18} & i_{19} & i_{20} & i_{21} & i_{22} & i_{23} & i_{24} & i_{25}
\CodeAfter
\tikz \node [highlight=(1-17)] {};
\end{bNiceMatrix}
$}
\end{figure*}
The row vector $I$ is a square grid of base 5; to which row does cell $i_{17}$ belong to and what is the rightmost cell in that row? We shall start by using function $r$.
\begin{equation*}
\begin{split}
r(b,n) &= \left\lceil \frac{n}{b} \right\rceil \\
r(5,17) &= \left\lceil \frac{17}{5} \right\rceil \\
&= 4
\end{split}
\end{equation*}
Cell 17 belongs to row 4 . We shall substitute 4 to $r$ and 5 to $b$ in $a_{r,b}$.
\begin{equation*}
\begin{split}
a_{r,b} &= b\left\lceil \frac{n}{b} \right\rceil \\
a_{4,5} &= 5(4) \\
a_{4,5} &= 20 \\
\end{split}
\end{equation*}
The index of the rightmost cell of row 4 is 20; Cell $i_{17}$ and $i_{20}$ belong together in the same row. Next, we shall determine which column $i_{17}$ belongs to.
\begin{equation*}
\begin{split}
c(b,n) &= n + b - b\left\lceil \frac{n}{b} \right\rceil \\
c(5,17) &= 17 + 5 - 5\left\lceil \frac{17}{5} \right\rceil \\
&= 17 + 5 - 5(4) \\
&= 17 + 5 - 20 \\
&= 22 - 20 \\
c(5,17) &= 2
\end{split}
\end{equation*}
\newpage
If $i_{17}$ belongs to row $a_{4,*}$ and column $a_{*,2}$, then $i_{17} = a_{4,2}$.
\begin{figure*}[ht]
\centering
\begin{minipage}{0.45\textwidth}
\setcounter{MaxMatrixCols}{5}
\tikzset{highlight/.style={
rectangle,
fill=gray!55,
blend mode = multiply,
rounded corners = 0.7 mm,
inner sep=1pt,
fit = #1}
}
\centering
\resizebox{\textwidth}{!}{$
I =
\begin{bNiceMatrix}
i_{1} & i_{2} & i_{3} & i_{4} & i_{5} \\
i_{6} & i_{7} & i_{8} & i_{9} & i_{10} \\
i_{11} & i_{12} & i_{13} & i_{14} & i_{15} \\
i_{16} & i_{17} & i_{18} & i_{19} & i_{20} \\
i_{21} & i_{22} & i_{23} & i_{24} & i_{25}
\CodeAfter
\tikz \node [highlight=(4-2)] {};
\end{bNiceMatrix}
$}
\end{minipage}
\hfill
\begin{minipage}{0.45\textwidth}
\tikzset{
highlight/.style={
rectangle,
fill=gray!55,
blend mode = multiply,
rounded corners = 0.7 mm,
inner sep=1pt,
fit = #1
}
}
\centering
\resizebox{\textwidth}{!}{$
=
\begin{bNiceMatrix}
a_{1,1} & a_{1,2} & a_{1,3} & a_{1,4} & a_{1,5} \\
a_{2,1} & a_{2,2} & a_{2,3} & a_{2,4} & a_{2,5} \\
a_{3,1} & a_{3,2} & a_{3,3} & a_{3,4} & a_{3,5} \\
a_{4,1} & a_{4,2} & a_{4,3} & a_{4,4} & a_{4,5} \\
a_{5,1} & a_{5,2} & a_{5,3} & a_{5,4} & a_{5,5}
\CodeAfter
\tikz \node [highlight=(4-2)] {};
\end{bNiceMatrix}
$}
\end{minipage}
\end{figure*}
\newpage
\chapter{The Intersection} \label{intersection}
All cells belong to only one row and one column, hence $i_n$ can become $a_{r,c}$. An \textbf{intersection} is where a row and a column meet; they can only meet in one cell. The result of an intersection can be represented as either $i_n$ or $a_{r,c}$. As long as $r=c$ in matrix $A_{r \times c}$, any given pair of row and column index will always have an intersection.
If we can determine the row and column index of a cell index with a given base, we can also determine the cell index that results of intersection a row and a column. To do so, we'll use the function $i$ which can be expressed in three ways. Let $r$ and $c$ be the row and column index respectively.
\begin{equation}
\begin{split}
i(b,r,c) &= b(r-1) + c \\
&= br + (b - c) \\
&= br - b + c \\
\end{split}
\end{equation}
In the first expression, the part $b(r-1)$ highlights the first $r$ rows where only $c$ number of cells are only highlighted on the last row. The second expression, highlights the $r$ number of rows then the last $(b - c)$ number of cells will be un-highlighted thereafter. The last one is the simplest form amongst the expressions.
In the only example of Chapter \ref{1_square_grid} (Section \ref{1_example_1}), we used the functions $r$ and $c$ to determine the matrix notation for $i_{17}$ which is $a_{4,2}$. Cell index 17 belongs to row index 4 and column index 2. We shall use function $i$ to test if the intersection of $a_{4,*}$ and $a_{*,2}$ is $i_{17}$ when the $b$ is 5.
\begin{equation*}
\begin{split}
i(b,r,c) &= br - b + c \\
i(5,4,2) &= (5)(4) - (5) + (2) \\
&= 20 - 5 + 2 \\
&= 15 + 2 \\
i(5,4,2) &= 17
\end{split}
\end{equation*}
This function can be used to enumerate the cells in a chosen row or column.
\section{Cells of a Row} \label{row_cells}
To enumerate the cells of a row, we will use the Intersection function $i$. A row shall be considered a set of cell indices. Per Chapter \ref{1_square_grid}, the number of cells in a certain row is always $b$.
\begin{equation}
\begin{split}
i(b,r,c) &= br - b + c \\
a_{r,*}b &= \{ i(b,r,c) : c \in (1, \dots, b) \}
\end{split}
\end{equation}
The expression $a_{r,*}b$ simply means `Row $r$ of $b$-square'. Numbers $b$ and $r$ are constants inside the set builder notation.
\section{Cells of a Column} \label{column_cells}
To enumerate the cells of a column, we will use the Intersection function $i$. Just like a row, a column is also a set of cell indices. Just like rows, a column has only $b$ number of cells.
\begin{equation}
\begin{split}
i(b,r,c) &= br - b + c \\
a_{*,c}b &= \{ i(b,r,c) : r \in (1, \dots, b) \}
\end{split}
\end{equation}
The expression $a_{*,c}b$ simply means `Column $c$ of $b$-square'. Numbers $b$ and $c$ are constants inside the set builder notation.
\section{Example: The Cells of Row 4 and Column 2 in 5-square} \label{2_example_1}
To enumerate the cell indices of $a_{4,*}5$ we shall use function $i$ in a set builder notation where $r$ and $b$ is constant.
\begin{equation*}
\begin{split}
i(b,r,c) &= br - b + c \\
a_{r,*}b &= \{ i(b,r,c) : c \in (1, \dots, b) \} \\
a_{4,*}5 &= \{ i(5,4,c) : c \in (1,2,3,4,5) \} \\
\\
i(5,4,1) &= (5)(4) - 5 + 1 = 16 \\
i(5,4,2) &= (5)(4) - 5 + 2 = 17 \\
i(5,4,3) &= (5)(4) - 5 + 3 = 18 \\
i(5,4,4) &= (5)(4) - 5 + 4 = 19 \\
i(5,4,5) &= (5)(4) - 5 + 5 = 20 \\
a_{4,*}5 &= \{16, 17, 18, 19, 20 \} \\
\end{split}
\end{equation*}
The set $a_{4,*}5$ has cell indices $i_{16}, i_{17}, i_{18}, i_{19}$, and $i_{20}$.
To enumerate the cell indices of $a_{*,2}5$ we shall use function $i$ in a set builder notation where $c$ and $b$ is constant.
\begin{equation*}
\begin{split}
i(b,r,c) &= br - b + c \\
a_{r,*}b &= \{ i(b,r,c) : r \in (1, \dots, b) \} \\
a_{4,*}5 &= \{ i(5,r,2) : r \in (1,2,3,4,5) \} \\
\\
i(5,1,2) &= (5)(1) - 5 + 2 = 2 \\
i(5,2,2) &= (5)(2) - 5 + 2 = 7 \\
i(5,3,2) &= (5)(3) - 5 + 2 = 12 \\
i(5,4,2) &= (5)(4) - 5 + 2 = 17 \\
i(5,5,2) &= (5)(5) - 5 + 2 = 22 \\
a_{*,2}5 &= \{2, 7, 12, 17, 22 \} \\
\end{split}
\end{equation*}
The set $a_{*,2}5$ has cell indices $i_{2}, i_{7}, i_{12}, i_{17}$, and $i_{22}$.
Set $a_{4,*}5$ and set $a_{*,2}5$, will always meet at one cell; all pairs of $a_{r,*}b$ and $a_{*,c}b$ shall always have an intersection.
\begin{equation*}
\begin{split}
a_{4,*}5 &= \{16, 17, 18, 19, 20 \} \\
a_{*,2}5 &= \{2, 7, 12, 17, 22 \} \\
a_{4,*}5 \cap a_{*,2}5 &= \{17\}
\end{split}
\end{equation*}
The intersection of $a_{4,*}5$ and $a_{*,2}5$ is $i_{17}$ or $a_{4,2}$.
\begin{figure*}[ht]
\centering
\begin{minipage}{0.45\textwidth}
\setcounter{MaxMatrixCols}{5}
\tikzset{row_hl/.style={
line width=0.8pt,
draw=gray!80,
rectangle,
fill=gray!55,
blend mode = multiply,
rounded corners = 0.7 mm,
inner sep=1pt,
fit = #1}
}
\tikzset{col_hl/.style={
rectangle,
fill=black!45,
blend mode = multiply,
rounded corners = 0.7 mm,
inner sep=1pt,
fit = #1}
}
\centering
\resizebox{\textwidth}{!}{$
I =
\begin{bNiceMatrix}
i_{1} & i_{2} & i_{3} & i_{4} & i_{5} \\
i_{6} & i_{7} & i_{8} & i_{9} & i_{10} \\
i_{11} & i_{12} & i_{13} & i_{14} & i_{15} \\
i_{16} & i_{17} & i_{18} & i_{19} & i_{20} \\
i_{21} & i_{22} & i_{23} & i_{24} & i_{25}
\CodeAfter
\tikz \node [row_hl=(4-1)(4-5)] {};
\tikz \node [col_hl=(1-2)(5-2)] {};
\end{bNiceMatrix}
$}
\end{minipage}
\hfill
\begin{minipage}{0.45\textwidth}
\tikzset{row_hl/.style={
line width=0.8pt,
draw=gray!80,
rectangle,
fill=gray!55,
blend mode = multiply,
rounded corners = 0.7 mm,
inner sep=1pt,
fit = #1}
}
\tikzset{col_hl/.style={
rectangle,
fill=black!45,
blend mode = multiply,
rounded corners = 0.7 mm,
inner sep=1pt,
fit = #1}
}
\centering
\resizebox{\textwidth}{!}{$
=
\begin{bNiceMatrix}
a_{1,1} & a_{1,2} & a_{1,3} & a_{1,4} & a_{1,5} \\
a_{2,1} & a_{2,2} & a_{2,3} & a_{2,4} & a_{2,5} \\
a_{3,1} & a_{3,2} & a_{3,3} & a_{3,4} & a_{3,5} \\
a_{4,1} & a_{4,2} & a_{4,3} & a_{4,4} & a_{4,5} \\
a_{5,1} & a_{5,2} & a_{5,3} & a_{5,4} & a_{5,5}
\CodeAfter
\tikz \node [row_hl=(4-1)(4-5)] {};
\tikz \node [col_hl=(1-2)(5-2)] {};
\end{bNiceMatrix}
$}
\end{minipage}
\end{figure*}
\newpage
\chapter{The Slants} \label{slants}
A \textbf{slant} is a special kind of set of cells. We shall define a slant\footnote{We can also use the word `slope', but some readers may confuse it with the mathematical definition of a slope.} with these traits:
\begin{itemize}
\item None of the cells in the set belong in the same row
\item None of the cells in the set belong in the same column
\item Only one slant has $b$ number of cells; it is the longest slant
\item Unlike rows and columns, different slants have different number of cells
\item Two kinds of slants exist, the \textbf{descending} and \textbf{ascending} slants
\end{itemize}
In a square grid, there are $2b-1$ number of slants of each kind in a square grid. For example, if the square has a base of 5, there shall be 9 slants for each kind. Let $l$ be a function that takes $b$ as an argument to determine the number of slants in a square.
\begin{equation}
\begin{split}
l(b) &= 2b - 1 \\
l(5) &= 2(5) - 1 \\
l(5) &= 9
\end{split}
\end{equation}
\section{The Intersection Sum} \label{intersection_sum}
There are equations that determine the slant a cell belongs to.
By adding the row and the column index of a cell, we do an \textbf{intersection sum}. If two cells have the same intersection sums, they belong in the same ascending slant. Let $\sigma$ be the intersection sum function and $n$ be the cell index number.
\begin{equation}
\begin{split}
\sigma(b,n) &= r(b,n) + c(b,n) \\
r(b,n) &= \left\lceil \frac{n}{b} \right\rceil \\
c(b,n) &= b + n - b\left\lceil \frac{n}{b} \right\rceil \\
\sigma(b,n) &= ( \left\lceil \frac{n}{b} \right\rceil ) + (b + n - b\left\lceil \frac{n}{b} \right\rceil)\\
\sigma(b,n) &= \left\lceil \frac{n}{b} \right\rceil + b + n - b\left\lceil \frac{n}{b} \right\rceil\\
\end{split}
\end{equation}
The intersection sum is crucial to finding all the ascending slants in a square grid.
\begin{figure}[ht]
\centering
{$
\begin{bNiceMatrix}
2 & 3 & 4 & 5 & 6 \\
3 & 4 & 5 & 6 & 7 \\
4 & 5 & 6 & 7 & 8 \\
5 & 6 & 7 & 8 & 9 \\
6 & 7 & 8 & 9 & 10
\end{bNiceMatrix}
$}
\caption{This matrix has elements where $i_{n}b$ = $\sigma(b,n)$. $i_{n}b$ means cell index $n$ of $b$-square.}
\end{figure}
\section{The Intersection Difference} \label{intersection_diff}
To do an \textbf{intersection difference}, we shall subtract the row index of a cell from the column index of the same cell. If two cells have the same intersection difference, they belong in the same descending slant. Let $\delta$ be the intersection difference function and $n$ be the cell index number.
\begin{equation}
\begin{split}
\delta(b,n) &= c(b,n) - r(b,n)\\
r(b,n) &= \left\lceil \frac{n}{b} \right\rceil \\
c(b,n) &= b + n - b\left\lceil \frac{n}{b} \right\rceil \\
\delta(b,n) &= (b + n - b\left\lceil \frac{n}{b} \right\rceil) - (\left\lceil \frac{n}{b} \right\rceil)\\
\delta(b,n) &= b + n - b\left\lceil \frac{n}{b} \right\rceil - \left\lceil \frac{n}{b} \right\rceil\\
\end{split}
\end{equation}
A \textbf{reverse intersection difference} occurs when we subtract the column index of a cell from the row index of the same cell. Let $\alpha$ be the reverse intersection difference.
\begin{equation}
\begin{split}
\alpha(b,n) &= r(b,n) - c(b,n)\\
r(b,n) &= \left\lceil \frac{n}{b} \right\rceil \\
c(b,n) &= b + n - b\left\lceil \frac{n}{b} \right\rceil \\
\alpha(b,n) &= \left\lceil \frac{n}{b} \right\rceil - (b + n - b\left\lceil \frac{n}{b} \right\rceil)\\
\alpha(b,n) &= \left\lceil \frac{n}{b} \right\rceil - b - n + b\left\lceil \frac{n}{b} \right\rceil
\end{split}
\end{equation}
A reverse intersection difference is a negated version of an intersection difference.
\begin{equation}
\begin{split}
\alpha(b,n) &= -(\delta(b,n))\\
\left\lceil \frac{n}{b} \right\rceil - (b + n - b\left\lceil \frac{n}{b} \right\rceil) &= - ( b + n - b\left\lceil \frac{n}{b} \right\rceil - \left\lceil \frac{n}{b} \right\rceil)\\
\left\lceil \frac{n}{b} \right\rceil - b - n + b\left\lceil \frac{n}{b} \right\rceil &= - b - n + b\left\lceil \frac{n}{b} \right\rceil + \left\lceil \frac{n}{b} \right\rceil\\
\end{split}
\end{equation}
If we rearrange the terms of the right expression:
\begin{equation*}
\left\lceil \frac{n}{b} \right\rceil - b - n + b\left\lceil \frac{n}{b} \right\rceil = \left\lceil \frac{n}{b} \right\rceil - b - n + b\left\lceil \frac{n}{b} \right\rceil
\end{equation*}
The intersection difference is crucial to finding all the descending slants in a square grid.
\begin{figure}[ht]
\centering
\begin{minipage}{0.45\textwidth}
\centering
{$
A =
\begin{bNiceMatrix}
0 & 1 & 2 & 3 & 4 \\
-1 & 0 & 1 & 2 & 3 \\
-2 & -1 & 0 & 1 & 2 \\
-3 & -2 & -1 & 0 & 1 \\
-4 & -3 & -2 & -1 & 0
\end{bNiceMatrix}
$}
\end{minipage}
\hfill
\begin{minipage}{0.45\textwidth}
\centering
{$
B =
\begin{bNiceMatrix}
0 & -1 & -2 & -3 & -4 \\
1 & 0 & -1 & -2 & -3 \\
2 & 1 & 0 & -1 & -2 \\
3 & 2 & 1 & 0 & -1 \\
4 & 3 & 2 & 1 & 0
\end{bNiceMatrix}
$}
\end{minipage}
\caption{Matrix $A$ has elements where $i_{n}b = \delta(b,n)$ whilst matrix B has elements where $i_{n}b = \alpha(b,n)$.}
\end{figure}
\newpage
\section{The Diagonal} \label{diagonal}
A matrix has a special set of elements called a \textbf{diagonal}; it is also called the \textbf{main diagonal} (\cite{weisstein_diagonal}). A diagonal consists of elements where $r = c$. In a square grid, a diagonal is the longest descending slant. Its two end cells are always $a_{1,1}$ and $a_{b,b}$.
\begin{figure}[h]
\tikzset{highlight/.style={
line width=0.8pt,
draw=gray!80,
rectangle,
fill=gray!55,
blend mode = multiply,
rounded corners = 0.7 mm,
inner sep=1pt,
fit = #1}
}
\centering
{$
A =
\begin{bNiceMatrix}
a_{1,1} & a_{1,2} & a_{1,3} & a_{1,4} & a_{1,5} \\
a_{2,1} & a_{2,2} & a_{2,3} & a_{2,4} & a_{2,5} \\
a_{3,1} & a_{3,2} & a_{3,3} & a_{3,4} & a_{3,5} \\
a_{4,1} & a_{4,2} & a_{4,3} & a_{4,4} & a_{4,5} \\
a_{5,1} & a_{5,2} & a_{5,3} & a_{5,4} & a_{5,5}
\CodeAfter
\tikz \node [highlight=(1-1)] {};
\tikz \node [highlight=(2-2)] {};
\tikz \node [highlight=(3-3)] {};
\tikz \node [highlight=(4-4)] {};
\tikz \node [highlight=(5-5)] {};
\end{bNiceMatrix}
$}
\caption{A diagonal is highlighted in a 5-square matrix} \label{fig:diagonal}
\end{figure}
To enumerate the cell indices within the diagonal, we shall use the intersection function $i$ (see Chapter \ref{intersection}) where $r = c$. We shall name the set $D$. For this example, $b = 5$ and $n$ is the nth cell of the diagonal.
\begin{equation}
\begin{split}
i(b,r,c) &= br - b + c \\
D &= \{ i(b,n,n) : n \in (1, \dots, b) \} \\
\\
i(5,1,1) &= (5)(1) - 5 + 1 = 1 \\
i(5,2,2) &= (5)(2) - 5 + 2 = 7 \\
i(5,3,3) &= (5)(3) - 5 + 3 = 13 \\
i(5,4,4) &= (5)(4) - 5 + 4 = 19 \\
i(5,5,5) &= (5)(5) - 5 + 5 = 25 \\
D &= \{1, 7, 13, 19, 25 \} \\
\end{split}
\end{equation}
\section{The Anti-diagonal} \label{antidiagonal}
An \textbf{anti-diagonal} is the opposite of the diagonal. Whilst the diagonal resembles a line going from the top left corner to the bottom right corner of a square, the anti-diagonal cells fall along a line going from the bottom left corner to the upper right corner of the square. (\cite{matte_antidiagonal}). An anti-diagonal has cells where $r = b - c + 1$ where $b$ is the base, where $b = r + c$. The intersection sum of all its cells is always $b + 1$. It is the longest ascending slant. Its two end cells are always $a_{b,1}$ and $a_{1,b}$
\begin{figure}[h]
\tikzset{highlight/.style={
line width=0.8pt,
draw=gray!80,
rectangle,
fill=gray!55,
blend mode = multiply,
rounded corners = 0.7 mm,
inner sep=1pt,
fit = #1}
}
\centering
{$
A =
\begin{bNiceMatrix}
a_{1,1} & a_{1,2} & a_{1,3} & a_{1,4} & a_{1,5} \\
a_{2,1} & a_{2,2} & a_{2,3} & a_{2,4} & a_{2,5} \\
a_{3,1} & a_{3,2} & a_{3,3} & a_{3,4} & a_{3,5} \\
a_{4,1} & a_{4,2} & a_{4,3} & a_{4,4} & a_{4,5} \\
a_{5,1} & a_{5,2} & a_{5,3} & a_{5,4} & a_{5,5}
\CodeAfter
\tikz \node [highlight=(5-1)] {};
\tikz \node [highlight=(4-2)] {};
\tikz \node [highlight=(3-3)] {};
\tikz \node [highlight=(2-4)] {};
\tikz \node [highlight=(1-5)] {};
\end{bNiceMatrix}
$}
\caption{An anti-diagonal is highlighted in a 5-square matrix} \label{fig:antidiagonal}
\end{figure}
To enumerate the cell indices within the anti-diagonal, we shall use the function $\Upsilon$ for finding the nth cell of the anti-diagonal. For this example, we will find the diagonal cell indices in a 5-square.
\begin{equation}
\begin{split}
\Upsilon(b,n) &= b^2 - bn + n \\
A &= \{ \Upsilon(b,n) : n \in (1, \dots, b) \} \\
\\
\Upsilon(5,1) &= 5^2 - (5)(1) + (1) = 21\\
\Upsilon(5,2) &= 5^2 - (5)(2) + (2) = 17\\
\Upsilon(5,3) &= 5^2 - (5)(3) + (3) = 13\\
\Upsilon(5,4) &= 5^2 - (5)(4) + (4) = 9\\
\Upsilon(5,5) &= 5^2 - (5)(5) + (5) = 5\\
A &= \{ 21, 17, 13, 9, 5 \} \\
\end{split}
\end{equation}
\section{The Off-diagonal Cells} \label{offdiagonal_cells}
The \textbf{off-diagonal cells} are the cells not found in the main diagonal. There are two kinds of off-diagonal cells: the \textbf{superdiagonal} and the \textbf{subdiagonal} cells. The superdiagonal cells are above and right of the main diagonal whilst the subdiagonal cells are below and left the main diagonal.
Superdiagonal cells has their row index lower than their column index whilst subdiagonal cells have their row index greater than their column index. Using the intersection difference function (see Section \ref{intersection_diff}), we can determine if a cell belongs to the main diagonal, is a superdiagonal cell, or is a subdiagonal cell. Given that $n$ is a cell index:
\begin{itemize}
\item If $\delta(b,n) < 0$, it is a subdiagonal cell.
\item If $\delta(b,n) > 0$, it is a superdiagonal cell.
\item If $\delta(b,n) = 0$, it belongs to the main diagonal.
\end{itemize}
To further illustrate the superdiagonal and subdiagonal cells, we will show two matrices where the highlighted cells together resembles two triangles.
\begin{figure}[ht]
\centering
\begin{minipage}{0.45\textwidth}
\tikzset{row_hl/.style={
line width=0.8pt,
draw=gray!80,
rectangle,
fill=gray!55,
blend mode = multiply,
inner sep=1pt,
fit = #1}
}
\tikzset{col_hl/.style={
rectangle,
fill=black!45,
blend mode = multiply,
inner sep=1pt,
fit = #1}
}
\centering
{$
\begin{bNiceMatrix}
i_{1} & i_{2} & i_{3} & i_{4} & i_{5} \\
i_{6} & i_{7} & i_{8} & i_{9} & i_{10} \\
i_{11} & i_{12} & i_{13} & i_{14} & i_{15} \\
i_{16} & i_{17} & i_{18} & i_{19} & i_{20} \\
i_{21} & i_{22} & i_{23} & i_{24} & i_{25}
\CodeAfter
\tikz \node [row_hl=(1-2)(1-5)] {};
\tikz \node [row_hl=(2-3)(2-5)] {};
\tikz \node [row_hl=(3-4)(3-5)] {};
\tikz \node [row_hl=(4-5)] {};
\tikz \node [col_hl=(2-1)] {};
\tikz \node [col_hl=(3-1)(3-2)] {};
\tikz \node [col_hl=(4-1)(4-3)] {};
\tikz \node [col_hl=(5-1)(5-4)] {};
\end{bNiceMatrix}
$}
\end{minipage}
\hfill
\begin{minipage}{0.45\textwidth}
\tikzset{row_hl/.style={
line width=0.8pt,
draw=gray!80,
rectangle,
fill=gray!55,
blend mode = multiply,
inner sep=1pt,
fit = #1}
}
\tikzset{col_hl/.style={
rectangle,
fill=black!45,
blend mode = multiply,
inner sep=1pt,
fit = #1}
}
\centering
{$
\begin{bNiceMatrix}
0 & 1 & 2 & 3 & 4 \\
-1 & 0 & 1 & 2 & 3 \\
-2 & -1 & 0 & 1 & 2 \\
-3 & -2 & -1 & 0 & 1 \\
-4 & -3 & -2 & -1 & 0
\CodeAfter
\tikz \node [row_hl=(1-2)(1-5)] {};
\tikz \node [row_hl=(2-3)(2-5)] {};
\tikz \node [row_hl=(3-4)(3-5)] {};
\tikz \node [row_hl=(4-5)] {};
\tikz \node [col_hl=(2-1)] {};
\tikz \node [col_hl=(3-1)(3-2)] {};
\tikz \node [col_hl=(4-1)(4-3)] {};
\tikz \node [col_hl=(5-1)(5-4)] {};
\end{bNiceMatrix}
$}
\end{minipage}
\caption{The highlighted off-diagonal cells in two matrices.} \label{fig:offdiagonal_cells}
\end{figure}
In Figure \ref{fig:offdiagonal_cells}, the cells highlighted with a light shade of gray are the superdiagonal cells. The rest of the highlighted cells are the subdiagonal cells. The unhighlighted cells are the diagonal cells. The left matrix has elements where $i_{n}b = \delta(b,n)$ where $n$ is the cell index and $b$ is the base of the square.
\section{The Anti-offdiagonal Cells}
The \textbf{anti-offdiagonal cells} are the cells not found in the anti-diagonal. Like the off-diagonal cells, there are two kinds of anti-offdiagonal cells: the \textbf{anti-superdiagonal} and the \textbf{anti-subdiagonal} cells. The anti-superdiagonal cells are above and left of the anti-diagonal whilst the anti-subdiagonal cells are below and right of the anti-diagonal.
\newpage
Using the intersection sum (see Section \ref{intersection_sum}) of a cell index, we can determine whether a cell belongs to the anti-diagonal, is an anti-superdiagonal cell, or is an anti-subdiagonal cell. Given that $n$ is a cell index:
\begin{itemize}
\item If $\sigma(b,n) < (b + 1)$, it is an anti-superdiagonal cell.
\item If $\sigma(b,n) > (b + 1)$, it is an anti-subdiagonal cell.
\item If $\sigma(b,n) = (b + 1)$, it belongs to the anti-diagonal.
\end{itemize}
Like the off-diagonal cells, they can resemble triangles.
\begin{figure}[ht]
\centering
\begin{minipage}{0.45\textwidth}
\tikzset{row_hl/.style={
line width=0.8pt,
draw=gray!80,
rectangle,
fill=gray!55,
blend mode = multiply,
inner sep=1pt,
fit = #1}
}
\tikzset{col_hl/.style={
rectangle,
fill=black!45,
blend mode = multiply,
inner sep=1pt,
fit = #1}
}
\centering
{$
\begin{bNiceMatrix}
i_{1} & i_{2} & i_{3} & i_{4} & i_{5} \\
i_{6} & i_{7} & i_{8} & i_{9} & i_{10} \\
i_{11} & i_{12} & i_{13} & i_{14} & i_{15} \\
i_{16} & i_{17} & i_{18} & i_{19} & i_{20} \\
i_{21} & i_{22} & i_{23} & i_{24} & i_{25}
\CodeAfter
\tikz \node [row_hl=(1-1)(1-4)] {};
\tikz \node [row_hl=(2-1)(2-3)] {};
\tikz \node [row_hl=(3-1)(3-2)] {};
\tikz \node [row_hl=(4-1)] {};
\tikz \node [col_hl=(2-5)] {};
\tikz \node [col_hl=(3-4)(3-5)] {};
\tikz \node [col_hl=(4-3)(4-5)] {};
\tikz \node [col_hl=(5-2)(5-5)] {};
\end{bNiceMatrix}
$}
\end{minipage}
\hfill
\begin{minipage}{0.45\textwidth}
\tikzset{row_hl/.style={
line width=0.8pt,
draw=gray!80,
rectangle,
fill=gray!55,
blend mode = multiply,
inner sep=1pt,
fit = #1}
}
\tikzset{col_hl/.style={
rectangle,
fill=black!45,
blend mode = multiply,
inner sep=1pt,
fit = #1}
}
\centering
{$
\begin{bNiceMatrix}
2 & 3 & 4 & 5 & 6 \\
3 & 4 & 5 & 6 & 7 \\
4 & 5 & 6 & 7 & 8 \\
5 & 6 & 7 & 8 & 9 \\
6 & 7 & 8 & 9 & 10
\CodeAfter
\tikz \node [row_hl=(1-1)(1-4)] {};
\tikz \node [row_hl=(2-1)(2-3)] {};
\tikz \node [row_hl=(3-1)(3-2)] {};
\tikz \node [row_hl=(4-1)] {};
\tikz \node [col_hl=(2-5)] {};
\tikz \node [col_hl=(3-4)(3-5)] {};
\tikz \node [col_hl=(4-3)(4-5)] {};
\tikz \node [col_hl=(5-2)(5-5)] {};
\end{bNiceMatrix}
$}
\end{minipage}
\caption{The highlighted anti-offdiagonal cells in two matrices.} \label{fig:antioffdiagonal_cells}
\end{figure}
In Figure \ref{fig:antioffdiagonal_cells}, the cells highlighted with a light shade of gray are the anti-superdiagonal cells. The rest of the highlighted cells are the anti-subdiagonal cells. The unhighlighted cells are the anti-diagonal cells. The left matrix has elements where $i_{n}b = \sigma(b,n)$ where $n$ is the cell index and $b$ is the base of the square.
\newpage
\chapter{The Slant Indices} \label{slant_indices}
To index each individual slants in a square grid, we shall use the intersection sum and intersection difference of each cells.
We shall call the index of a descending slant a \textbf{descending index} or $\kappa$ (kappa) index. To determine the $\kappa$ index of the cell, we shall use function $\kappa$ which requires the intersection difference function (See Section \ref{intersection_diff}).
\begin{equation}
\kappa(b,n) = b + \delta(b,n)
\end{equation}
We shall call the index of an ascending slant an \textbf{ascending index} or $\upsilon$ (upsilon) index. To determine the $\upsilon$ index of the cell, we shall use function $\upsilon$ which requires the intersection sum function (See Section \ref{intersection_sum}).
\begin{equation}
\upsilon(b,n) = \sigma(b,n) - 1
\end{equation}
\newpage
To further illustrate the indexed slants, we substituted the values of the matrix elements into their respective descending and ascending indices.
\begin{figure}[h]
\centering
\begin{minipage}{0.45\textwidth}
\centering
{$
A =
\begin{bNiceMatrix}
5 & 6 & 7 & 8 & 9 \\
4 & 5 & 6 & 7 & 8 \\
3 & 4 & 5 & 6 & 7 \\
2 & 3 & 4 & 5 & 6 \\
1 & 2 & 3 & 4 & 5
\end{bNiceMatrix}
$}
\end{minipage}
\hfill
\begin{minipage}{0.45\textwidth}
\centering
{$
B =
\begin{bNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
2 & 3 & 4 & 5 & 6 \\
3 & 4 & 5 & 6 & 7 \\
4 & 5 & 6 & 7 & 8 \\
5 & 6 & 7 & 8 & 9
\end{bNiceMatrix}
$}
\end{minipage}
\caption{Matrix $A$ has elements equal to their descending index whilst matrix B has elements equal to their ascending index.}
\end{figure}
\section{The Cardinality of a Given Slant} \label{slant_cardinality}
Not all slants have the same number of cells. Only $b-1$ pairs of slants of have the same number of cells for each kind of slants. To get the number of cells in a given slant index. Let $x$ be either a descending ($\kappa$) or an ascending ($\upsilon$) index. Let $X$ be a set of cells belonging to a chosen slant. The vertical bar notation ($|A|$) denotes the \textbf{cardinality} of a set (\cite{math_vault}). However, the vertical bar notation can also denote an absolute number; we shall use $n(X)$ to denote the cardinality of set $X$. We shall use the vertical bars for denoting absolute values.
\begin{equation}
n(X) = b - |b - x|
\end{equation}
Only slants with index $b$ have the most number of cells which has a count of $b$.
\section{Multiples of the Base Until Its Square} \label{u_and_w}
Function $f$ shall denote any function in this subsection. Set $X$ shall denote any set in this subsection.
\begin{equation}\
X = \{ f(b,x) : x \in \mathbb{N}, 0 \leq x \leq 2b \}
\end{equation}
The range of the any set in this subsection has these traits:
\begin{itemize}
\item When $x = b$ then $f(b,x) = 0$
\item When $1 \leq x \leq b$ then $f(b,x) = b^2 - bx$