       Re: sequence of functions

• To: mathgroup at smc.vnet.net
• Subject: [mg120130] Re: sequence of functions
• From: DrMajorBob <btreat1 at austin.rr.com>
• Date: Sat, 9 Jul 2011 07:32:15 -0400 (EDT)
• References: <201107080855.EAA28789@smc.vnet.net>

```ClearAll[f, x]
f[x_] = x (1 - x);
f[n_Integer?Positive][x_] :=
f[n][x] = Simplify[f[n - 1][2 x] + f[n - 1][2 x - 1]]

f[x]

(1 - x) x

f[x]

-2 (1 - 2 x)^2

f[x]

-20 + 64 x - 64 x^2

f[x]

-8 (21 - 64 x + 64 x^2)

?f

(output omitted)

Bobby

On Fri, 08 Jul 2011 03:55:33 -0500, rych <rychphd at gmail.com> wrote:

> I would like to build a function sequence inductively, for example
> f[n][x]=f[n-1][2x]+f[n-1][2x-1], f[x] = x(1-x)
>
> This is what I tried in Mathematica,
>
> ClearAll["Global`*"]
> f[n_] = Function[x, Simplify[f[n - 1][2 x] + f[n - 1][2 x - 1]]];
> f = Function[x, x (1 - x)];
>
> f[x]
> Out:
> -20 + 64 x - 64 x^2
>
> ?f
> Out:
> Global`f
> f=Function[x,x (1-x)]
> f[n_]=Function[x,Simplify[f[n-1][2 x]+f[n-1][2 x-1]]]
>
> My questions: it doesn't seem to cache the previous f[n-1] etc? If I
> do it this way instead,
> f[n_] := f[n] = Function[...
>
> Then it does cache the f[n-1] etc. but still in the unevaluated form,
> Global`f
> f=Function[x,x (1-x)]
> f=Function[x\$,Simplify[f[1-1][2 x\$]+f[1-1][2 x\$-1]]]
> f=Function[x\$,Simplify[f[2-1][2 x\$]+f[2-1][2 x\$-1]]]
> f[n_]:=f[n]=Function[x,Simplify[f[n-1][2 x]+f[n-1][2 x-1]]]
>
> How do I force the reduction so that I see f = -2 (1 - 2 x)^2, etc.
> in the definitions?
>
> Thanks,
> Igor
>
>

--
DrMajorBob at yahoo.com

```

• Prev by Date: Re: How to write a "proper" math document
• Next by Date: Re: sequence of functions
• Previous by thread: sequence of functions
• Next by thread: Re: sequence of functions