10-10-2013 HW p

posted Oct 10, 2013, 3:05 AM by Samuel Konstantinovich   [ updated Oct 11, 2013, 7:46 AM ]
I always tell my students that sleeping more means they can study less. You ignore me. 
After you read this article, if you still think your sleeping habits lead to success then you are just telling me you don't want to do better in life (and school). 
http://www.bbc.co.uk/news/magazine-24444634 


Do Now: Lab + Homework. Bring in a printed copy tomorrow. Box diagrams may either be drawn in by hand, or printed (if you want to make it look nice).

Convert 1 and 2 into scheme notation lists:
Draw a box diagram for the following lists:
3.  '( a (b (c) ) )
4. '( (a)  (b)  (c) )
5. '( a () b) 
6. '(a () () b)
7. '(a ( () ) )

Write a car/cdr sequence to extract the indicated element from the list:
8. From question 1, extract d.
9. From question 2 extract d.
10.  From  '( (a)  (b)  (c) )  extract  (b).
11. From  '( (a)  (b)  (c) ) extract b.

Please feel free to use the computer to help you solve these questions!

12. Look at some XKCD comics. Which is your favorite? Why?











Solutions:
1. ( (G) (T) (D B))
2. (X ((D B)) Q (S) )

8. (caaddr Q1)
9. (caaadr Q2)
10. (cadr '( (a) (b) (c) ) )
11. (caadr '( (a) (b) (c) ) )
Comments