Introduction to Lists

Comprehension Questions

Math 250 - Math with Mathematica
Christopher Hanusa

2-1. How long of a list is it possible to create in Mathematica?

2-2. What might be some benefits of creating a list manually?

2-3. What happens if the input to Range is a non-integer?  Try it out and explain what you learned.

2-4. For each of the following Range commands, complete the following sub-questions.
(a) BEFORE EVALUATING THE COMMAND, what list do you expect the command to give?  Or do you expect an error?
(b) Now, evaluate the command.  Did it do what you expect it to do?
(c) If not, figure out what went wrong with your reasoning.

Range[Pi]

Range[10,5]

Range[10,30,Pi]

Range[Pi,30,10]

Range[100,0,-8]

2-5. Determine which Range commands give the following lists.

{1,2,3,4,5,6}

{1,3,5,7,9,11}

{1.,1.5,2.,2.5,3.,3.5,4.,4.5}

{-1,-2,-3,-4,-5}

2-6. For each of the following Table commands, complete the following sub-questions.
(a) BEFORE EVALUATING THE COMMAND, what list do you expect the command to give?  Or do you expect an error?
(b) Now, evaluate the command.  Did it do what you expect it to do?
(c) If not, figure out what went wrong with your reasoning.

Table[i,{i,10}]

Table[i,{2,6}]

Table[x^2,{x,Pi,10}]

Table[a,{a,1,10,Pi}]

Table[{x,x^2},{x,3,6}]

Table[Range[i],{i,1,5}]

2-7. Determine which Table commands give the following lists.  There are multiple solutions for each one.

{2 π,2+2 π,4+2 π,6+2 π,8+2 π}

{1,8,27,64,125,216}

{(1/4),(1/5),(1/6),(1/7)}

{(1/10),(1/2),-(1/4)}

{{-3,9},{-2,4},{-1,1},{0,0}}

2-8. Create the following matrix:

2-9. Suppose you wanted a visual representation of the rolls of 200 dice like in Tutorial Section 2.7, but chronologically instead of tallied together.  How would you do this in Mathematica? Should the data points be connected or not?  Why or why not?

2-10. For each of the following commands, complete the following sub-questions.
(a) What list do you expect the command to give?  Or do you expect an error?
(b) Now evaluate the command.  Did it do what you expect it to do?
(c) If not, figure out what went wrong with your reasoning.

Length[{1,2,3,4}]

Length[{{1,2,3}}]

Total[{1,2,3,4}]

Total[{{1,2},{3,4}}]

Total[{{1,2,3}}]