[Date Index]
[Thread Index]
[Author Index]
Re: question
*To*: mathgroup at smc.vnet.net
*Subject*: [mg80161] Re: question
*From*: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
*Date*: Tue, 14 Aug 2007 06:56:35 -0400 (EDT)
*Organization*: The Open University, Milton Keynes, UK
*References*: <f9p5p7$rgb$1@smc.vnet.net>
Ivan Egorov wrote:
> I need to write a function maxima[lis_List] which, given a list of numbers,
> produces a list of those numbers greater than all those that precede
> them. For example maxima[{ 9, 2, 10, 3, 14, 9}] returns { 9, 10, 14}.
> You need to use recursion, pattern matching, Select and Join.
So this is homework assignment. In such cases, the usage is that you
show your working (that is what *you* have done so far to answer the
given problem) and ask specific questions bout your working (for
instance, why at this stage it does not yield the expected result, or a
faster approach, or so clarification about an error message, etc.)
Just (re)writing the question and asking somebody else to answer it is
not an acceptable practice. (And sending unsolicited email asking for
help is not an acceptable practice too.)
By the way, I and some other regular contributors to this newsgroup have
already provided many answers to this question during the last few days
(at least two threads deal with it). Did you check them?
> I also need to write a function derivList[f, x, n_Integer] that returns the list
> of first n derivatives of themathematical function f (x ) , that is,
> { f ( x ) , f ' ( x ) , f ' ' ( x ) ,..., f n(x )} . Then, operate
> your derivList implementation on Exp[-x] Sin[x] to generate the list
> of derivatives up to the fifth one (that is, returning {f ( x) ,
> f ' ( x ) ,..., f (5) (x )}). Use Plot to plot the results for the
> range 0<=x<=10 . Use the PlotStyle option to generate a different color
> for each curve.
>
> I realy don't understand what they want in second question.
Who are 'they'? Why don't you ask 'them' for clarification? Might 'they'
mean something like the following expression?
derivList[f_, x_, n_Integer] := D[f, {x, #}] & /@ Range[n]
--
Jean-Marc
Prev by Date:
**Re: Indexed element treated as number?**
Next by Date:
**RE: Re: question in mathematica**
Previous by thread:
**Re: question**
Next by thread:
**Re: question**
| |