5 ms·
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 "A
by jason_slack 8y ago
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...."?
- craftyguy 8y agoThe '\lambda x' is just another way of saying "f(x)" So '\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.
- jason_slack 8y agoIt is a difficult course! We are doing graph theory right now.
- bovik 8y agoIt's just jargon. I really don't know why the title isn't just "Conversations with a six-year-old on functions" and "f(x) = x - 3." You lose nothing, increase your audience 100fold, and it's more intellectually honest. It is a less hackernews clickbaity title, though.
- omegaham 8y ago> "How is this read: \lambda x.\, x - 3" 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) -3