Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

What is the simplest way of selecting the last N terms of a polynomial?

  1. Oct 25, 2011 #1
    If you have a polynomial like (1+x)^6 = x^6+6 x^5+15 x^4+20 x^3+15 x^2+6 x+1, What function would you use to pick only the last N terms? For instance, for N=3 pick x^6+6 x^5+15 x^4

    I've being using sum of a binomial times something, but was wondering if there is anything more simple.

    Thanks!
     
  2. jcsd
  3. Oct 25, 2011 #2

    Stephen Tashi

    User Avatar
    Science Advisor

    What do you mean by "to pick"? Can you state your question mathematically?
     
  4. Oct 25, 2011 #3
    Here:

    gif.latex?\dpi{120}%20(x+y)^n=\sum_{\mu=0}^{n}\binom{n}{\mu}x^ny^{n-\mu}.gif
    where

    gif.latex?\dpi{120}%20\binom{n}{\mu}=\frac{n!}{\mu!(n-\mu)!}.gif

    for example:
    tex?\dpi{150}%20(x+1)^3=\binom{3}{0}+\binom{3}{1}x+\binom{3}{2}x^2+\binom{3}{3}x^3=1+3x+3x^2+x^3.gif
     
  5. Oct 25, 2011 #4
    ^ I think he might just mean an (ordered) set of terms from the polynomial. The order is established by listing the coefficients in descending order of their degree.

    I think what you want isn't so complicated. It's as follows: if [itex]p \in \mathbb{R}\left[x\right][/itex] is a polynomial with degree n, i.e. [itex]p(x) = {p_n}{x^n} + {p_{n - 1}}{x^{n - 1}} + ... + {p_1}x + p_0[/itex], define the function [itex]F_k: \mathbb{R}\left[x\right] \rightarrow \mathbb{N}^k[/itex] by [itex]{F_k}(p) = (p_n, p_{n - 1}, ..., p_{n - k})[/itex]. This "gets" the first (or if you want, last) k coefficients, which is really all you need to define a polynomial.
     
    Last edited: Oct 25, 2011
  6. Oct 25, 2011 #5
    Exactly! This is the function I've being using. What I wonder is if there is a more simple version of it.

    Thank you very much anyways!
     
  7. Oct 25, 2011 #6
    I think it's the simplest way. May be, if you don't want to deal with combinatorics, use "[URL [Broken] triangle[/URL]
     
    Last edited by a moderator: May 5, 2017
  8. Oct 25, 2011 #7
    That only works for polynomials which can be expressed in the form (1 + x)n, though ...
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: What is the simplest way of selecting the last N terms of a polynomial?
Loading...