Cube Rotations

0
medium
by William S.

In this exercise, you will be given a three dimensional tensor A, of shape (n,n,n) for some n>=1, as well as a tensor B of the same shape. For the purposes of this problem, we will think of the entries of A as being arranged into the shape of a cube. There are 24 rigid motions of the cube. These correspond to the possible configurations of the cube after rotating it in space. For instance, a 90 degree rotation about the vertical axis is one example. Of the tensors that result from the 24 rigid motions of A, we would like to find the one whose dot product with B is maximized. Your task is to return the value of this maximum dot product. For the purposes of this problem, the dot product between two tensors of the same shape is the sum of products of corresponding entries

Loading...
2024 © TensorGym
Contrinbute | Contact | Copyright | 𝕏