Skip to main content
Florian F's user avatar
Florian F's user avatar
Florian F's user avatar
Florian F
  • Member for 10 years, 3 months
  • Last seen more than a month ago
  • Geneva, Switzerland
awarded
comment
Is Lambda Calculus purely syntactic?
I would add that lambdas as functions don't do anything useful. The only thing you can do with a lambda is to pass it a lambda and it returns a lambda. You have no way to test what the resulting lambda does. You can only pass it another lambda to get another lambda in return. As functions, the set of "lambda functions" behaves exactly like a singleton set containing just the identity function. It is only by considering the input and output of a lambda as expressions that you can differenciate the lambdas.
awarded
revised
What is most efficient for GCD?
added 20 characters in body
Loading…
comment
What is most efficient for GCD?
But for short code like this, the difference is significant. Stack-consuming means writing to and reading from memory. That is slow. The code above runs on 2 registers. Recursivity also means doing calls, which is longer than a conditional jump. A recursive call is much harder for branch prediction and harder to inline.
awarded
comment
Mini-Games for Artificial Intelligence Course
"Hare and Hounds" comes to mind. Search "Hare games" in Wikipedia.
awarded
revised
Loading…
awarded
Loading…
comment
Distributing values of an array into smaller arrays with bounded sums
There must be a typo. An array of 180 plus an array of 240 sums to 420. The sum of your items is 785, not a multiple of 420. And all elements are multiple of 15, except for the 5 which is not. You can not use it in a subarray that sums to 180 or 240.
comment
Distributing values of an array into smaller arrays with bounded sums
Are you looking for one solution, or a general method to solve this kind of problem?
comment
What is most efficient for GCD?
Normally, GCD[a,0] should also return a. Yours loops forever.
answered
Loading…
comment
What is most efficient for GCD?
It doesn't look right. For b==1, it should return 1. And GCD[2,1000000000] will be slow.