Hacker News new | ask | show | jobs
by hedora 3170 days ago
You said that recursive and iterative computations are fundamentally different. I pointed out a class of recursive and iterative algorithms that are equivalent to each other. That class disproves your statement.

I’m not sure what you’re trying to get at...

1 comments

I'm actually not sure what you're getting at -- the logic you just presented is "the primes and evens are the same set of numbers because both contain 2".

Assuming you mean the and not a, they're still not the same, as equivalent algorithms need not be identical. Example: 5-3 and 1+1 both compute the result 2, making them equivalent but non-identical algorithms.

There's a way to transform any subtractive recipe for a number into an additive recipe so they're equivalent classes, but addition and subtraction aren't identical as operations.