I'm taking a discrete math class right now.
How is this read: \lambda x.\, x - 3 and what is a simple example?
In a discrete math perhaps it is the same as "All x, x is an integer such that...."?
How is this read: \lambda x.\, x - 3 and what is a simple example?
In a discrete math perhaps it is the same as "All x, x is an integer such that...."?
I'd read it as "Lambda x maps to x - 3."
In Python, you can rewrite lambdas as regular functions if you want.
lambda x : x - 3
is the same as def f(x):
return x - 3
This runs in the IDLE as such: >>> f = lambda x : x - 3
>>> def g(x):
... return x - 3
...
>>> f(0)
-3
>>> g(0)
-3
>>> (lambda x : x - 3)(0)
-3So '\lambda x., x-3' --> 'f(x): x-3'
Also, I really enjoyed my discrete math courses! The proofs were.. tedious.. but the amount and breadth of 'stuff' covered was excellent.