In: Advanced Math
III. Use Table to generate a list of ordered pairs (x,sin x) for x=0, \[Pi]/12, 2\[Pi]/12, 3\[Pi]/12, ..., 2\[Pi]. You should end up with a list of lists. Then do it again but without using Table.
Mathematica assignment, any ideas?
Using Table function is easy to generate the pairs (x,sin x) for
Open a fresh MATHEMATICA notebook and type in the following command.
All the Table function needs is an expression and the range for that expression to be evaluated. As you can see the expression is the ordered pair (x, sin x) and the range is 0 to 2 with steps of .
And as a result a list of lists with each list representing the ordered pair (x, sin x) has been generated.
The same result can be recreated using defined function and Array which is useful in construction of a list.
Enter the following commands in the MATHEMATICA notebook to get the desired results.
First we have defined the order pair as a function in MATHEMATICA.
Then using this newly defined function plugged into the Array function that generates the function values over the interval 0 to 2 at 25 evenly spaced points which amounts to the same step size as
As we can see the result of this is the same as the one by using Table.