Exam 9: Fractals: the Geometry of Nature: Recursion, Grammars and Production Rules

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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)

A fractal is similar to itself at a smaller and smaller scale.

(True/False)
4.9/5
(38)

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)

Describe the purpose of the recursive step in a recursive function.

(Essay)
4.9/5
(43)

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)

How many recursive steps are used to draw a tree?

(Multiple Choice)
4.8/5
(39)

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
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)