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

Mathematica variable arguments

  1. May 27, 2012 #1
    how do you define a function or make a list with n elements, where n is any? More precisely there is a function in mathematica, BellY


    which gives the partial Bell polynomial. I would like to define in mathematica the complete Bell polynomial defined as


    How can I do that?
    Thank you.
  2. jcsd
  3. May 28, 2012 #2
    Temporarily I have Mathematica forget it knows BellY so you can see the details.

    In[1]:= CBellY[n_,v_]:=Sum[BellY[n,k,Take[v,n-k+1]],{k,1,n}]

    In[2]:= CBellY[3,{1,2,3}]

    Out[2]= BellY[3,1,{1,2,3}]+BellY[3,2,{1,2}]+BellY[3,3,{1}]
  4. May 28, 2012 #3
    Great, thank you very much!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook