Functions as Machines

You can imagine a mathematical function as a machine with an input and an output. You put something into the machine and then receive something at the machine's output. An important property of functions is that the same thing always comes out at the output when we put the same thing in at the input.

1 Your First Connection

Connect the lower cards as in the example above by dragging a cable from the output of the text input card to the input of the text output card. Once you have done this, click on the text input field on the text input card and enter something. Do you see it on the output card? You can also disconnect the cable by grabbing it at the output and releasing the connection from there. Try it!

If you don't have enough space on your screen, you can shrink the cards via the menu or use full screen mode.

2 Encrypting Your First Text

You can manipulate your text with different machines (green cards). To do this, connect the text input card to the vowel dance machine and then to the text output card. What happens to your text?

You can load new cards into your patch by double-clicking. Get an overview of what's available! You can also find an overview in the workbook.

Of course, you can also use several machines in sequence. This is called composition in mathematics. The machines then together form a new machine that changes your text in the connected order. Try it out! Note your result in the workbook.

3 Composing Machines

You can connect two machines in different orders. Does the order matter for the result?

a) Try it out and justify your answer in the workbook.

b) Is this always the case? Can you find two machines where the order doesn't matter? Give the machines you found, note the result text and explain what is different here.

4 From Word Machine to Function

Function machines work in the same way as word machines. Strictly speaking, word machines are also special function machines.

Here too, there is an input in the form of a yellow card for the independent variable. This is processed by one or more green function machines and the result is displayed using various blue feedback cards.

Try different inputs for the independent variable and observe how the output in the value card changes.

5 Composing Function Machines

Just like with word machines, you can also compose function machines in sequence. The machines then together form a new machine that changes your value in the connected order. Try different combinations and note them with the results for the independent variable \(x=2\) in the workbook.

Bonus task: How many different machines can you build from the 3 function machines if you always use all machine cards?

Different Representations of the Output

In Math-Nodes, besides the value for an independent variable, you can also display the equation, the graph, and even the sound (Chapter 4) of a function machine. There is a separate feedback card for each. Feedback cards are always blue.

In the graph card, you see not only the graph of a function, but also a small cross. This is the function value for the set value of the independent variable.

6 Where is the Difference?

Here, two function machines have been composed in reverse order. Think about what the function equation of the composition should be and how the graph should look, then try it out.

Sketch the graphs and describe how they differ and why.

Tip: Edit Function Machines

In many tasks in Math-Nodes, the structure for composition and linking using operations is already given, and you should select the appropriate function and operation machines.

If you right-click or use two fingers on a tablet on a function machine, you'll be suggested a few functions that you can use to solve the task, or you can activate free input.

7 Linking Using Operations and Composing

Choose the functions and operation so that you get the given function term in the equation card. Note your solution and sketch the graph. Describe what influence the individual machines have on the graph of the overall function.

Additionally connect function machines individually with the graph card. This way you can compare the graph of the resulting overall function with the partial functions.

    8 Hitting the Graph

    Choose the functions and operation so that the white graph is created. Note the solution and explain your approach.

    For b: Explain the relationship between the white and green graphs.

      9 Function Puzzle

      Link using operations and/or compose the machines so that the white graphs are created. Give the corresponding function equation in the workbook for each.

      If you have solved it correctly, no card is left over.

        10 Graph Chaos

        Describe the relationship between the individual graphs. Find special values for the independent variable where you can explain the behavior of the graph.

        Look at the solution for the first example in the workbook.

          11 Modulation

          First consider the functions \(f\) and \(g\) in the first window. What influence do parameters \(a\) and \(b\) each have on the graph?

          a) Try it out and describe in the workbook.

          b) The functions \(f\) and \(g\) in the second patch look almost like the first one. However, instead of parameters, functions \(a\) and \(b\) are connected to the parameter inputs here. Describe the course of the graphs of \(f\) and \(g\) and the influence of functions \(a\) and \(b\) on the course.

          Tip: Your knowledge about the influence of parameters can help you.

          Tip

          You can imagine parameters as knobs with which you can change the function. You can ask yourself questions like: "What does it do to the function when this parameter is very large or close to zero?"

          Sometimes it's helpful to imagine parts of a function as if they were replacing one of these knobs. For \(g(x)=sin(b(x)\cdot x)\), you can imagine that someone moves the knob the way the connected function \(b(x)\) runs. Imagine the parameter \(b\) is turned back and forth or turned up faster and faster. If you know what a parameter would influence at the position of function \(g\), you also know what function \(b\) does there.

          12 How Does It Run?

          Functions \(f\) and \(g\) are each modulated with functions \(a\) and \(b\). Formulate hypotheses in the workbook about how the courses of \(f\) and \(g\) differ without displaying the graphs of \(f\) and \(g\). Then check your hypotheses.

          Tip: You may look at the graphs of \(a\) and \(b\).

          13 Modulation Detective

          You always see pairs of functions here, where one modulates the other. The modulated function is always the same. Match the pairs to the graphs. Justify your assignment in the workbook.

          14 What Was Modulated Here?

          In functions \(g\) and \(h\), different parameters have been modulated by the same function. Match the functions to their graphs and justify your assignment.

          Draw the quadratic function \(a\) into the graphs in the workbook.

          How does a function sound?

          Periodic functions are a great model for sounds. Sounds are physical vibrations in the air, which can be described very well with the right functions. Physically, the independent variable is always time t. However, Math-Nodes can also output sounds if you choose x as the independent variable, for example. In the following examples, we will take a look at how you can generate sounds with functions and change their pitch and sound step by step.

          15 The first sound

          To generate a sound in Math-Nodes, you need at least 3 cards: One card for the independent variable, one function machine, and the audio card. The sine function in this example oscillates back and forth \(440\) times per second, so it goes through \(2 \pi\) for \(t = 1\) 440 times. The resulting sound has a frequency of \(440\) Hz. Click on Sound On/Off in the audio machine, start the animation of the independent variable, and see if you can hear anything.

          16 The influence of parameters

          If you have made it this far, you have created your first sound. Great! Here is your first research assignment: Investigate the influence of the parameters \(a,b,c,d\) on what you hear, i.e., your auditory impression. To do this, change the values of the parameters on the corresponding cards.

          17 Linking machines and analyzing with the graph module

          In this task, you will first compare the function \(f(t) = a \cdot \sin(b \cdot 2 \pi \cdot t)\) graphically with the function \(g(f(t)) = (a \cdot \sin(b \cdot 2 \pi \cdot t))^2\) and then audibly. Do you have a suspicion about the influence of the function \(g\) on the sound? If you want to listen to the functions, you need to increase the frequency (parameter \(b\)). Humans can only perceive sounds as tones starting from about \(50\) Hz. It is best to choose a frequency of around \(300\) Hz.

          18 Why does it sound different?

          The sine functions \(f\) and \(g\) are each modulated with the functions \(a\) and \(b\). Formulate hypotheses in the workbook about how the sounds of \(f\) and \(g\) differ. Then check your hypotheses.

          19 How does the function sound?

          Design a patch that corresponds to the function equation in the equation card.

          Before listening to the sound, first make assumptions about the auditory impression and the graph in the workbook.

            20 Word to sound

            Create a patch for each description so that the resulting sound (from \(t=0\)) corresponds to the following descriptions. Write down the function equations in the workbook.

            a) The sound starts quietly and gets louder and louder.

            b) The pitch of the sound fluctuates slightly around the tuning fork A \(440\) Hz.

            c) The sound starts loud, then gets quieter, and after a while gets louder again. In addition, the sound should get steadily higher.

            d) The pitch starts very high, drops very quickly, then rises more and more slowly and remains almost constant.

            e) The sound starts very loud at \(t=0\), is not audible at \(t=1\), and then gets louder more and more slowly.

            21 Sound modeling

            a) Listen to the sound and describe in the workbook what you hear. Pay attention to pitch and volume. What remains the same? What changes?

            b) What could the corresponding graph look like? Sketch your idea in the workbook. Use appropriate axis labeling.

            c) Design a patch in Math-Nodes that sounds exactly like the examined audio file. In the workbook, provide the resulting function equation including the parameters.