CPI 200
Quiz 3 / graded /pencil and paper only

1. Write Mathematica code for generating the array the first 100 elements of 1,-1,1,-1,.. .

tt=Table[(-1)^i,{i,1,100}]

2. What is the binary form of the number 10?

BaseForm[10,2]

3. As x tends to +∞, what does ((sin(x))/(1+x)) tend to?

Limit[Sin[x]/(1+x),x-> Infinity]

4. Let a matrix be defined by 

     1  2  3  4  5
a= 2  3  4  5  6
     3  4  5  6  7
	
Give the Mathematica code to print the 3rd element in the second row, i.e., (Subscript[a, 2,3]). What is the value of this element?

a[[2,3]] = 4

5. Let two data values be given by (-1,3) and (2,0). Letting these correspond to t=0 and t=1, what is the value for t=1/3?

(1-1/3)*{-1,3} + 1/3*{2,0}