1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

c++ Binomial

Discussion in 'C++' started by pmbaaru, Jul 18, 2007.

  1. pmbaaru

    pmbaaru New Member

    Joined:
    Jul 17, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I have a problem in solving these C++ Program.

    The binomial expression can be expanded as follows
    If n=2 a2+2ab+b2
    N=3
    A3+3a2b+3ab2+b3
    1
    1 2 1
    1 3 3 1
    The coefficients will be gotten using the combination ncm and its refered to as the pascal triangle
    Such that if n=4 then;
    4c0 4!/(4-0)!0!=1
    4c1 4!/(4-1)!1!=4
    4c2 4!/(4-2)!2!=6

    1. write a function to compute the combinations
    2. implement it in c++ program to output the pascal triangle for a number n.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83

Share This Page