Re: Have you tried recursion with Ackerman?
- From: "Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 20 Nov 2006 23:32:51 +0100
"Heinrich Wolf" <invalid@xxxxxxxxxxxxxxx> wrote in message
news:ejstqc$qhp$1@xxxxxxxxxxxxxxxxxxxxx
[...]Ackerman(0, y) := y + 1;
Ackerman(x, 0) := Ackerman(x - 1, 1);
Ackerman(x, y) := Ackerman(x - 1, Ackerman(x, y - 1));
On friday you wrote, the hailstone recursion can be substituted by
a loop. I'm afraid, the Ackermann recursion cannot be substituted
totally by loops. From playing and trying I found some partial
solutions by loops. But I cannot proof those.
The hailstone function is tail-recursive. That is a special case,
very easily linearised. In general, the call at the end of a tail-
recursive function can be transformed to a jump without changing
the function's semantics. That jump makes the entire function a
repeat-until loop.
The Ackerman call graph is a tree. While it's possible to construct
a loop that emulates two nested loops, I don't know if that scales
up to an arbitrary number of loops. Obviously, it scales up to any
_known_ number. But I don't know if it's still possible if the number
is not known in advance.
Groetjes,
Maarten Witlink
.
- References:
- Learning recursion with hailstone seqence
- From: DAVID B MORGAN
- Have you tried recursion with Ackerman?
- From: Heinrich Wolf
- Re: Have you tried recursion with Ackerman?
- From: Maarten Wiltink
- Re: Have you tried recursion with Ackerman?
- From: Heinrich Wolf
- Learning recursion with hailstone seqence
- Prev by Date: Which IP address belongs to which MAC address?
- Next by Date: Re: Which IP address belongs to which MAC address?
- Previous by thread: Re: Have you tried recursion with Ackerman?
- Next by thread: Grids ?
- Index(es):
Relevant Pages
|