osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Writing a program to illustrate a fractal


On 8/26/18 5:40 PM, Dennis Lee Bieber wrote:
> 	But their definition is still confusing as it is formulated with a
> expression as the argument to a().
>
> 	Taken literally, it says for n+4 to call a() with an argument of 8 (2n)
> AND to call it with an argument of 7 (2n-1) (returning two values) 

I have seen that sort of notation before for defining sequences (which
is what he was doing). Yes, it is not very useful for actually
implementing a function to compute the values, but if a was stored in an
array it makes some sense, as you make a loop that runs n, and compute
the various elements. The one confusion with how it was defined was that
the recursive definition starts at n=2, but for that value you only
compute the even value, as 2*n-1 = 3 which has already been defined, and
that definition would reference a(0) which hasn't been defined.

This is one reason I presented what I say as the 'normalized' equations
which are what would be more needed to actually compute as a function.

-- 
Richard Damon