Path norms on a matrix

We define row path norm and column path norm of a matrix and relate path norms with other standard matrix norms. A row (resp. column) path norm gives a path that maximizes relative row (resp. column) distances starting from the first row (resp. column). The comparison takes place from the last row (resp. column) to the first row (resp. column), tracing the path. We categorize different versions of path norms and provide algorithms to compute them. We show that brute-force methods to compute path norms have exponential running time. We give dynamic programming algorithms, which, in contrast, take quadratic running time for computing the path norms. We define path norms on Church numerals and Church pairs. Finally, we present applications of path norms in computing condition number, and ordering the solutions of magic squares and Latin squares


Introduction
Matrix norms are often used in the analysis of algorithms. A map · : M m×n → R is a matrix norm if, for all A, B ∈ M m×n , the following five axioms are satisfied: (i) non-negativity, (ii) definiteness, (iii) absolute homogeneity, (iv) triangular inequality and (v) submultiplicativity. The first four properties of a matrix norm are identical to the axioms of a vector norm. That is, a map on matrices that satisfies (i), (ii), (iii), (iv) is called a vector norm or a generalized matrix norm. The notions of a matrix seminorm and a generalized matrix seminorm are defined via omission of axiom (ii). Deutsch (1980) presented two methods of generating classes of generalized matrix norms. Johnson (1977) explored the relation between multiplicativity and compat- ibility for a generalized matrix norm. Dyer et al. (2009) showed that rapid mixing of both random update Glauber dynamics and systematic scan Glauber dynamics occurs if any matrix norm of the associated dependency matrix is less than 1. The transition probability matrix is an intrinsic part of the Markov chain. Koppula et al. (2019) presented a link between the Markov chains and rough sets. Kedukodi et al. (2009) defined the concepts of equiprime fuzzy ideal, 3-prime fuzzy ideal and c-prime fuzzy ideal of a nearring. Kedukodi et al. (2019) introduced interval valued equiprime, 3-prime and c-prime L-fuzzy ideals of a nearring N by using interval valued t-norms and interval valued t-conorms and characterized them. Subsequently, Koppula et al. (2020) related these ideas with Markov frameworks and gave their application in decision-making problems. Aishwarya et al. (2022) investigated permutation identities satisfied by weak semigroup left ideals in prime nearrings and obtained results on commutativity of addition and multiplication using these identities. Aishwarya et al. (2023) introduced the notion of a product fractal ideal of a ring using permutations of finite sets and multiplication operation in the ring and proved fractal isomorphism theorems that extend the classical isomorphism theorems in rings. Higham (1992) showed that Hölder p−norm of a matrix can be estimated reliably in O(mn) operations. Hendrickx and Olshevsky (2010) showed that for any rational p ∈ [1, ∞) except p = 1, 2, unless P = N P, there is no polynomial time algorithm which approximates the matrix p-norm to arbitrary relative precision. Li et al. (2014) approximated A p using sketching models. Arens (1952) gave a generalization of normed rings. Ozaki et al. (1953) obtained a sufficient condition for an analytic function to be univalent in a convex domain in a normed ring. Duran andİzgi (2014Duran andİzgi ( , 2015 studied the behavior of solutions for several stochastic differential equations, introduced three-dimensional matrix norms and defined market impression matrix norm as an application to it. Further,İzgi (2015) investigated different stochastic differential equations in the field of mathematical finance. İzgi and Özkaya (2017) presented and proved norm inequalities for 3-dimensional matrices and showed their usefulness in real data applications. Kowalski (2009) studied the role of mixed norms in enforcing some specific types of joint sparsity and diversity when used as regularization terms in regression problems. Yildirim and Özkale (2022) proposed an algorithm based on the combination of ridge and Liu regressions to deal with multicollinearity in extreme learning machine. The lambda calculus is a theory of functions as formulas. In this system, the functions are written as expressions. Lambda calculus was introduced by Church (1936) in 1936 to formalize the concept of effective computability. Also, in 1936, before learning of Church's work, Turing (1936) created a theoretical model for machines, now called Turing machines. A Turing machine could compute with inputs by manipulating symbols on a tape. A function on the natural numbers is called λ−computable if the corresponding function on the Church numerals can be represented by a λ− term. A function is Turing computable if a Turing machine can compute the function's value. For each λ-term M, a tree BT (M), called Böhm tree, is defined (see Barendregt (1984)). Böhm trees play an important role in analysis of λ-models P ω and D ∞ . The terms and their Böhm trees relate to each other analogously as real numbers relate to its continued fraction expansion. If M has a normal form, the tree BT (M) is finite. In this respect, normal forms relate to rational numbers. Nayak et al. (2018) defined ΘΓ N-Group and showed that Church numerals and Church pairs form a ΘΓ N-Group. Koppula et al. (2021) showed that Church numerals naturally form a seminearring and give rise to perfect ideals.
A magic square M of order n is an n × n array of integers from the set {1, 2, . . . , n 2 }, wherein the integers in each row, in each column, in the main diagonal, and the main anti-diagonal all add up to the same number called the magic constant. The magic constant of a magic square of order n is n(n 2 + 1)/2. Furthermore, magic squares exist for all positive orders, except in the case of n = 2. A Latin square of order n is an n × n array over a set of n symbols such that every symbol appears exactly once in each row and exactly once in each column. These symbols can be letters, numbers, colors, etc. McCranie (1988) gave methods for constructing magic squares of all orders that can be adapted for use on a general-purpose electronic digital computer. Benjamin and Brown (2014) presented several effective ways of constructing magic squares given the magic constant. Keedwell and Dénes (2015) gave applications of Latin squares and their connections with Magic squares. Fisher (1926) recommended Latin squares for crop experiments, and Fisher (1971) discussed Greaco-Latin and higher squares. Shao and Wei (1992) gave a formula for the number of Latin squares of a given order. Latin squares encode the features of algebraic structures. Wanless (2007) gave a brief survey of generalizations of transversals, the case when the Latin square is a group table and its connection with covering radii of sets of permutations. Potapov (2016) gave the bounds for the number of transversals over all the Latin squares of order n and showed that the logarithm of the maximum number of transversals over all the Latin squares of order n is greater than n 6 (ln n + O(1)). Vadiraja Bhatta and Shankar (2017) considered Latin squares formed by some permutation polynomials over finite rings and studied them with regard to a few Latin square properties. Latin squares have applications in coding theory, experimental designs and designing game tournaments. The famous puzzles like Sudoku and KenKen are special Latin squares. Johanna et al. (2012) presented a hybrid genetic algorithm that can solve the KenKen puzzle.
In this paper, we consider Latin squares and magic squares and compute their weighted path norms, which distinguish and order all possible solutions. The condition number κ of a matrix measures the sensitivity of the solution when the system experiences small changes in the coefficients. Matrix norms are used to compute condition number. The matrix condition number was introduced by Turing (1948). Marshall and Olkin (1965) proposed that under certain conditions, the matrix A A * is more ill-conditioned than A. Narcowich and Ward (1991) gave a general method for obtaining bounds both on the norm of the inverse of the interpolation matrix and on the condition number of that matrix. Zielke (1988) established inequalities between norms of rectangular matrices and the corresponding relationships between condition numbers. We refer to Higham (2002) for the detailed study of condition numbers. We use path norms to compute condition number and give a comparison with other methods.
We have organized the rest of the paper as follows. In Sect. 2, we provide the basic definitions and related primary results. In Sect. 3, we define the binary path seminorm. In Sect. 4, we define the binary path norm, present a quadratic running time dynamic algorithm and discuss different path norms. In Sect. 5, we present the binary wrapping path seminorm and norm. Different versions of ternary path norms analogous to binary path norms are discussed in Sects. 6, 7 and 8. In Sect. 9, we define the path norm on Church numerals and Church pairs. In Sect. 10, we define weighted path norm and strictly weighted path norm and compute them for all Latin squares and Magic squares of order 3. In Sect. 11, the condition numbers for different matrices are computed using path norm and they are compared with condition numbers computed from the standard matrix norms A p , p = 1, 2, ∞.

Basic definitions and preliminaries
In this section, we provide basic definitions and results. For the fundamentals of analysis of algorithms, we refer to Cormen, Cormen et al. (2001). For further understanding of vector norms and matrix norms, we refer to Meyer (2000), Strang (2006). Definition 2.1 Naimark (1964) Let R be an associative ring. A norm on R is a function | |: R → R that satisfies the following conditions for all a, b ∈ R: A ring R on which a norm is defined is called as a normed ring.
In what follows, R denotes a normed ring. We denote the set of all matrices of order m × n with entries from R by M m×n (R).

Definition 2.2 Horn and Johnson (2013) The function
: M m×n (R) → R is said to be a seminorm if it satisfies the following properties: The seminorm of a nonzero matrix can be zero. a 1 a 2 a 3 · · · a n−1 a n a 2 a 3 a 4 · · · a n a 1 . . . . . . . . . . . . . . . . . . a n a 1 a 2 · · · a n−2 a n−1 is called a circulant matrix, denoted by cir (a 1 , a 2 , . . . , a n ). Each row is the previous row cycled backwards by one step; the entries in each row are a cyclic permutation of those in the first.
Definition 2.5 Golub and Van Loan (2013) Let A ∈ M m×n (R). The column norm of a matrix is given by Definition 2.6 Turing (1948) For a non-singular square matrix A, the condition number is denoted and defined as follows:

Definition 2.7 Hindley and Seldin (2008) Let
. . } be an infinite set of variables. The set of λ-terms, denoted by Λ, is defined inductively as follows: where M and N are λ−terms.
Any natural number n can be represented using a λ−term.
Definition 2.8 Hindley and Seldin (2008) For every n ∈ N, the Church numeral is a term defined by Here are the first few Church numerals: If f and x are lambda terms, and n ≥ 0 a natural number, we write f n x for the term f ( f (. . . ( f x) . . . )), where f occurs n times. Let C denote the set of all Church numerals. The addition and multiplication on C are defined as follows: (1) Let m, n ∈ C. and A Church pair is a pair of Church numerals that represents integers in λ-terms. The integer value is the difference between the two Church numerals. It contains Church numerals representing a positive and a negative value. Let x be an integer. It is represented as a pair of natural numbers (x p , x n ) such that x = x p − x n . In λterms, the pair function is given by λx y f . f xy and x as λ f . f (λgy.g x p y)(λhz.h x n z).
The addition and multiplication on Church pairs are naturally defined as follows: x y = [x p , x n ] [y p , y n ] = [x p * y p + x n * y n , where + and * are as defined in (1).
The Böhm trees are defined as follows: Definition 2.9 Barendregt (1984) Let Σ be set of symbols.
A Σ-labeled tree is a tree where at each node an element of Σ is written. Let . . x n .y | n ∈ N, x 1 , . . . , x n , y variables}.
Then, BT (M) is a Σ−labeled tree defined as follows: where ⊥ is a single node with label ⊥.

Path seminorm on a matrix
Definition 3.1 We define n b : M m×n (R) → R as follows: We call the conditions on j i 's as Proposition 3.2 For A, B ∈ M m×n (R), n b satisfies the following properties: Proof Let A and B be m × n matrices from the normed ring R and c be an element in R.
We call n b as binary row path seminorm.

Path norm on a matrix
Definition 4.1 We define N b : M m×n (R) → R as follows: We denote this way of computing N b by R ↓ R. (R), N b satisfies the following properties:

any column vector x (compatibility with a vector norm); (vi) N b is a norm on M m×n (R).
Proof Let A and B be m × n matrices from the normed ring R and c be an element in R.
is the column matrix with one in ith row and zero elsewhere.
We call N b as binary row path norm.

Proposition 4.3
The brute-force method of computing N b has exponential running time.
The brute-force method of computing binary row path norm is to find all possible paths a 1 j 1 , a 2 j 2 , a 3 j 3 , . . . , a m j m satisfying (6). Basically, we compute the sum of the absolute values of the elements from the path and then take the maximum of them to get the path norm. We count the possible paths, that is, the paths that satisfy (6), as below: Let P(i, j) denote the number of possible paths from (i, j) th entry of the matrix A then Let T (m, n) denote the total number of possible paths in matrix A. Then, The relation (8) can recursively be defined as follows: Denote A(m; n) for the submatrix of order (m − 1) × (n − 1) by removing m th row and n th column of matrix A.
Each entry in the last row of A(m; n) further induces two possible paths for the entries in the m th row of matrix A, The number of paths reaching last entry of submatrix A(m; ) is the difference between number of all paths in A(m; ) and number of all paths in A(m; n), that is, T (m − 1, n) − T (m − 1, n − 1) and paths reaching the last entry of submatrix A(m; ) gives rise to one path each for the matrix Thus, we have The recursive relation is given by We show that the brute-force method takes exponential time. We use induction on m to prove that T (m, n) = 2 m−2 (2n − m + 1).
Let n be fixed. Base case: For m = 2, we have Assume that the condition is true for the case m − 1, that is, Therefore, it is clear that the brute-force way of finding all possible paths takes exponential time. Hence, computing the binary row path norm takes O(2 m n) running time.
In the dynamic programming technique, we solve a problem by combining solutions to sub-problems. We propose dynamic programming algorithms for computing the path norms. The dynamic programming algorithms presented in this paper take quadratic running time in contrast with bruteforce or recursive methods, which take exponential running time.
We begin with the algorithm to compute the binary row path norm of a matrix.

Time and space complexity of the Algorithm 4.1
The basic operation involved in the algorithm is comparison of norms that occurs in Line 9. The for loop from 3 to Line 22 involves (m − 1)(n − 1) comparisons in total. Therefore, the time complexity of the Algorithm 4.1 is if max{a, b} = a then 10: Append a to dynamicRowV alueList 11: Append j to col I ndices List 12: else 13: Append b to dynamicRowV alueList 14: Append j + 1 to col I ndices List 15: end if 16: end for 17: Append l to dynamicRowV alueList 19: Append n to col I ndices List 20: Append col I ndices List to col I ndices Matri x 22: end for 23:   In Example 4.5 and Example 4.6, we have used Euclidean norm and Manhattan norm, respectively, for the given matrix. However, one can use any norm on the ring to compute binary row path norm.

Different binary path norms on a matrix
The binary row path norms can be redefined by changing the direction of comparison to find paths. In that case, we get eight different types of norms for the same matrix; four are row path norms, and four are column path norms. They are illustrated from 1 to 8: We denote the dihedral group of symmetries of a square by D 8 . The suffix ⊥ represents the rotation of the matrix by 90 • in the anticlockwise direction, the suffixes X and Y represent the reflections of the matrix about X −axis and respectively. An action of a group G on a set X is said to be faithful if there are no group elements g, except the identity element, such that gx = x, for all x in X . Table  1 gives the faithful group action of D 8 on the set of different binary path norms. As the orbit of every binary path norm under this group action contains all the binary path norms, it is possible to obtain all binary path norms of a matrix by computing any one binary path norm on the matrices obtained by different symmetries of the matrix. The path norms from 1 to 8 computed in Sect. 4.1 can be obtained by computing R ↓ R after applying rotations and reflections to the given matrix.

Proposition 4.7
The following binary path norms coincide: (i) R ↓ R and R ↑ L.
(ii) R ↓ L and R ↑ R.
(iii) C → D and C ← U.
(iv) C → U and C ← D.
Proof Let A be an m × n matrix with entries from normed ring R.
From Proposition 4.7, we have Table 1 reduced to Table  2.

Proposition 4.8 For any matrix A with real non-negative entries, N b (A) = n b (A).
Proof Let A be a non-negative matrix. Then, a i j ≥ 0, for all i, j.
By Definition 3.1, we have However, the converse of the Proposition 4.8 is not true.

Binary wrapping path seminorm and norm
The concept of wrapping is useful in dealing with special matrices like circulant matrices. The path seminorm(norm) can be extended to wrapping path seminorm(norm) by wrapping the last column of the matrix around the first column to form a cylinder-like structure.
Definition 5.1 We define n bw : M m×n (R) → R as follows: where (10) is given by By Proposition 3.2, n bw is a seminorm on M m×n (R). We call n bw as binary wrapping row path seminorm.
Definition 5.2 We define N bw : M m×n (R) → R as follows: | a i j i | : satisfying (10) .
By Proposition 4.2, N bw is a norm on M m×n (R). We call N bw as binary wrapping row path norm.
From Proposition 4.3, it is clear that the time complexity of computing the binary wrapping row path norm by bruteforce method is O(2 m n).
The algorithm to compute binary wrapping row path norm of a matrix is obtained by replacing Line 17 to Line 19 of Algorithm 4.1 by Line 1 to Line 9 of Algorithm 5.1.
From the analysis of Algorithm 4.1, it is clear that Algorithm 5.1 has quadratic running time.  Append a to dynamicRowV alueList 5: Append n to col I ndices List 6: else 7: Append b to dynamicRowV alueList 8: Append 1 to col I ndices List 9: end if Using Algorithm 5.1, the binary wrapping path norm of a matrix is given by The binary wrapping row path norm N bw (A) = 306 along the path −133, −71, −102.
From Example 4.4 and Example 5.3, we see that the binary row path norm and binary wrapping row path norm need not be the same for a matrix. Now, we use the concept of circulant matrices to show the necessity of binary wrapping row path norm. (a 1 , a 2 , . . . , a n ), cir (a 2 , a 3 , . . . , a n , a 1 ), . . . , cir (a n , a 1 , . . . , , a n−1 ) have the same binary wrapping row path norm.

Ternary path seminorm on a matrix
Definition 6.1 We define n t : M m×n (R) → R as follows: We call the conditions on j i 's as Proposition 6.2 For A, B ∈ M m×n (R), n t satisfies the following properties.

(i) n t (A) ≥ 0 (non-negativity); (ii) n t (c A) ≤ | c | n t (A), for any c in R (weak absolute homogeneity); (iii) n t (A + B) ≤ n t (A) + n t (B) (triangular inequality); (iv) n t is a seminorm on M m×n (R).
Proof The proof is similar to that of Proposition 3.2.
We call n t as ternary row path seminorm.

Proposition 6.3 Let A ∈ M m×n (R). Then, n t (A) ≥ n b (A).
Proof By Definition 6.1, we have

Ternary path norm on a matrix
Definition 7.1 We define N t : M m×n (R) → R as follows: | a i j i | : satisfying (11) .
We denote this way of computing N t as R ↓ L R.
Proposition 7.2 For A, B ∈ M m×n (R), N t satisfies the following properties.

x) for any column vector x (compatibility with a vector norm); (vi) N t is a norm on M m×n (R).
Proof The proof is similar to that of Proposition 4.2.
We call N t as ternary row path norm.

Proposition 7.3 For any matrix A with real non-negative entries, N t (A) = n t (A).
Proof The proof is similar to that of Proposition 4.8.
The paths involved in computing ternary row path norm are of this form: ⎡ a 12 a 13 · · · a 1n a 21 a 22 a 23 · · · a 2n a 31 a 32 a 33 · · · a 3n . . .

Proposition 7.4 The brute-force method of computing ternary row path norm takes (O(3 m n)) running time.
Proof The proof is similar to that of Proposition 4.3.
Since the brute-force method of computing the ternary row path norm takes exponential time, we propose a quadratic running time algorithm for computing the ternary row path norm of a matrix. if max{a, b} = a then 9: Append a to dynamicRowV alueList 10: Append 1 to col I ndices List 11: else 12: Append b to dynamicRowV alueList 13: Append 2 to col I ndices List 14: end if 15: for j = 2 to n − 1 do 16: The basic operation involved in the algorithm is comparison of norms that occurs in Line 19 and Line 22. The for loop from Line 3 to Line 40 involves (m −1)(2(n −2)+2) comparisons in total. Therefore, the time complexity of the algorithm is (m − 1)(2(n − 2) + 2) = 2mn − 2 m − 2n + 2 = O(mn). Assuming m = O(n), the time complexity of the a algorithm is O(n 2 ), that is, quadratic running time. The input matrix A and the matrix col I ndices Matri x take O(mn) space each. The array dynamicRowV alues List takes O(n) space. From Line 41 to Line 46, the algorithm takes O(m) space. Therefore, the space complexity is given by O(mn). Assuming m = O(n), the space complexity of the algorithm is O(n 2 ).
We now give an example for computing ternary path norm of the matrix with real entries in Example 7.5. The ternary row path norm N t (A) = 303 along the path −133, 68, −102.

Example 7.5 Let
From Example 4.4 and Example 7.5, we observe that the ternary row path norm is different from the binary row path norm.
Example 7.7 Consider the matrix A with complex entries. Proof The proof is similar to that of Proposition 6.3.
As in the case of binary path norms, we have four different ternary path norms R ↓ L R, R ↑ L R, C → U D and C ← U D. By Proposition 4.7, the group action of D 8 on {R ↓ L R, R ↑ L R, C → U D, C ← U D} reduces to Table 3.

Ternary wrapping path seminorm and norm
As in the case of the binary path seminorm, we define the ternary wrapping path seminorm as Definition 8.1 We define n tw : M m×n (R) → R as follows: where (12) is given by From Proposition 6.2, n tw is a path seminorm. We call n tw as ternary wrapping row path seminorm.
The ternary wrapping row path norm is defined as Definition 8.2 We define N tw : M m×n (R) → R as follows: | a i j i | : satisfying (12) .
From Proposition 7.2, N tw is a path norm, and from Proposition 7.4, it is clear that the time complexity of the brute-force method of computing the ternary wrapping row path norm is O(3 m n).
The algorithm for computing ternary wrapping row path norm is obtained by replacing Line 6 to Line 14 of Algorithm 7.1 by Line 1 to Line 13 of Algorithm 8.1, and Line 30 to Line 38 of Algorithm 7.1 by Line 14 to Line 26 of Algorithm 8.1. Append a to dynamicRowV alueList 6: Append n to col I ndices List 7: else if max{a, b, c} = b then 8: Append b to dynamicRowV alueList 9: Append 1 to col I ndices List 10: else 11: Append c to dynamicRowV alueList 12: Append 2  Append a to dynamicRowV alueList 19: Append n − 1 to col I ndices List 20: else if max{a, b, c} = b then 21: Append b to dynamicRowV alueList 22: Append n to col I ndices List 23: else 24: Append c to dynamicRowV alueList 25: Append 1 to col I ndices List 26: end if From the analysis of Algorithm 7.1, it is clear that the time complexity of computing the ternary wrapping row path norm is quadratic.

Path norm of Church numerals
Church numerals are λ−terms that represent non-negative integers under Church encoding. An n th numeral is a function that maps any function f to its n−fold composition, that is, the function f is composed n-times with itself.
Every λ−term can be expressed as graphs using Böhm trees. The Böhm trees of the Church numeral 0 is a tree with single node with label λ f x.x, that is, We compute path norm of Church numerals using path norms of adjacency matrices of these Böhm trees. We define path norm of Church numerals formally as follows: Definition 9.1 Let C denote the set of all Church Numerals. We define a function f : C → R as the binary row path norm of the adjacency matrix of Böhm tree of the Church numeral, that is, where A is the adjacency matrix of BT (n). Then, its adjacency matrix is Proposition 9.3 Let m, n be Church numerals. Then, the function f is a norm, that is, it satisfies the following properties: Proof Let m, n ∈ C.
(i) We know that n ≥ 0. By Proposition 9.
We call this f as the strict path norm of a Church numeral. The adjacency matrix of BT (n) has column norm and row norm equal to 2. Due to this, the column norm and row norm cannot distinguish between any two different numerals. At the same time, the path norm of the Church numeral is the natural number equivalent to the Church numeral and can naturally distinguish distinct Church numerals.

Church Pairs
Let m = [m p , m n ] be a Church pair. The λ-term of Church pair m is A ≡ λz.z(λ f x. f m p x)(λgy.g m n y). The Böhm Tree of BT (A) is given by where 0 is a zero matrix.
Definition 9.4 Let P denote the set of all Church Pairs. We define a function f p : P → R as the binary row path norm of the matrix M of Böhm tree of the Church pair, that is, let m = [m p , m n ] and A be its λ−term. Then, where M is the matrix of BT (A) as defined in (15). Then, its matrix M as defined in (15) is (iv) From (4) and Proposition 9.5, we have f p (a ⊕ b) = f p ([a p + b p , a n + b n ]) = a p + b p + a n + b n and f p (a) + f p (b) = a p + a n + b p + b n . Therefore, (2),(3),(5) and Proposition 9.5, we have f p (a b) = f p ([a p * b p + a n * b n , a p * b n + a n * b p ]) = f (a p * b p + a n * b n ) + f (a p * b n + a n * b p ) = a p × b p + a n × b n + a p × b n + a n × b p and f p (a) × f p (b) = (a p + a n ) × (b p + b n ) = a p × b p + a n × b n , a p × b n + a n × b p . .
We call f p as strict path norm on Church pairs.

Weighted path norms
Definition 10.1 Let ω ≥ 0; > 0. We define N ω, on a matrix A as where N is any path norm and is a compatible matrix norm. Proof The proofs are similar to that of Proposition 4.2.
We call N ω, as weighted path norm. If ω + = 1, then we call N ω, as strictly weighted path norm.

Magic squares of order 3
The configurations of different solutions of 3 × 3 magic squares with magic sum 15 are from 1 to 8. The arrows with R (C) give the row (column) path and the suffix involved is the column (row) number where the path begins. The direction of arrows gives the path traced.  We observe that path norm pairs distinguish the matrices. We sort the magic squares in lexicographical order of R ↓ L with respect to the column that gives the path and C → U with respect to the row that gives the path.
Let the weights given to R ↓ L norm be ω and to C → U norm be as given in Table 4.
In this case, there exists a weight function such that ω + = 1, yielding a strictly weighted path norm (refer Tables  4 and 5

Latin squares of order 3
Given a Latin square of order 3, permuting its rows and columns, we get 12 distinct Latin squares configurations. The Latin squares of order 3 with their row and column path norms are given from 1 to 12: 1.  The row norm and column norm of these matrices are 6. Using these norms, one won't be able to distinguish the Latin squares. We use the weighted path norm to easily distinguish various configurations.
Let the weight function for the norm R ↓ L be ω and for norm C → U be as given in Table 6.
In this case, the weights of the path norms do not sum up to 1. In fact, there are no such weights corresponding to configurations in Table 7 such that they have sum 1 and the weighted norms are sorted.

Condition number
Let Ax = b be a linear system and let N be any path norm. Then, we have As N (Ax) ≤ N (A)N (x) (refer Proposition 4.2 and Proposition 7.2), we have Let δb be a small change in b. Let δx be the corresponding change in the solution x. Then, A(x + δx) = b + δb, that is, Ax + Aδx = b + δb. This gives Aδx = δb, which implies δx = A −1 δb. From Proposition 4.2 and Proposition 7.2, we have N (δx) = N (A −1 δb) ≤ N (A −1 )N (δb). This implies Multiplying equations (16) and (17), we get The number κ N = N (A)N (A −1 ) is the condition number of A computed using path norms. The condition number of a well-conditioned matrix is expected to have a lower value. On the other hand, the condition number of an ill-conditioned matrix is expected to be higher. We present examples wherein the condition num- ber computed using the path norms meets these expectations compared to other standard norms. Condition numbers based on the path norm, column norm, row norm and Euclidean norms are given in Table 8. From Table 9, it is clear that the condition number of A computed using path norm is the largest as expected.

Conclusions
We have defined different versions of binary and ternary path norms and presented efficient algorithms to compute them. As the notion of path norm is defined on an arbitrary normed ring, one can compute path norms using different norms of the ring. We have illustrated this in Example 4.5 and Example 4.6 by computing path norms on a complex-valued matrix using both Euclidean and Manhattan norms, respectively. We have defined a path norm on Church numerals and extended it to Church pairs. These norms naturally distinguish the numerals. We have used path norms to order all the possible magic square solutions of size 3. Further, we have used weighted path norms for Latin squares of size 3 and ordered them. In the process, we have shown the benefits of path norms in (i) ordering solutions of magic squares and Latin squares; (ii) computing the condition number of a matrix. The concept of binary and ternary norms can be extended to n-ary norms on a matrix. Matrix norms have applications in machine learning algorithms, especially to implement regularization (for example, see Kowalski (2009), Yildirim and Özkale (2022)). There is a scope to explore the use of path norms in machine learning algorithms to obtain models that are more robust.
The concept of three-dimensional matrix norm has applications in mathematical finance to deal with stochastic volatility (referİzgi (2015),İzgi and Özkaya (2017)). Naturally, we can extend path norms to three-dimensional matrix path norms and investigate corresponding applications.