hw1 - 1 0 and returns the fractional binary representation...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 257 Numerical Methods - Homework 1 August 31, 2006 1. [1pt] Count the number of operations involved in evaluating a polynomial using nested multiplication. 2. [1pt] Why does the function f ( x ) = | x | not posses a Taylor series at x = 0? 3. [1pt] In the Taylor series for the function 3 x 2 - 7 + cos x (expanded about x = 0) what is the coefficient of x 2 . 4. [1pt] Using the Alternating Series Theorem, what is the least number of terms required to compute π as 3 . 14 (rounded) using the series π = 4 - 4 3 + 4 5 - 4 7 + . . . 5. [1pt] Do you expect your computer to calculate 3 × 1 3 with infinite precision? What about 2 × 1 2 or 10 × 1 10 ? 6. [2pt] Write a MATLAB function float2bin that takes as input a floating point number x (from the range 0 . 0 x <
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 . 0) and returns the fractional binary representation of that number. Look in Section 2.1 of the book for guidance. You may find the MATLAB functions num2str and floor helpful, as well as the built in documentation regarding strings and the concatenation of strings. The following test cases illustrate the intended behavior of float2bin in a MATLAB session. >> float2bin(0.0) ans = 0. >> float2bin(0.5) ans = 0.1 >> float2bin(0.125) ans = 0.001 >> float2bin(0.1) ans = 0.0001100110011001100110011001100110011001100110011001101 >> float2bin(0.123) ans = 0.0001111101111100111011011001000101101000011100101011 1...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern