Start by thinking about a slightly more abstract problem. What happens when you combine zero things?
There are a bunch of operations that combine elements of a set. Addition can combine numbers (1+2+3=6). Multiplication can combine numbers (2*3*5=30). Concatenation can combine strings (‘ab’ • ‘c’ = ‘abc’).
Each of these operations also has a special element call the identity that doesn’t change the other thing it’s combined with. For addition it’s zero (0+x=x for all x). For multiplication it’s one. For concatenation it’s the empty string ‘’.
You can think of combining a list as starting with the identity element and the one at a time combining the elements of your list. In that sense combining a list of no elements generates the identity element. This is super intuitive for addition. Adding up the sim of no numbers is zero. Concatenating no strings together is the empty string. Similarly multiplying no numbers together is one.
Latest Answers