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

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

View Full Document Right Arrow Icon
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 fle together with any supporting PNG fles generated by MATLAB’s publish command from your script M-Fle (do not copy-paste from the command window, but you may copy-paste from the HTML Fle into Word). Late submissions will not be accepted. Please upload your Fles 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 deFned 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 deFne the function f(n) as the ratio = n ! 2 πn ± n e ² n = factorial (n) 2 πn ± n e ² n which should converge to unity for large n . DeFne 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 deFned 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) = p x 2 + a 2 + q (d x) 2 + b 2 + w
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online