/ HackerRank Functional Challenges

HR F#: Lambda Calculus - Reductions #3

The third λ-calculus problem is a bit more advanced (although still simple):

Reduce the following expression, using the beta-rule, to no more than one term. If the expression cannot be reduced, enter "CAN'T REDUCE".
((λx.(x x)) (λx.(x x)))

"beta-reduction" is just recution by substituting variable value in the function body with its value. Check Reductions #1 and Reductions #2 for more examples.

The expression ((λx.(x x)) (λx.(x x))) cannot be reduced. It is easy to see that applying reduction results with exactly the same expression. So the answer is "CAN'T REDUCE".

Alex Netkachov

Alex Netkachov

Alex likes functional programming and algorithms. Apart from programming, his favourites are walking with his family in the parks and national trails and reading about universe and history.

Read More