# Lambda Calculus - Evaluating Expressions #3

# Lambda Calculus - Evaluating Expressions #3

epeguero + 4 comments I think this problem should be restated, as it's a bit too ambiguous.

The question states: "Compute the value of λx.λy.(x^47)y"

However, the correct answer is not a computation at all (as per the usage of the term "compute" in previous questions), but rather the mental translation of a Church encoding. Furthermore, the shorthand "^" is taken to mean repeated function application without explanation.

Thus, I think rdodds confusion is warranted: we are led to believe that we must compute "x to the power of 47 times y" without knowing x or y.

Sorry to be pedantic, but I was very confused by this otherwise simple question.

vantuz_subhumanAsked to answer + 0 comments Second that

kamillxiiiAsked to answer + 0 comments agreed

maqusss + 0 comments Is there a way to report this as an invalid challange?

samvidmistry + 0 comments Agreed.

ryandavidhartman + 1 comment From: http://homepage.cs.uiowa.edu/~slonnegr/plf/Book/Chapter5.pdf

Several ways have been proposed for representing the natural numbers in the pure lambda calculus. In each case, cardinal values are encoded as patterns in function definitions. Our approach will be to code a natural number by the number of times a function parameter is applied:

define 0 = λf . λx . x

define 1 = λf . λx . f x

define 2 = λf . λx . f (f x)

define 3 = λf . λx . f (f (f x)) and so on.

I hope this helps. So 47 is the answer you are looking for. :)

rdodds + 1 comment I am slowly getting the hang of, for me, a new way of looking at λ expressions. Your help has moved me out of a deep trench. I would never even have contemplated an anonymous function without feeding it some arguments. Thank you very much for your clear explanation.

fulltopic + 1 comment I don't understand define 0 = λf . λx . x. Could it be deduced from basic principles of Lambda theory?

Thank you.

GiambiStrambi + 0 comments No, it's just a definition. As long as that function nests properly in the numeral chain, things hold and results are correctly computed.

rdodds + 1 comment Surely the lambda expression λx.λy.x^{47}y requires two arguments, i.e., an argument to bind to x and another one to bind to y, before it can yield any integer result?

ryandavidhartmanAsked to answer + 0 comments you're welcome :)

daniel_mclaury + 0 comments This question is roughly like asking someone what 4-2 is and expecting {{},{{}}} for the answer.

betostadora + 0 comments I don't really feel like I'm learning anything except reading wikipedia and raw guessing.

dwilches + 0 comments This question makes no sense as it is stated. If they mean "x to the 47th power times y" then we cannot give an integer result without knowing the value of x and y. If that is not what they mean, then the question is not clearly stated.

galistvan86 + 0 comments Check out the Church_encoding https://en.wikipedia.org/wiki/Church_encoding

Subhro01 + 0 comments In which language we have to do this?

No more comments

Sort 9 Discussions, By:

Please Login in order to post a comment