Exam 9: Fractals: the Geometry of Nature: Recursion, Grammars and Production Rules
Exam 1: Introduction to Python: Introduction to Numeric Types, Turtle Graphics, Simple for Loops and Functions34 Questions
Exam 2: Pthon: Estimating PI: Math and Random Methods, Selection and Boolean Expressions, the Print Function33 Questions
Exam 3: Codes and Other Secrets: String Operators and Methods, the Len Built-In Function, Keyword Parameters, User Input33 Questions
Exam 4: Introducing the Python Collections: Lists, Dictionaries, Tuples, and Statistics33 Questions
Exam 5: Bigger Data: File Io: the While Loop, String Formatting, Reading Online Data in CSV and Json Formats33 Questions
Exam 6: Image Processing: Nested for Loops, Functions As Parameters, Namespaces, Lists of Lists33 Questions
Exam 7: Data Mining: Cluster Analysis: More on the While Loop; Parrallel Lists31 Questions
Exam 8: Cryptanalysis: Advanced Dictionaries and Lists, Regular Expressions32 Questions
Exam 9: Fractals: the Geometry of Nature: Recursion, Grammars and Production Rules33 Questions
Exam 10: Astronomy: Creating Classes, Writing Constructors, Accessors, Mutators and Special Methods33 Questions
Exam 11: Simulation:computer Simulation Using Objects34 Questions
Exam 12: Father Was a Rectangle: Inheritance and Object-Oriented Design32 Questions
Exam 13: Video Games: Multithreading, Event Handlers, Static Variables33 Questions
Select questions type
Case Study 3:
Axiom A
Rules A → B
B → AB
-Refer to the production rules in the accompanying Case Study 3. How would you represent these rules in Python?
(Essay)
4.9/5
(41)
Match each definition with its phrase.
-Fractal algorithm developed in 1904 used to draw snowflakes.
(Multiple Choice)
4.9/5
(37)
Case Study 2:
def sierpinski(myTurtle, p1, p2, p3, depth):
if depth > 0:
sierpinski(myTurtle, p1,
midPoint(p1, p2), midPoint(p1, p3), depth - 1)
sierpinski(myTurtle, p2,
midPoint(p2, p3), midPoint(p2, p1), depth - 1)
sierpinski(myTurtle, p3,
midPoint(p3, p1), midPoint(p3, p2), depth - 1) else:
drawTriangle(myTurtle, p1, p2, p3)
-Refer to the session in the accompanying Case Study 2. Which parameter to the sierpinski function is reduced during the recursive step?
(Multiple Choice)
4.9/5
(40)
Case Study 3:
Axiom A
Rules A → B
B → AB
-Refer to the grammar in the accompanying Case Study 3. When translating these rules to Python, what is the best structure to use?
(Multiple Choice)
4.8/5
(35)
Case Study 1:
1. def drawSquare(aTurtle, side):
2. for i in range(4):
3. aTurtle.forward(side)
4. aTurtle.right(90)
5.
6. def nestedBox(aTurtle, side):
7. if side >= 1:
8. drawSquare(aTurtle, side)
9. nestedBox(aTurtle, side - 5)
-Refer to the session in the accompanying Case Study 1. Describe how the nestedBox function works.
(Essay)
4.9/5
(28)
Case Study 3:
Axiom A
Rules A → B
B → AB
-Refer to the grammar in the accompanying Case Study 3. Assuming you have AB, what is the next value in the sequence?
(Multiple Choice)
4.8/5
(44)
Case Study 2:
def sierpinski(myTurtle, p1, p2, p3, depth):
if depth > 0:
sierpinski(myTurtle, p1,
midPoint(p1, p2), midPoint(p1, p3), depth - 1)
sierpinski(myTurtle, p2,
midPoint(p2, p3), midPoint(p2, p1), depth - 1)
sierpinski(myTurtle, p3,
midPoint(p3, p1), midPoint(p3, p2), depth - 1) else:
drawTriangle(myTurtle, p1, p2, p3)
-Refer to the session in the accompanying Case Study 2. Which of the following lines correctly implements the midPoint function: def midPoint(p1, p2)?
(Multiple Choice)
4.8/5
(42)
Case Study 4:
1. Draw a trunk that is n units long.
2. Turn to the right 30 degrees and draw another tree with a trunk that is n − 15 units long.
3. Turn to the left 60 degrees and draw another tree with a trunk that is n − 15 units long.
-Refer to the instructions in the accompanying Case Study 4. Describe the recursive step(s).
(Essay)
4.8/5
(27)
Case Study 1:
1. def drawSquare(aTurtle, side):
2. for i in range(4):
3. aTurtle.forward(side)
4. aTurtle.right(90)
5.
6. def nestedBox(aTurtle, side):
7. if side >= 1:
8. drawSquare(aTurtle, side)
9. nestedBox(aTurtle, side - 5)
-Refer to the session in the accompanying Case Study 1. What happens when side is equal to zero?
(Multiple Choice)
4.8/5
(42)
Match each definition with its phrase.
-Formal mathematical theory designed to model the growth of biological systems.
(Multiple Choice)
4.9/5
(35)
Showing 21 - 33 of 33
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)