Advertisement
Chibill

polynomial multilayer

Mar 18th, 2015
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. As Chibill posted we are making a polynomial multilayer.
  2. We are going to use a basic "algorithm", I guess you could call it.
  3. I mean all we are doing is multiplying by repetitively adding.
  4.  
  5. SOME Background...
  6.  
  7. For this examples I'm going to be using a max of x^3.
  8.  
  9. First let look at a normal polynomial.
  10. A1x2+B1x+C1 and A2x2+B2x+C2
  11. So we multiply the second polynomial by the first .
  12. (A1x2)X(A2x2+B2x+c2) = A1A2x4+A1B2x3+A1C2X
  13. And now we repeat for the other and add them all up and we end up with
  14. A1A2x4+A1B2x3+A1C2x+B1A2x3+B1B2x2+B1C2x+C1A2x2+C1B2x+C1C2
  15. now group alike terms
  16. A1A2x4+(A1B2x3+B1A2x3)+(B1B2x2+C1A2x2)+(A1C2x+B1C2x+C1B2x+C1C2)
  17.  
  18. As you can see these thing get big FAST!!!!
  19. Another BIG problem is that they come in many different sizes.
  20. like x6,x4,x8
  21.  
  22. You may have noticed that i used ”A”,”B”,”C” in the polynomial this is standard practice.
  23. By taking these NUMBERS/VARIABLES and putting them into a list we can do some cool stuff.
  24. Lets look at a few examples of this.
  25. x2 + x + 6 would be [1,1,6]
  26. 3x2+3x + 3 would be [3,3,3]
  27. x6 + 4x5 +2x2 +3 would be [1,4,0,0,2,0,3] (hime check your math,chib)
  28. You may have noticed that I filled in some extra zeros in that list. this is because you start on the largest number exponent.and continue down to no exponent and if you hit a exponent where the coefficient is zero you put a zero.
  29.  
  30. Now we start having fun! :) ( I,himehowareu, am a complete math and algorithm nut )
  31. when i was working on some math problems for a different project i was doing some polynomial multiplication and noticed a pattern. By using these lists we can use some simple addition and a “equal to” test to multiply the two polynomials.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement