github.co 7. Colour trio def colour_trio (colours) : This problem was inspired by the Mathologer video...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
github.co 7. Colour trio def colour_trio (colours) : This problem was inspired by the Mathologer video "Secret of Row 10". To start, assume the exis- tence of three values called "red", "yellow" and "blue". These names serve as colourful (heh) mnemonics and could as well have been 0, 1, and 2, or "foo", "bar" and "baz"; no connection to actual physical colours is implied. Next, define a rule to mix such colours so that mixing any colour with itself gives that same colour, whereas mixing any two different colours always gives the third colour. For example, mixing blue to blue gives that same blue, whereas mixing blue to yellow gives red, same as mixing yellow to blue, or red to red. Given the first row of colours as a string of lowercase letters, this function should construct the rows below the first row one row at the time according to the following discipline. Each row is one element shorter than the previous row. The i:th element of each row comes from mixing the colours in positions i and i + 1 of the previous row. Rinse and repeat until only the singleton element of the bottom row remains, returned as the final answer. For example, starting from 'rybyr' leads to 'brrb', which leads to 'yry', which leads to 'bb', which leads to 'b' for the final answer, Regis. When the Python virtual machine laughs and goes 'brrrrr', that will lead to 'yrrrr', 'brrr', 'yrr', and 'br' for the final answer 'y' for "Yes, please!" colours 'y' 'bb' 'rybyry' 'brybbr' 'rbyryrrbyrbb' 'yrbbbbryyrybb' Expected result 'y' 'b' r' r' 'y' 'b' (Today's five-dollar power word to astonish your friends and coworkers is "quasigroup".) github.co 7. Colour trio def colour_trio (colours) : This problem was inspired by the Mathologer video "Secret of Row 10". To start, assume the exis- tence of three values called "red", "yellow" and "blue". These names serve as colourful (heh) mnemonics and could as well have been 0, 1, and 2, or "foo", "bar" and "baz"; no connection to actual physical colours is implied. Next, define a rule to mix such colours so that mixing any colour with itself gives that same colour, whereas mixing any two different colours always gives the third colour. For example, mixing blue to blue gives that same blue, whereas mixing blue to yellow gives red, same as mixing yellow to blue, or red to red. Given the first row of colours as a string of lowercase letters, this function should construct the rows below the first row one row at the time according to the following discipline. Each row is one element shorter than the previous row. The i:th element of each row comes from mixing the colours in positions i and i + 1 of the previous row. Rinse and repeat until only the singleton element of the bottom row remains, returned as the final answer. For example, starting from 'rybyr' leads to 'brrb', which leads to 'yry', which leads to 'bb', which leads to 'b' for the final answer, Regis. When the Python virtual machine laughs and goes 'brrrrr', that will lead to 'yrrrr', 'brrr', 'yrr', and 'br' for the final answer 'y' for "Yes, please!" colours 'y' 'bb' 'rybyry' 'brybbr' 'rbyryrrbyrbb' 'yrbbbbryyrybb' Expected result 'y' 'b' r' r' 'y' 'b' (Today's five-dollar power word to astonish your friends and coworkers is "quasigroup".)
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
a. How could aspirin be synthesized, starting with benzene? b. Ibuprofen is the active ingredient in pain relievers such as Advil®, Motrin®, and Nuprin®. How could ibuprofen be...
-
Kathy Burnett works for Triumph Industries. Her pay rate is $13.44 per hour and she receives overtime pay at one and one-half times her regular hourly rate for any hours worked beyond 40 in a week....
-
A motorcyclist of mass 60 kg rides a bike of mass 40 kg. As she sets off from the lights, the forward force on the bike is 200 N. Assuming the resultant force on the bike remains constant, calculate...
-
What are the two most important factors when preparing to impact a machine or part for natural frequency identification?
-
On January 1, 2013, Nath-Langstrom Services, Inc., a computer software training firm, leased several computers from ComputerWorld Corporation under a two-year operating lease agreement. The contract...
-
You should not contest their claim because it would violate their right to freedom of religion. The First Amendment states that Congress shall make no law "respecting an establishment of religion"...
-
Employee ID First name Last name Job classification Jan Sales 1001 Mary Stevens Senior Sales Rep $ 85,000 1002 Larry Anderson Senior Sales Rep $ 72,000 1003 Sunil Gupta Junior Sales Rep $ 35,000 1004...
-
Draw the product formed when oleic acid is reacted with H in the presence of Pt. COOH + H Pt Modify the molecule to show the product of the reaction. You can modify the molecule by adding, deleting,...
-
Fill in the blank field in this text: You need to use the [1]_________________________________to flip the roofline when you pick the wrong side of the wall and the overhang is shown on the inside.
-
A dimension string set to Equality can only display EQ and not the actual dimension value. A) True B) False
-
Revit automatically adds a rail to every stair. A) True B) False
-
When you create a hole in a floor, Revit automatically adds a railing. A) True B) False
-
It is possible to modify elements such as doors, windows and ceilings in section views. A) True B) False
-
If you are to list the agents of socialization according to importance (begin with the most important to least important in your life, how would your list look like? Why you came with that listing,...
-
Consider the discrete group G of order 8 that has the following Cayley diagram e If we have the sequence of operations: fcagec, which of the options represents the reduction of the sequence to a...
-
Think about a service industry where you use more than one firm (examples might include ride sharing, fast-food restaurants, and grocery retailers). Evaluate the firms you use based upon how well...
-
What are the roles of signs, symbols, and artifacts?
-
Identify three situations in which you use self-service delivery. For each situation, explain your motivation for using self-service delivery rather than having service personnel do it for you.
-
Jason Vu offers tutoring services to first-year university students. He has set up a sole proprietorship business named JV Tutoring. Jason has collected the following information relating to his...
-
Finesse Fitness was established on 1 April 2024 with an initial investment of $60000 by the owner, Daniel Hewitt. During the first few months of business, the owner employed a student studying...
-
Yamindi was raised on a farm in the Northern Territory and loves animals. When he finished secondary school, Yamindi had nearly \($5000\) in a savings account. He used his savings to start a business...
Study smarter with the SolutionInn App