Lambda Calculus Fundamentals
- 50Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
In the lambda calculus, what does a function fundamentally represent?
In the lambda calculus, what does a function fundamentally represent?
50 questions
- 1
In the lambda calculus, what does a function fundamentally represent?
- A
A mapping from inputs to outputs
- B
A sequence of instructions with a fixed length
- C
A rule that converts every input into a number
- D
A storage location for reusable values
Correct answer
AA mapping from inputs to outputs
Explanation
A function is understood as a mapping from inputs to outputs, such as mapping a number to its square.
- A
- 2
Why can the input variable in a function such as λx.x2 be renamed to another symbol without changing the function?
- A
The variable is discarded whenever the function is applied to an input.
- B
The variable must always be a number, so any symbol has the same numeric value.
- C
The variable is only a placeholder, and its consistent renaming preserves the mapping.
- D
The variable determines the function's output, so changing it changes the mapping.
Correct answer
CThe variable is only a placeholder, and its consistent renaming preserves the mapping.
Explanation
The variable names the function's input. Renaming it and its occurrences consistently does not change which inputs map to which outputs.
- A
- 3
What is the name for two functions that differ only in the name of their input variable?
- A
They are beta reduced.
- B
They are recursively defined.
- C
They are type equivalent.
- D
They are alpha equivalent.
Correct answer
DThey are alpha equivalent.
Explanation
Functions that differ only by a consistent renaming of their input variable are alpha equivalent.
- A
- 4
What is alpha conversion?
- A
Changing a function's output into a new input variable
- B
Assigning a type to a function after it is evaluated
- C
Renaming a function's input variable and its occurrences consistently
- D
Substituting an argument for a function's input variable
Correct answer
CRenaming a function's input variable and its occurrences consistently
Explanation
Alpha conversion is the process of changing a bound input variable's name, along with its occurrences in the function.
- A
- 5
In the notation λx.m, what does the symbol λ indicate?
- A
That the function is being applied to m
- B
That x and m have the same type
- C
That the function must return a Boolean value
- D
That a function is being defined
Correct answer
DThat a function is being defined
Explanation
The lambda symbol is a visual marker indicating that a function is being defined; it does not itself specify a special computation.
- A
- 6
In λx.m, what role does the dot play?
- A
It separates the function's type from its output.
- B
It separates the input variable from the function's body.
- C
It marks the point where the function is applied to an input.
- D
It indicates that the function returns a second function.
Correct answer
BIt separates the input variable from the function's body.
Explanation
The dot separates the input variable x from the body m, which specifies the function's output.
- A
- 7
What does it mean to apply the function λx.x+1 to the input 3?
- A
Replace the 3 in the input with x, producing x+1.
- B
Rename x to 3 while leaving the function unapplied.
- C
Add 3 to the function's input variable without changing its body.
- D
Replace x in the function body with 3, producing 3+1.
Correct answer
DReplace x in the function body with 3, producing 3+1.
Explanation
Applying the function substitutes the input 3 for its input variable x in the body, giving 3+1.
- A
- 8
What is beta reduction?
- A
Substituting an argument for a function's input variable
- B
Assigning an input variable a Boolean or numeric type
- C
Renaming a function's input variable without changing its body
- D
Turning an ordinary function into a function that returns another function
Correct answer
ASubstituting an argument for a function's input variable
Explanation
Beta reduction is the computation step in which an applied function's input is substituted for its input variable in the body.
- A
- 9
How is a beta reduction conventionally marked in the notation described?
- A
With a colon placed after the function body
- B
With a dot placed between the input and output
- C
With an equals sign placed before the input
- D
With an arrow marked by the Greek letter beta
Correct answer
DWith an arrow marked by the Greek letter beta
Explanation
The described notation uses an arrow with a small beta next to it to indicate that a beta reduction has taken place.
- A
- 10
If λx.x+1 is applied to 3, what result does beta reduction produce?
- A
3
- B
x+4
- C
3x+1
- D
4
Correct answer
D4
Explanation
Substituting 3 for x gives 3+1, which evaluates to 4.
- A
- 11
Which three kinds of expressions are allowed in the basic lambda calculus described?
- A
Variables, lambda abstractions, and applications
- B
Functions, Boolean values, and data structures
- C
Variables, loops, and conditional statements
- D
Numbers, type declarations, and recursive definitions
Correct answer
AVariables, lambda abstractions, and applications
Explanation
The basic calculus uses only variables, lambda abstractions, and applications, with beta reduction as its computation rule.
- A
- 12
What computation rule is used to evaluate expressions in the basic lambda calculus?
- A
Beta reduction
- B
Type inference
- C
Alpha conversion
- D
Conditional branching
Correct answer
ABeta reduction
Explanation
The basic lambda calculus computes by beta reduction, substituting an applied function's argument into its body.
- A
- 13
What makes the functions of the lambda calculus higher order?
- A
They can accept functions as inputs and return functions as outputs.
- B
They automatically repeat their computation until a condition is met.
- C
They must accept at least two inputs before producing an output.
- D
They can only be applied after receiving a value of a specified type.
Correct answer
AThey can accept functions as inputs and return functions as outputs.
Explanation
A higher-order function can take another function as an input or produce a function as its output.
- A
- 14
Why can a calculus with only single-input lambda abstractions still represent a function of two inputs?
- A
The calculus treats every pair of inputs as one built-in number.
- B
Beta reduction automatically creates a second input variable.
- C
The first input can produce a function that accepts the second input.
- D
A single input variable can hold two values at the same time.
Correct answer
CThe first input can produce a function that accepts the second input.
Explanation
A function can accept its first input and return another function that accepts the second, allowing inputs to be supplied sequentially.
- A
- 15
Consider λx.λy.x+y. What does applying it to 1 produce after the first beta reduction?
- A
A function equivalent to λy.1+y
- B
The number 1
- C
A function equivalent to λx.x+1
- D
The number 2
Correct answer
AA function equivalent to λy.1+y
Explanation
The first application substitutes 1 for x, leaving λy.1+y, a function waiting for its second input.
- A
- 16
After λx.λy.x+y is applied first to 1 and then to 2, what is the result?
- A
1
- B
3
- C
2
- D
12
Correct answer
B3
Explanation
The first application produces λy.1+y; applying that function to 2 gives 1+2=3.
- A
- 17
What is the name of representing a multi-input function as a sequence of functions that each take one input?
- A
Currying
- B
Boolean selection
- C
Beta typing
- D
Alpha conversion
Correct answer
ACurrying
Explanation
Currying represents a function with multiple inputs as a function that returns another function, allowing inputs to be supplied one at a time.
- A
- 18
In applying λx.λy.L to inputs m and n, what happens first?
- A
Substitute n for y, leaving a function that can then receive m.
- B
Substitute m for x, leaving a function that can then receive n.
- C
Replace L with m and use n as the function's output.
- D
Substitute both inputs simultaneously before any reduction occurs.
Correct answer
BSubstitute m for x, leaving a function that can then receive n.
Explanation
Curried application proceeds sequentially: first substitute m for x, then apply the resulting function to n and substitute it for y.
- A
- 19
Which pair of lambda terms represents true and false in the Boolean encoding described?
- A
true=λx.λy.x and false=λx.λy.y
- B
true=λx.λy.y and false=λx.λy.x
- C
true=λx.λy.x+y and false=λx.λy.x−y
- D
true=λx.x and false=λy.y
Correct answer
Atrue=λx.λy.x and false=λx.λy.y
Explanation
In this encoding, true selects the first of two arguments, while false selects the second.
- A
- 20
How does the encoded conditional λb.λx.λy.b x y choose a result?
- A
It applies b to x and y, so the Boolean encoding selects one of them.
- B
It applies x to b and then uses y as the output.
- C
It adds x and y, then uses b to choose the sign.
- D
It compares x and y, then returns whichever matches b.
Correct answer
AIt applies b to x and y, so the Boolean encoding selects one of them.
Explanation
The conditional takes a Boolean and two terms, then applies the Boolean to those terms. The Boolean encoding selects which term is returned.
- A
- 21
What does the encoded conditional return when its Boolean argument is true and its other arguments are M and N?
- A
M, because true selects the first argument
- B
MN, because true applies the first argument to the second
- C
Neither term, because the Boolean cannot select between arbitrary terms
- D
N, because true selects the second argument
Correct answer
AM, because true selects the first argument
Explanation
The true encoding returns its first argument, so the conditional returns M when given true, M, and N.
- A
- 22
What does the encoded conditional return when its Boolean argument is false and its other arguments are M and N?
- A
Neither term, because false has no behavior under application
- B
M, because false selects the first argument
- C
MN, because false applies the first argument to the second
- D
N, because false selects the second argument
Correct answer
DN, because false selects the second argument
Explanation
The false encoding returns its second argument, so the conditional returns N when given false, M, and N.
- A
- 23
How can a not function be expressed using the encoded conditional?
- A
λb.if b then false else true
- B
λb.if true then b else false
- C
λb.if b then true else false
- D
λb.if false then b else true
Correct answer
Aλb.if b then false else true
Explanation
Negation swaps the Boolean values: when b is true it returns false, and when b is false it returns true.
- A
- 24
What is the purpose of encoding familiar concepts such as Booleans and conditionals in the lambda calculus?
- A
It adds new primitive syntax that replaces variables and applications.
- B
It allows programmers to use those concepts while treating their low-level definitions as details.
- C
It makes the calculus require fewer beta reductions for every expression.
- D
It ensures that all encoded concepts have the same type.
Correct answer
BIt allows programmers to use those concepts while treating their low-level definitions as details.
Explanation
Once a concept has been encoded, programmers can reason about it as a Boolean or conditional without repeatedly unfolding its implementation.
- A
- 25
Which additional concepts does the content say can also be encoded in the lambda calculus?
- A
Static types, classes, and exception handlers
- B
Machine instructions, memory addresses, and network protocols
- C
Numbers, recursion, and data types such as pairs
- D
Loops, built-in arrays, and parallel processors
Correct answer
CNumbers, recursion, and data types such as pairs
Explanation
The content specifically notes that numbers, recursion, and data types such as pairs can be encoded in the lambda calculus.
- A
- 26
What problem can arise if the not function is applied to the number 1 rather than to a Boolean?
- A
The number is treated as a function that selects the first branch.
- B
The function automatically converts 1 into true and returns false.
- C
The conditional receives a value that is not a Boolean, so its intended meaning breaks down.
- D
The function returns 1 unchanged because it accepts any input.
Correct answer
CThe conditional receives a value that is not a Boolean, so its intended meaning breaks down.
Explanation
The not function is intended to receive a Boolean. Applying it to 1 leads to a conditional with a non-Boolean condition, which has no intended meaning in this encoding.
- A
- 27
What is a type in the simply typed lambda calculus described?
- A
A rule for deciding which argument is selected by a Boolean
- B
A replacement name for a function's input variable
- C
A label assigned to terms to indicate what kinds of values they represent
- D
A symbol that marks where a beta reduction should occur
Correct answer
CA label assigned to terms to indicate what kinds of values they represent
Explanation
A type is a label for a term that indicates what kind of value it represents and helps distinguish meaningful from inappropriate applications.
- A
- 28
Which base types are used in the example type system?
- A
function and application
- B
true and false
- C
input and output
- D
bool and num
Correct answer
Dbool and num
Explanation
The example system builds types from Boolean values, written bool, and numeric values, written num.
- A
- 29
What does the notation true:bool state?
- A
The term true is equivalent to every Boolean term.
- B
The term true is being applied to a Boolean input.
- C
The type bool is defined using the term true.
- D
The term true has Boolean type.
Correct answer
DThe term true has Boolean type.
Explanation
Writing a type after a colon indicates the type of the term before it; thus, true:bool says true has Boolean type.
- A
- 30
If a function has type A→B, what do A and B describe?
- A
A and B are alternative types for the same input.
- B
A is the input type, and B is the output type.
- C
A is the output type, and B is the input type.
- D
A is the function's name, and B is its input variable.
Correct answer
BA is the input type, and B is the output type.
Explanation
A function type A→B describes a function that accepts an input of type A and produces an output of type B.
- A
- 31
How is the input type of a lambda abstraction indicated in the typed notation described?
- A
By placing the type beside the beta-reduction arrow
- B
By writing the type after the function's output
- C
By replacing the input variable with its type
- D
By writing the type next to the input variable
Correct answer
DBy writing the type next to the input variable
Explanation
The input variable is annotated with its type when writing a typed lambda abstraction.
- A
- 32
Why does the typing rule reject applying a function that expects a Boolean to the number 1?
- A
The function has no input variable that can be replaced by a number.
- B
Beta reduction is allowed only for functions that return numbers.
- C
The argument has type num, but the function requires type bool.
- D
The number 1 cannot appear in any lambda-calculus expression.
Correct answer
CThe argument has type num, but the function requires type bool.
Explanation
The rule permits application only when the argument's type matches the function's declared input type. Here, num does not match bool.
- A
- 33
What type does the Boolean negation function have?
- A
bool→num
- B
bool→bool
- C
num→num
- D
num→bool
Correct answer
Bbool→bool
Explanation
Negation takes a Boolean input and returns a Boolean output, so its type is bool→bool.
- A
- 34
What is the main benefit of the typing rules in the example?
- A
They prevent applications that would produce nonsensical uses of encoded concepts.
- B
They make the calculus capable of computing functions that were previously impossible.
- C
They ensure that every expression evaluates to a Boolean.
- D
They remove the need for lambda abstractions and applications.
Correct answer
AThey prevent applications that would produce nonsensical uses of encoded concepts.
Explanation
The type rules restrict which terms can be applied to which functions, preventing cases such as using a number where a Boolean is required.
- A
- 35
How does the simply typed lambda calculus compare to the untyped lambda calculus?
- A
It replaces beta reduction with a rule for renaming variables.
- B
It adds a typing system that restricts valid applications.
- C
It adds built-in loops and data structures as primitive syntax.
- D
It removes functions that return other functions.
Correct answer
BIt adds a typing system that restricts valid applications.
Explanation
The simply typed version retains lambda-calculus expressions but adds types and rules that restrict applications to matching types.
- A
- 36
In the Curry–Howard interpretation described, what do types correspond to?
- A
Program outputs
- B
Computation steps
- C
Variable names
- D
Propositions
Correct answer
DPropositions
Explanation
Under the Curry–Howard correspondence, types are interpreted as propositions.
- A
- 37
Under the same interpretation, what does a term of type A represent?
- A
A function that converts proposition A into a type
- B
A statement that proposition A is false
- C
A proof that the proposition corresponding to A is true
- D
A variable that has not yet been assigned a proposition
Correct answer
CA proof that the proposition corresponding to A is true
Explanation
Terms are interpreted as proofs: a term of type A serves as a proof of the proposition represented by A.
- A
- 38
In the interpretation presented, what does the absence of a term of type A indicate?
- A
There is no proof of proposition A in the system.
- B
The proposition A must be a function input.
- C
The type A must be equivalent to a numeric type.
- D
The proposition A has already been reduced.
Correct answer
AThere is no proof of proposition A in the system.
Explanation
The content describes a term of type A as a proof that A is true; if no such term exists, it treats A as false.
- A
- 39
What logical proposition corresponds to the function type A→B?
- A
A and B are both false
- B
A is equivalent to B
- C
B implies A
- D
A implies B
Correct answer
DA implies B
Explanation
A function type A→B corresponds to the proposition “if A, then B.”
- A
- 40
Suppose there is a term n of type A and a function of type A→B. What does applying the function to n demonstrate?
- A
It fails because terms of type A cannot be used as function arguments.
- B
It produces a term of type A, showing that A and B are identical.
- C
It produces a term of type B, supporting the conclusion that B follows from A.
- D
It produces a term of type A→B, showing that no input is needed.
Correct answer
CIt produces a term of type B, supporting the conclusion that B follows from A.
Explanation
A function of type A→B accepts a term of type A and returns a term of type B. In the logical interpretation, this corresponds to using proof of A and proof of A⇒B to obtain a proof of B.
- A
- 41
In the example where A means “it is raining” and B means “the ground is wet,” what does A→B mean?
- A
If the ground is wet, then it is raining.
- B
If it is raining, then the ground is wet.
- C
It is not raining, but the ground is wet.
- D
It is raining exactly when the ground is wet.
Correct answer
BIf it is raining, then the ground is wet.
Explanation
The implication A→B means that if the proposition A is true, then B follows: if it is raining, the ground is wet.
- A
- 42
What is the name for the relationship between types and propositions, and between terms and proofs?
- A
The Church–Turing thesis
- B
Beta reduction
- C
Alpha equivalence
- D
The Curry–Howard correspondence
Correct answer
DThe Curry–Howard correspondence
Explanation
The Curry–Howard correspondence connects types with propositions and terms with proofs.
- A
- 43
What are proof assistants such as Lean and Agda used for in this account?
- A
Replacing lambda-calculus expressions with ordinary English statements
- B
Converting every mathematical proposition into a numeric value
- C
Automatically proving any claim that is entered into the system
- D
Writing mathematical proofs as computer code and checking them through types
Correct answer
DWriting mathematical proofs as computer code and checking them through types
Explanation
Proof assistants use the connection between types and propositions to express mathematical proofs in code; a proof can be checked by verifying its type.
- A
- 44
Why does a proof assistant's successful type check provide evidence that a written proof is correct?
- A
A successful check means the proposition was assumed to be true in advance.
- B
The system evaluates the proposition as a Boolean without checking the proof.
- C
The proof is represented as a term whose type corresponds to the proposition being proved.
- D
The system checks only that the code contains no variable names.
Correct answer
CThe proof is represented as a term whose type corresponds to the proposition being proved.
Explanation
Under Curry–Howard, a proof is a term of the type corresponding to the target proposition. Type checking verifies that the term has that type.
- A
- 45
Which mathematical result is given as an example of a theorem proved in Lean?
- A
Every function has exactly two inputs.
- B
Every Boolean expression reduces to a number.
- C
Every number is the square of another number.
- D
There are infinitely many prime numbers.
Correct answer
DThere are infinitely many prime numbers.
Explanation
The content mentions a Lean program proving that there are infinitely many prime numbers.
- A
- 46
When was the lambda calculus developed by Alonzo Church, according to the content?
- A
Between the 1980s and 1990s
- B
Between the 1930s and 1940s
- C
Between the 1950s and 1960s
- D
Between the 1880s and 1890s
Correct answer
BBetween the 1930s and 1940s
Explanation
The content places Church's development of the lambda calculus in the 1930s and 1940s.
- A
- 47
What historical point is made about the development of the lambda calculus?
- A
It was created after proof assistants had become common.
- B
It was developed before programming and computer science were formally studied.
- C
It was designed specifically as a practical replacement for machine code.
- D
It was invented after modern programming languages had become widespread.
Correct answer
BIt was developed before programming and computer science were formally studied.
Explanation
The content emphasizes that Church developed the lambda calculus before programming and computer science themselves were formally studied.
- A
- 48
What relationship between Alonzo Church and Alan Turing is noted?
- A
Church was Turing's doctoral adviser.
- B
They jointly invented the simply typed lambda calculus.
- C
Turing was Church's doctoral adviser.
- D
Church was a student of Turing's proof assistant.
Correct answer
AChurch was Turing's doctoral adviser.
Explanation
The content identifies Alonzo Church as Alan Turing's doctoral adviser.
- A
- 49
Beyond its usefulness as a model of programming, what other field has the lambda calculus significantly influenced?
- A
Geology
- B
Mathematical logic
- C
Organic chemistry
- D
Astronomy
Correct answer
BMathematical logic
Explanation
The lambda calculus has also been important in mathematical logic, where logical systems can be defined using the calculus.
- A
- 50
What is a central benefit of treating computation mathematically through the lambda calculus?
- A
It removes the need to define how functions compute.
- B
It enables rigorous reasoning about programs and computation.
- C
It guarantees that every possible expression is meaningful.
- D
It makes every encoded program shorter than its equivalent in other languages.
Correct answer
BIt enables rigorous reasoning about programs and computation.
Explanation
The lambda calculus provides a small formal account of computation, making it possible to study programs and computation mathematically and reason about them rigorously.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.