{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

prob02 - Homework Problems Week 2 440:127 Fall 2011 S J...

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

Homework Problems – Week 2 440:127 – Fall 2011 – S. J. Orfanidis This homework set is due online at Sakai no later than 5:00 AM on Monday, September 26, 2011. Please submit the HTML file together with any supporting PNG files generated by MATLAB’s publish command from your script M-file (do not copy-paste from the command window, but you may copy-paste from the HTML file into Word). Late submissions will not be accepted. Please upload your files to Sakai under Assignments, not to the Drop Box. Please do the following problems: 1. Problems 3.6–3.9 dealing with discrete mathematics functions. 2. The factorial of an integer n is defined as the product n ! = 1 · 2 · 3 · · · n . Stirling’s approximation states that for large n , the factorial behaves as: n ! 2 πn n e n where e = exp ( 1 ) = 2 . 71828 · · · . To test it, let us define the function f(n) as the ratio f(n) = n ! 2 πn n e n = factorial (n) 2 πn n e n which should converge to unity for large n . Define the vector n = [ 1 , 2 , 3 , . . . , 50 ] , that is, in MATLAB, n = 1:50. Using MATLAB’s built-in function factorial , which admits vector inputs, calculate the corre- sponding vector of f values using a completely vectorized calculation (no loops). Then, plot f versus n and verify that f converges to unity. 3. In a joint civil engineering project, two towns A and B decide to build a bridge across a river separating them. The vertical distances of the towns to the river are a, b , the river width is w , and the distance separating the towns along the river is d , as shown below. The total distance (red line) between the two towns through the bridge is the sum of the segments: L = (AC) + (CD) + (DB) . The bridge location is defined by the distance x from the point O , that is, x = (OC) . The total distance may be thought of as a function of x and is given by: L(x) = x 2 + a 2 + (d x) 2 + b 2 + w

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}