<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.explainxkcd.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hampswitch</id>
		<title>explain xkcd - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://www.explainxkcd.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hampswitch"/>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php/Special:Contributions/Hampswitch"/>
		<updated>2026-05-23T21:29:59Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://www.explainxkcd.com/wiki/index.php?title=2453:_Excel_Lambda&amp;diff=210880</id>
		<title>2453: Excel Lambda</title>
		<link rel="alternate" type="text/html" href="https://www.explainxkcd.com/wiki/index.php?title=2453:_Excel_Lambda&amp;diff=210880"/>
				<updated>2021-04-23T14:16:41Z</updated>
		
		<summary type="html">&lt;p&gt;Hampswitch: Added link to a webpage about turing machines in excel&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{comic&lt;br /&gt;
| number    = 2453&lt;br /&gt;
| date      = April 21, 2021&lt;br /&gt;
| title     = Excel Lambda&lt;br /&gt;
| image     = excel_lambda_new.png&lt;br /&gt;
| titletext = Extremely rude how Turing's later formulations of the halting problem called me out by name specifically.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Explanation==&lt;br /&gt;
{{incomplete|Created by a SPREADSHEET. Has a lambda function just been added to excel at the time this computer came out? Why is Ponytail pleased, what will she use it for, that she could not before? Another reference to a law/hypothesis about computing? Please mention here why this explanation isn't complete. Do NOT delete this tag too soon.}}&lt;br /&gt;
&lt;br /&gt;
[[Cueball]] is computing and [[Ponytail]] criticizes him in a way that is reminiscent of the [[:Category:Code Quality|Code Quality series]], although not as harsh. Cueball has lots of strange [[:Category:Cueball Computer Problems|computer problems]], and this will most likely result in another one.&lt;br /&gt;
&lt;br /&gt;
The comic begins with Ponytail finding out that {{w|Microsoft Excel}} is adding a {{w|Anonymous_function|lambda function}} to their function library. A lambda function is a temporary function created inside another function that completes a repetitive task that is too unimportant to code a named function for. They are commonly found in programming languages such as {{w|Lisp}}, {{w|Python}}, and many others. A lambda function is also called an {{w|Anonymous function}} because in most languages it can be passed to other functions (including another lambda function) without needing to be given any formal name during coding, or given {{w|Closure_(computer_programming)|'closure'}} under whatever name(s) its calling procedures desire.&lt;br /&gt;
&lt;br /&gt;
Finding that Excel is adding a lambda function pleases Ponytail. Cueball claims that the lambda function is unnecessary, as when he needs arbitrary computation he just adds a block of columns to the side of his sheet and has a {{w|Turing machine}} process it. This would technically work as a lambda function but would be rather difficult to construct and maintain.{{Citation needed}}  People have created [https://www.felienne.com/archives/2974 turing machines in excel], although not for practical purposes.&lt;br /&gt;
&lt;br /&gt;
Ponytail finds his solution absurd and is convinced Cueball is &amp;quot;doing computing wrong&amp;quot;. But he claims that all computing is equally wrong, citing the {{w|Church-Turing thesis}}, a hypothesis which says that a function can be computed by executing a series of instructions if and only if that function is computable by a Turing machine. A classical Turing machine uses an infinitely long strip of tape as its memory; for Cueball, the large Excel column acts as the &amp;quot;tape&amp;quot;. All ways of computing are &amp;quot;equally wrong&amp;quot; since, according to this thesis, they can all be translated to or from a Turing machine. &lt;br /&gt;
&lt;br /&gt;
Ponytail and Cueball appear to have different ideas of 'computing'. Ponytail, like most programmers, probably includes efficiency and readability as important characteristics of 'doing computing right'. Cueball appears interested only in {{w|computability}}, a more theoretical point of view than Ponytail's.&lt;br /&gt;
&lt;br /&gt;
Ponytail then says that Turing would change his mind if he saw Cueball's spreadsheet, presumably because of the extreme complexity of Cueball's code in the spreadsheet. Cueball's final statement is that Turing could ask him to stop, but would not be able to prove if he actually will stop. &lt;br /&gt;
&lt;br /&gt;
Cueball's final statement is a reference to the {{w|halting problem}} mentioned in the title text. It is the problem of determining whether a given Turing machine will halt. The problem has been shown to be undecidable, i.e., there exists no algorithm that computes whether an arbitrary Turing machine will halt or not. Because of the way Cueball has behaved, he has been specifically mentioned in Turing's later formulations of the halting problem. Cueball finds this very rude. This is of course a joke, since Turing has been dead since 1954, presumably long before Cueball was born. But it would be crazy indeed if a scientist became so mad at a person that he would mention this person by name in his formulation of a serious problem.&lt;br /&gt;
&lt;br /&gt;
Over-complicated spreadsheets were also mentioned in [[2180|2180:Spreadsheets]].&lt;br /&gt;
&lt;br /&gt;
An example of a lambda function:&lt;br /&gt;
&lt;br /&gt;
   list(map(lambda a: a + 1, [1, 2, 3])) # -&amp;gt; returns [2, 3, 4]&lt;br /&gt;
&lt;br /&gt;
Here, each element of the array with values 1,2,3 is treated in succession as a variable 'a' that is incremented by one, to produce values of 2,3,4 which are then reconstructed as a list for output.&lt;br /&gt;
&lt;br /&gt;
A recursive lambda might be:&lt;br /&gt;
&lt;br /&gt;
   def pointless_recursion(v):&lt;br /&gt;
      # If current value (x) is evenly divisible by 4, return the source (v) * current (x)&lt;br /&gt;
      # Otherwise, print current, and then try the process again with the current value of x + 3&lt;br /&gt;
      r = lambda x: x * v if x % 4 == 0 else print(x) or r(x + 3)&lt;br /&gt;
      return r(v)&lt;br /&gt;
  &lt;br /&gt;
   pointless_recursion(12)   # returns 144 (i.e., 12*12)&lt;br /&gt;
   pointless_recursion(11)   # prints 11, 14, 17 then returns 220 (i.e., 20*11)&lt;br /&gt;
&lt;br /&gt;
In this instance, the function is given the name 'r', and features a (conditional) call back to this self-same 'r' within it. The 'x' is whatever value is the latest passed to 'r', while 'v' is that which was first passed to the container function.&lt;br /&gt;
&lt;br /&gt;
Ideally, such techniques should be used to ''reduce'' {{w|Spaghetti code}}, not increase it. But this isn't a foregone conclusion, especially in Cueball's hands.&lt;br /&gt;
&lt;br /&gt;
==Transcript==&lt;br /&gt;
:[In a narrow panel, Ponytail is walking in from the left, looking down at her phone]&lt;br /&gt;
:Ponytail: Oh cool, Excel is adding a lambda function, so you can recursively define functions.&lt;br /&gt;
&lt;br /&gt;
:[Ponytail, holding her phone to her side stands behind Cueball, who is sitting in an office chair with a hand on a laptop standing on his desk. He has turned around to face her, leaning with the other arm on the back of the chair.]&lt;br /&gt;
:Cueball: Seems unnecessary.&lt;br /&gt;
:Cueball: When I need to do arbitrary computation, I just add a giant block of columns to the side of my sheet and have a Turing machine traverse down it.&lt;br /&gt;
&lt;br /&gt;
:[In a frame-less panel Ponytail is standing in he same position behind Cueball, who has resumed working on his laptop with both hands on the keyboard.]&lt;br /&gt;
:Ponytail: I think you're doing computing wrong.&lt;br /&gt;
:Cueball: The Church-Turing thesis says that all ways of computing are '''''equally''''' wrong.&lt;br /&gt;
&lt;br /&gt;
:[Ponytail is still behind Cueball, who has a finger raised in the air, and the other hand is on the desk. Cueball's head has a visible sketch layer which has not been erased.]&lt;br /&gt;
:Ponytail: I think if Turing saw '''''your''''' spreadsheets, he'd change his mind.&lt;br /&gt;
:Cueball: He can ask me to stop making them, but not prove whether I will!&lt;br /&gt;
&lt;br /&gt;
==Trivia==&lt;br /&gt;
*In the [https://www.explainxkcd.com/wiki/images/3/3b/excel_lambda.png original version] of the comic, in the final panel, there was a gray pencil outline, slightly different to Cueball's head that had not been removed.&lt;br /&gt;
**This was later fixed in a re-upload.&lt;br /&gt;
&lt;br /&gt;
{{comic discussion}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Comics featuring Cueball]]&lt;br /&gt;
[[Category:Comics featuring Ponytail]]&lt;br /&gt;
[[Category:Comics featuring real people]]&lt;br /&gt;
[[Category:Computers]]&lt;br /&gt;
[[Category:Spreadsheets]]&lt;br /&gt;
[[Category:Programming]]&lt;/div&gt;</summary>
		<author><name>Hampswitch</name></author>	</entry>

	</feed>