MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Programming in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42549] Programming in Mathematica
  • From: "loh leeping" <lohleeping at hotmail.com>
  • Date: Tue, 15 Jul 2003 02:54:04 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hai, I wrote 2 functions as below. However, The second function did not work 
properly.

when I Input>>U[3],
the output did not contain the variable 't'.
Please help me to see is there anything wrong with them.Hope to hear from 
you soon.

T[n_] := Module[{list1 = {}, i, m =1, yes},
           While[m¡Ü n, yes = 1/(n - 1)! Sum[Binomial[n, i]*(-1)^(n - i)*(i 
- x)^(n - 1), {i, m, n}];
       list1 = PrependTo[list1, yes];
          m = m + 1]; list1]

  U[n_] := Module[{list2 = {},j = 1, r},
          While[j ¡Ü n,
          p[x_] = Part[T[n], j];
           r = p[t + n - j];
          list2 = PrependTo[list2, r];
          j = j + 1];
          list2]

Thank you.

Best regards,
Loh

_________________________________________________________________
Are you in love? Find a date on MSN Personals http://match.msn.com.my/


  • Prev by Date: Re: 3D meshes in Mathematica
  • Next by Date: solving a system of equations involving numerical integration
  • Previous by thread: Re: programming in mathematica
  • Next by thread: Confusion between rules and variables