def is_left_handed(pips): Even though this has no effect on fairness, pips from one to six are not painted on dice any which way, but so that the pips on the opposite faces always add up to seven. (This convention makes it easier to tell when someone tries to use gaffed dice that leave out some spot values.) In each corner of the cube, one value from each pair of opposites 1-6, 2-5 and 3-4 meets two values from the other two pairs of opposites. The math works out correctly in for the 23 = 8 corners of the cube. This still leaves two possibilities how to paint these pips. Look at the corner shared by the faces 1, 2, and 3, and read these numbers clockwise around that corner starting from 1. If these three numbers read out as 1-2-3, that die is left-handed, and if they read out as 1-3-2, that die is right-handed. Analogous to a pair of shoes made separately for the left and right foot, left- and right-handed dice are in one sense identical, yet no matter how you twist and turn, you can't change either one to become indistinguishable from the other. (Well, at least not without taking that three-dimensional pancake “Through the Looking-Glass” by flipping it around in the fourth dimension!) The three numbers read around any other corner stamp the three numbers in the unseen opposite sides, and therefore determine the handedness of that entire die just as firmly. Given the three-tuple of pips around a corner read in clockwise order, determine whether that die is left-handed. There are only 23*3! = 8*6 = 48 possible pip combinations to test for, but you should find and cheerily exploit as many of the ample symmetries in this problem as you can. pips expected results (1, 2, 3) True (1, 3, 5) True (5, 3, 1) False (6, 3, 2) True (6, 5, 4) False
Chirality
def is_left_handed(pips):
Even though this has no effect on fairness, pips from one to six are not painted on dice any which way, but so that the pips on the opposite faces always add up to seven. (This convention makes it easier to tell when someone tries to use gaffed dice that leave out some spot values.) In each corner of the cube, one value from each pair of opposites 1-6, 2-5 and 3-4 meets two values from the other two pairs of opposites. The math works out correctly in for the 23 = 8 corners of the cube. This still leaves two possibilities how to paint these pips. Look at the corner shared by the faces 1, 2, and 3, and read these numbers clockwise around that corner starting from 1. If these three numbers read out as 1-2-3, that die is left-handed, and if they read out as 1-3-2, that die is right-handed. Analogous to a pair of shoes made separately for the left and right foot, left- and right-handed dice are in one sense identical, yet no matter how you twist and turn, you can't change either one to become indistinguishable from the other. (Well, at least not without taking that three-dimensional pancake “Through the Looking-Glass” by flipping it around in the fourth dimension!)
The three numbers read around any other corner stamp the three numbers in the unseen opposite sides, and therefore determine the handedness of that entire die just as firmly. Given the three-tuple of pips around a corner read in clockwise order, determine whether that die is left-handed. There
are only 23*3! = 8*6 = 48 possible pip combinations to test for, but you should find and cheerily exploit as many of the ample symmetries in this problem as you can.
pips | expected results |
(1, 2, 3) | True |
(1, 3, 5) | True |
(5, 3, 1) | False |
(6, 3, 2) | True |
(6, 5, 4) | False |
Please add comments between the codes so I understand, thank you!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images