{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

a01 - CS 135 Fall 2011 Becker Goldberg Kaplan Tompkins...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
(b) An example from geometry (the inradius of a diamond ): radius = a · b a 2 + b 2 (c) An example from algebra (the harmonic mean ): HM = 2 1 v 1 + 1 v 2 2. Translate the following function definitions into Scheme. Place your solutions in the file functions.rkt . (a) An example from genetics (the Haldane equation ): C ( x ) = 1 2 ( 1 - e - 2 · x ) (Hint: recall from Assignment 0 the built-in Scheme function that produces e x .) (b) An example from geometry (the area of a triangle ) area ( a, b, t ) = 1 2 · a · b · sin( t ) (c) An example from physics ( ballistic motion ): height ( v, t ) = v · t - 1 2 · g · t 2 where g is the constant 9 . 8 (acceleration due to gravity) 3. The above constant 9 . 8 represents the acceleration due to gravity in units of metres per second squared ( m/s 2 ). This is a metric unit; in the United States, so-called “imperial” units are usually used instead of metric. There, the constant g would likely have the value of 32
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 5

a01 - CS 135 Fall 2011 Becker Goldberg Kaplan Tompkins...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online