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

Info iconThis 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 <
Background 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

This note was uploaded on 09/15/2008 for the course CS 257 taught by Professor Thomaskerkhoven during the Fall '05 term at University of Illinois at Urbana–Champaign.

Ask a homework question - tutors are online