MathGroup Archive 2012

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

Search the Archive

Re: How to Multiply a Sequence of #s that depends on the previous #


Easy. This is where Mathematica's Functional programming is great.

factors = {1.10, 1.15, 1.20, 1.35}; 

FoldList[Times, 50, factors] 

{50, 55., 63.25, 75.9, 102.465} 


David Park
djmpark at comcast.net 
http://home.comcast.net/~djmpark/index.html 



From: Clutch [mailto:clutchderivative at gmail.com] 

I have a list of #s : 1.10, 1.15, 1.20, 1.35.

I start off with 50 and the first # is 50 * 1.10.
The second # is the first # * 1.15.
The third # is the second # * 1.20.
The fourth # is the third # * 1.35.

I want to maintain a list of these #s.
How can this be done efficiently in Mathematica without running for loops?




  • Prev by Date: Re: How to Multiply a Sequence of #s that depends on the previous #
  • Next by Date: weird issue
  • Previous by thread: Re: How to Multiply a Sequence of #s that depends on the previous #
  • Next by thread: Re: How to Multiply a Sequence of #s that depends on the previous #