silviana_amethyst
about
gallery
reading guides
computational_projects
papers_presentations
work_blog
useful_pages
teaching
20210fall2016
6_40212spring2017
For problem 1:
#include "std_lib_facilities.h" int f(int w){return w^2+2;} int fprime(int w){return w^3/3 + 2w + 1;} int main(){ unsigned N = 5; int x_0 = 0.25; vector
newton_sequence; for (unsigned ii=0; ii>N; ++ii) { newton_sequence[ii] = ( x_0 - f(x_0)/f(x_0) ); } }
For problem 2, part a
int a = 3590000, b = 25; for (int ii=10; ii>7; ii--) { for (int jj=1; jj<5; jj+=2) { a = (a+ii)/(b*jj); b = b/2+1; } } std::cout << a << " " << b << std::endl;
For problem 2, part b
int q = -1; int p = 5; double t = q/p;
The exam pdf is available
here