def is_left_handed(pips): Even though this has no effect on fairness, pips from one to six are not painted on dice just any which way, but so that pips on the opposite faces always add up to seven. (This convention makes it easier to tell when someone tries to use crooked dice with certain undesirable pip values replaced with values that are more desirable for the cheater.) In each of the 23 = 8 corners of the cube, exactly one value from each pair of forbidden opposites 1-6, 2-5 and 3-4 meets two values chosen from the other two pairs of opposites. You can twist and turn any corner of the die to face you, and yet two opposite sides never spread into simultaneous view. This discipline still allows for two distinct ways to paint the pips. If the numbers in the corner shared by the faces 1, 2, and 3 read out clockwise as 1-2-3, that die is left-handed, whereas 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, and yet again no matter how you twist and turn, you can't seriously put either shoe in the other foot than the one it was designed for. (Well, at least not without taking that three-dimensional pancake “Through the Looking-Glass” by 0lipping 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 0irmly. Given the three-tuple of pips read clockwise around a corner, determine whether that die is left-handed. There are only 23*3! = 8*6 = 48 possible pip combinations to test for, so try to exploit these four two-fold symmetries to simplify your code. (This problem would certainly make for an interesting exercise code golf, a discipline that we otherwise frown in this course as the falsest economy.) pips Expected result (1, 2, 3) True (1, 3, 5) True (5, 3, 1) False (6, 3, 2) True (6, 5, 4) False

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section: Chapter Questions
Problem 14PP
icon
Related questions
Question

Chirality

def is_left_handed(pips):

Even though this has no effect on fairness, pips from one to six are not painted on dice just any which way, but so that pips on the opposite faces always add up to seven. (This convention makes it easier to tell when someone tries to use crooked dice with certain undesirable pip values replaced with values that are more desirable for the cheater.) In each of the 23 = 8 corners of the cube, exactly one value from each pair of forbidden opposites 1-6, 2-5 and 3-4 meets two values chosen from the other two pairs of opposites. You can twist and turn any corner of the die to face you, and yet two opposite sides never spread into simultaneous view.

This discipline still allows for two distinct ways to paint the pips. If the numbers in the corner shared by the faces 1, 2, and 3 read out clockwise as 1-2-3, that die is left-handed, whereas 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, and yet again no matter how you twist and turn, you can't seriously put either shoe in the other foot than the one it was designed for. (Well, at least not without taking that three-dimensional pancake “Through the Looking-Glass” by 0lipping 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 0irmly. Given the three-tuple of pips read clockwise around a corner, determine whether that die is left-handed. There are only 23*3! = 8*6 = 48 possible pip combinations to test for, so try to exploit these four two-fold symmetries to simplify your code. (This problem would certainly make for an interesting exercise code golf, a discipline that we otherwise frown in this course as the falsest economy.)

pips

Expected result

(1, 2, 3)

True

(1, 3, 5)

True

(5, 3, 1)

False

(6, 3, 2)

True

(6, 5, 4)

False

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr