 Horner’s method - Page 2 - XP Math - Forums Sign Up FREE! | Sign In | Classroom Setup | Common Core Alignment  XP Math - Forums Horner’s method 03-18-2007 #11 Temperal Guest   Posts: n/a Hmmm... All right, I'll lift my suspicions... for now. 03-18-2007 #12 Smzrterthanu Guest   Posts: n/a See, if you read sci-fi thing I read you'd know knaves always lie and knights always tell the truth and I am a knight. now if i told you i made mc nats(which i didn't but i could but i probably won't) you can call me a knave and i'd be fine since you'd be being a knight in that case. 03-18-2007 #13 Temperal Guest   Posts: n/a Rather an... interesting way of looking at things.  03-23-2007 #14 hyderman Guest   Posts: n/a here you go guys look how easy -------------------------------------------------------------------------------- The Horner’s method is an algorithm that evaluates polynomials. The following pseudocode shows how to use this method to find the value of a_nx^n + a_{n-1}x^{n-1} + . . . + a_1x + a_0 at x = c. procedure Horner(c, a_0, a_1, a_2, . . . , a_n : real numbers) y := a_n for i := 1 to n y := y * c + a_{n-i} end {y = a_nc^n + a_{n-1}c^{n-1} + . . . + a_1c + a_0} (a) Evaluate x^2 + 5x + 3 at x = 2 by working through each step of the algorithm. y:=1 [since n=2 and a_2=1] i:=1 [first time the loop runs] y:=y*2+5 =1*2+5=2+5=7 [since c=2 and a_1=5] i:=2 [second time the loop runs] y:=y*2+3=7*2+3=14+3=17 [since c=2 and a_0=3] end [loop runs n=2 times only] Indeed, 2^2+5*2+3=4+10+3=17 ! (b) Exactly how many multiplications and additions are used by this algorithm to evaluate a polynomial of degree n at x = c? (Do not count additions used to increment the loop variable.) Each time the loop repeats it performs 1 multiplication [y*c] and 1 addition [adds a_{n-i} to it]. Loop repeats n times [i goes from 1 to n] so this algorithm performs n multiplications and n additions ! 03-24-2007   #15
Temperal
Guest

Posts: n/a Quote:
 Originally Posted by hyderman here you go guys look how easy -------------------------------------------------------------------------------- The Horner’s method is an algorithm that evaluates polynomials. The following pseudocode shows how to use this method to find the value of a_nx^n + a_{n-1}x^{n-1} + . . . + a_1x + a_0 at x = c. procedure Horner(c, a_0, a_1, a_2, . . . , a_n : real numbers) y := a_n for i := 1 to n y := y * c + a_{n-i} end {y = a_nc^n + a_{n-1}c^{n-1} + . . . + a_1c + a_0} (a) Evaluate x^2 + 5x + 3 at x = 2 by working through each step of the algorithm. y:=1 [since n=2 and a_2=1] i:=1 [first time the loop runs] y:=y*2+5 =1*2+5=2+5=7 [since c=2 and a_1=5] i:=2 [second time the loop runs] y:=y*2+3=7*2+3=14+3=17 [since c=2 and a_0=3] end [loop runs n=2 times only] Indeed, 2^2+5*2+3=4+10+3=17 ! (b) Exactly how many multiplications and additions are used by this algorithm to evaluate a polynomial of degree n at x = c? (Do not count additions used to increment the loop variable.) Each time the loop repeats it performs 1 multiplication [y*c] and 1 addition [adds a_{n-i} to it]. Loop repeats n times [i goes from 1 to n] so this algorithm performs n multiplications and n additions ! The crazy thing is, I actually almost understood part of that.

 Thread Tools Show Printable Version Email this Page Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Welcome     XP Math News     Off-Topic Discussion Mathematics     XP Math Games Worksheets     Homework Help     Problems Library     Math Challenges

All times are GMT -4. The time now is 12:50 AM.

 Contact Us - XP Math - Forums - Archive - Privacy Statement - Top XP Math