if we're going to study functions (i mean, we ARE doing function analysis), we should probably get into what a function actually... *is* first. language is really important for an aengineer- we need to be able to properly identify the qualities and limitations of an object, and those come from its name. just like faeries, true names are valuable currency, and we want to be careful we're not accidentally summoning the wrong guy! so who are functions?
functions (for us, some people will be less meticulous with wording) are a specific kind of *map*. woah, slow your roll. names are important and we just threw this out there? kind of a dick move (sorry). but before we talk about functions, we want to get to know their common ancestor, the map.
to get to know maps, we're going to build one right now! alright, so the key thing about a map is that it takes an input and it gives us an output, shrimple as that. one example of a map could be "input: 3, output: 5" or "input: press button, output: play chime, turn green" or even "input: anything, output: our input's name". if you're familiar with computer science, this might look a bit like how we write functions in code! it's important to know that maps don't just have to work with math stuff, we could throw anything into our input and think about what might happen!
the first step in building our map is choosing the input and output. how many things do we want to input? i'm going to keep it easy, and we'll just say one. ok, then how many things do we want to output? again, keeping it simple, we'll just output one thing. so our map right now looks like: input: something, output: something. before we go any further, we should probably standardize how we write this map. we'll write maps like this! M: (something) -> (something). we name our map M, and we put a : to show that what the map is. the thing in the first parenthesis is our input, and the thing in the second is our output; the little arrow is kind of a cute way to show that we're going from input to output, and it's easy to write. if we were to have multiple inputs or outputs, our map might look like this: A: (cat, dog) -> (catdog) or L: (friends) -> (shuxue, gongcheng, wuli). we use a comma to separate our different inputs and outputs!
now let's clear something up. right now, our map is kind of mysterious... we don't have a ton of information about the actual process of how we're getting in between input and output! if i gave someone the L map, and they wanted to input "alphabet," how would they know what that output would be? we've been using non-math inputs for now, but let's circle back around to the actual math. in order to describe our output, we'll be using our old friend, expressions! it's pretty clear when you see it, so let's look at an example: M: (x) -> (x^2 + 3). This is a map that takes an input, x, and gives us back an output of that input squared and translated by 3. If we put in any input, we know what the output will be: M(3) = (3^2 + 3), M(sin(pi)) = (pi^2 + 3), M(damie) -> (damie^2 + 3). (not a fan of that last one, getting squared is like getting stuck in a washing machine ^_^;7) You'll notice that I *used* our maps just now. In order to use the map, we write the name of the map, M, and then put our input in parathesis right next to it: M(input). This will equal the output of the map!