Development of Teaching Tool for Supporting Understanding of Tensor Decomposition Using MacMahon ’ s Coloured Cubes

Abstract—In this paper, we developed tool to learn the calculation process of HOSVD. This tool uses newly created puzzle using some of MacMahon’s coloured cubes. The puzzle is represented as the 2D map using the matrix unfolding required to calculate HOSVD. In order to investigate the difficulty level of the puzzle and the visibility of its map representation, the teaching tool is tried by our students and others at the Campus Open Day of our college. As a result, it was confirmed that most users could understand the map and that the puzzle was rather easy to solve. Therefore, it was thought that the users seemed to understand the concept of the matrix unfolding roughly.


I. INTRODUCTION
Tensor decomposition is often widely used in big data analysis, fuzzy modeling, signal processing, image processing, image classification, biological signal analysis, text mining, social networking, and web hyperlink analysis [1]- [3]. This computation decomposes high-dimensional data represented by higher-order tensors into a product of a tensor and matrices or a sum of products of vectors. Note that in this paper the higher-order tensors have the same meaning as multidimensional arrays. We have been working on the medical data analysis using the tensor decomposition [4] and the development of teaching tools of this decomposition using 3D puzzles [5], [6]. Recent research in the latter field, we took a Rubik's cube and an Instant Insanity as 3D puzzles. However, it is very difficult to actually solve these puzzles, hence we recognized the need for easier puzzle.
Under the background as described above, we devised new 3D puzzle using some of the MacMahon's coloured cubes [7]. The puzzle is used as a teaching tool to learn the principle of tensor decomposition, and focuses on a matrix unfolding and a folding (an inverse of the matrix unfolding) that appears in the calculation process of higher-order singular value decomposition (HOSVD) [8] where HOSVD is one of the tensor decomposition. In this paper, we first explain the MacMahon's coloured cubes, a devised 3D puzzle, and HOSVD algorithm. Then we describe the higher-order tensor Manuscript  representation of the puzzle and its map representation. Next we show teaching tool developed using this map representation. Finally, we describe the results of trials of using this tool for junior high school students and our college students at the Campus Open Day of our college. In addition, the analysis results on the level of difficulty of the puzzle, the visibility of the map representation, and the degree of understanding of the matrix unfolding are also shown.

II. 3D PUZZLE USING MACMAHON'S COLOURED CUBES
MacMahon's cubes are cubes coloured on each side with six different colors, and 30 different cubes can be obtained by combining the colors on each side [7]. We selected four types of cubes from those 30 cubes and used them to create a new 3D puzzle. Fig. 1 shows a 3D puzzle composed of four types of cubes made by pasting color stickers on wooden cubes. The color scheme of each cube is shown as expanded views in Fig. 2. The colors used here are six colors, red (1), white (2), blue (3), green (4), yellow (5), and black (6), and the numbers in parentheses are color numbers. In these expanded views, the crossing part of the vertical and horizontal rows is the top face (red) of each cube.
This puzzle is a rectangular parallelepiped composed of 2 2  cubes when viewed from top face (red) of Fig. 1, and is solved by rearranging so that the colors of each side of this rectangular parallelepiped are the same color. We created this puzzle using MacMahon's coloured cubes as a puzzle that is easier to solve than the previously used Instant Insanity and Rubik's cube.

A. HOSVD Algorithm
The higher order singular value decomposition (HOSVD) is the extension of the singular value decomposition (SVD) on a matrix and is used to decompose a higher order tensor of third order or higher, and is often used as one of the tensor decompositions [9]. This method is often applied to fuzzy modeling, image processing and classification, data analysis, data compression, and so on [3], [4], [9], [10]. The higher order tensor refers to a multidimensional array, for example, first, second, and third order tensors correspond to a vector, a matrix, and a three-dimensional array, respectively.
As an example of HOSVD, Fig. 3 shows a pattern diagram of decomposition in the case of the third order tensor. The original tensor A is decomposed into an n-mode product of one core tensor B and three orthogonal matrices , where the n-mode product means a product of a tensor and a matrix, as an example of the operator, an 1-mode product is represented as 1  , and the core tensor corresponds to a diagonal matrix of SVD. Now, a HOSVD algorithm generalized to M-th order tensor is shown as follows: (Step 1) Apply the n-mode matrix unfolding to the M-th order tensor A to obtain M types of matrices Step 2) Apply SVD to the matrices ) (n A obtained in Step 1, respectively, to calculate M left singular matrices (i.e. orthogonal matrices) Step 3) Calculate the core tensor B by the following equation, The definition of the n-mode matrix unfolding in Step 1 of the HOSVD algorithm described in the previous section is as follows [8]: Core tensor Third-order tensor A B [ (Definition 1) n-mode matrix unfolding ] The n-mode matrix unfolding is to obtain a matrix n  n  n   I  I  I  I  I  I  I     with an ) , , , (End of Definition) In short, the n-mode matrix unfolding is an operation of converting the M-th order tensor into the matrix. Regarding the mode of the higher order tensor, it refers to the direction of the tensor, and in the case of the third order tensor A in the top of Fig. 4, the vertical, horizontal, and depth directions

B. Definition and Algorithm for n-Mode Matrix Unfolding
of A show the 1-, 2-, and 3-modes of the tensor, severally. Assuming that an ) , , ( , the corresponding relationship between the subscripts and the tensor modes represents that 1 i , 2 i , and 3 i are 1-, 2-, and 3 -modes, respectively.  Fig.4. Matrix unfoldings of other modes can also be obtained in the same way.
In order to obtain the matrix unfolding, it is a steady way to move each element of the higher order tensor one by one to each element of the matrix unfolding according to the Definition 1, however there is a more efficient way to implement it. That is, in the case of Fig.4, the 1-mode matrix unfolding is calculated by slicing A from left to right along the 2-mode of A and horizontally arranging the obtained matrices from left to right. An algorithm for the efficient matrix unfolding is shown below.
[ (Algorithm 2) 1-mode matrix unfolding of third order tensor ] Input: A third order tensor A of size Step 2) Return (1) A .
(End of Algorithm)

A. Higher-Order Tensor Representation of 3D Puzzle
As described earlier, the higher-order tensors used in this paper are multidimensional arrays. That is, the first to third-order tensors correspond to vectors, matrices, and 3D arrays, respectively. Here, in order to represent the puzzle shown in Fig. 1 as a multidimensional array, it is modeled by a fifth-order tensor as shown in Fig. 5. And then, each 1 1 1   cube in Fig. 1 is enlarged to third-order tensor with a size of 3 3 3   , and the color of each face of the original cube is given to the center element of each face of the third-order tensors. Since each original cube is arranged in 2 2 , the size of the fifth-order tensor is

B. Map of 3D Puzzle
To represent this 3D puzzle as a 2D map, we apply the n-mode matrix unfolding used in the calculation process of HOSVD. Here we use an 1-mode matrix unfolding especially as an algorithm for creating a puzzle map. The following is the algorithm for creating a map of this 3D puzzle.  In (4), , and are partial map matrices for the cubes 1, 2, 3, and 4, respectively.
(a) Title screen of the 3D puzzle (b) Screen of a puzzle map for exercises (c) Question screen to solve the puzzle within the time limit (d) Screen of a puzzle map for checking answers Fig. 6. Example of display screen of developed teaching tool.

A. Developed Teaching Tool and Its Usage
A teaching tool for learning the concept and procedure of the n-mode matrix unfolding and folding (inverse operation of the unfolding) of HOSVD algorithm was developed using MS PowerPoint application. Fig. 6 shows the example of display screen of these teaching tool. The following (i) to (iv) show the procedure for using the tool. 1) The title screen shown in Fig. 6(a) appears on the display.
Next, how to solve the puzzle is explained. 2) Fig. 6(b) is displayed to explain how to read the map.
Users practice placing each cube as shown in Fig. 1, while watching the map. Fig. 7 shows this situation. The map in Fig. 6(b) is created by adding color information and position information (that is, Front/Back, Top/Under, and Left/Right.) to the elements having the color values of the map matrix map A in (4).
3) The question screen shown in Fig. 6(c) is displayed, and the users solve the puzzle within one-minute. When the mouse is clicked, a start tone sounds and the timer works.
The elapsed time is indicated by a blue bar extending from left to right, as shown at the bottom of Fig. 6(c). 4) Finally, by displaying Fig. 6(d), the user sees an example of the answer of this puzzle. As same as the case of Fig.  6(b), the user actually puts each cube while looking at the answer map. Because the map of each cube of these teaching tool is created from the 1-mode matrix unfolding, we consider that it is possible to learn the matrix unfolding by repeatedly referencing the map and to learn the folding by actually placing the cubes according to the map.

B. Results of Using This Teaching Tool
This teaching tool was used by junior high school students and our college students who visited the Campus Open Day held at our college in August 2019. There were 30 users (including 22 junior high school students, 8 our college students and adults). As described in the previous subsection, users were asked to answer simple questions after using the teaching tool. Fig. 8 summarizes the contents of the questions and the results.
Question 1 asks the level of difficulty of the puzzle.
Although 70% of users felt that the puzzle was "hard", 16 out of 30 people, more than half of the total, could solve the puzzle within the time limit for the question in Fig. 6(c). Question 2 is about the readability of the map. The total of "easy to read" and "standard" was about 77%, so we found that the map of this teaching tool is generally easy to read. Also, by checking the map in Fig. 6(d), all users were able to confirm the answer to the puzzle, so it seems that the most users understood the map. Fig. 9 shows a cumulative relative frequency distribution of the time required for the users to check the answer of the puzzle by placing the cubes as shown in the answer map in Fig. 6(d). The average time required for the confirmation was approximately 63 seconds. We found that about 57% of users confirmed the answer by this average time, and that about 70% of them in 80 seconds and about 93% in 100 seconds completed the confirmation.

VI. CONCLUSIONS
In this paper, we show a new 3D puzzle created using some of MacMahon's coloured cubes for teaching tensor decomposition. This puzzle is not as difficult as the Instant Insanity and the Rubik's cube, so it can be solved almost within the time limit. By applying the mode matrix unfolding of HOSVD, the puzzle was expressed as a 2D map. Our developed teaching tool allow users to learn matrix unfolding and folding in the calculation process of HOSVD by solving this 3D puzzle while referring the map.
The developed teaching tool was used by our college students and others at the Campus Open Day to investigate the level of difficulty of the puzzle and the readability of the map. As a result, there were many answers that the difficulty level was high, but it was confirmed that more than half of users can solve the puzzle within the time limit. In addition, we saw that the map is generally easy to read and that almost everyone understood how to read it. From these results, the learners of the concept of matrix unfolding and folding can be understood by using this teaching tool. Our future work is to use this teaching tool in class at our college and to verify that this tool is effective in learning the concept and calculation process of HOSVD.