Professional Documents
Culture Documents
Name:
ID:
Marks(Code 333 )
116
17
18
19
20
21
Total
/16
/5
/5
/4
/5
/5
/40
10
11
12
13
14
15
16
SS 2864b Exam
TRUE FALSE
TRUE
TRUE
TRUE FALSE
SS 2864b Exam
3) >
>
>
>
set.seed(123)
u <- runif(1000)
x <- as.numeric(u < 0.1)
hist(u, xlab="x")
0.8
0.0
0.4
(C)
(D)
0.4
0.8
10
0.00
0.04
(A)
0.8
0 600
0.0
0 60
Frequency
0.4
Frequency
0.0
Frequency
(B)
0 600
Frequency
(A)
0.08
(B)
(C)
(D)
SS 2864b Exam
[,1]
-2
24
[,1]
[1,]
22
[2,]
16
1.555556
[,1] [,2]
4
6
-6
18
4 -6
6 18
[,1] [,2]
[1,]
4
3
[2,]
1
2
(B)
[1,]
[2,]
[,1] [,2]
4
1
3
2
[,1] [,2]
[1,]
4
2
[2,]
0
1
(E)
[1,]
[2,]
[,1] [,2]
4
0
2
1
SS 2864b Exam
The remaining questions are not asking for R output. Remember, put your answers on
the answer sheet on page 1.
7) What is the binary representation of 114?
(A) 100111
(B) 1110010
(C) 1.11001
(D) 1.00111
(E) 11020
8) In human vision, the cone cells are mainly responsible for colour vision. How many
kinds of cone cells do people with normal vision have?
(A) 1
(B) 4
(C) 2
(D) 5
(E) 3
SS 2864b Exam
10) The determinant of a matrix measures the amount by which it changes the volume of
sets that it acts upon. That is, if we multiply all the points in a sphere of volume 1
by a matrix, the resulting ellipsoids volume will be equal to the absolute value of the
determinant of the matrix.
Let A be a 3 3 square matrix with condition number 145. Which of the following
could be its determinant?
(A) 0.0069
(B) 145
(C) 12.04
(D) 1
(E) Any of these; there is not enough information to tell which.
12) I wish to draw one random sample X from the density function f (x) = kx2 , 0 < x < 1,
where k is chosen as the appropriate normalizing constant. Which of the following
schemes will work?
(A) Draw U Unif(0, 1) and return X = U 1/3 .
(B) Draw U Unif(0, 1), V Unif(0, 1); if V < U 2 return X = V . Otherwise repeat.
(C) Draw U Unif(0, 1) and return X = U with weight w = (1/3)U 3 .
(D) Draw U Unif(0, 1), V Unif(0, 1); if V < (1/3)U 3 return X = U . Otherwise
repeat.
(E) Draw U Unif(0, 1) and return X = U with weight w = U 2 .
SS 2864b Exam
1 0 0
(A)
0 1 0
0 0 1
(B)
1
1
1
1
1 1
1 1
1
1 1 1
!
(C)
1 1
1 1
(D)
1 0 0
0 1 0
14) I have drawn U Unif(0, 1) and calculated X = ln(1 U ). What is the distribution
of X?
(A) Binomial(1, 1/e)
(B) Unif(0, )
(C) Poisson(1)
(D) N (0, 1)
(E) Exponential(1)
SS 2864b Exam
15) A number is a perfect number if it is equal to the sum of its divisors that are less
than itself. For example, 6 is perfect because 6 = 1 + 2 + 3, and 1, 2, and 3 are the
only divisors of 6 other than 6 itself. Which of the following functions returns TRUE
for a perfect number x > 1 and FALSE for other positive integers? Assume only single
integers are passed as arguments, not vectors.
(A) perfect <- function(x) { y <- 1:(x-1); x == sum(y[x %% y == 0]) }
(B) perfect <- function(x) { y <- 1:(x-1); x == sum(x[x %% y == 0]) }
(C) perfect <- function(x) { y <- 1:(x-1); x == all(x %% y == 0) }
(D) perfect <- function(x) { y <- 1:(x-1); x == sum(x %% y == 0) }
(E) None of the above
16) Given any 5 5 matrix H stored in your R workspace, which of the following will print
and x to solve the equation (H I)x = 0?
(A) eigen(H)$values[1]; eigen(H)$vectors[,1]
(B) list(lambda=1, x=c(0,0,0,0,0))
(C) eigen(H)$lambda; eigen(H)$values
(D) solve(H - lambda*I, 0)
(E) solve(H - I, 0)
SS 2864b Exam
Name:
1 0
17) Let A = 0 2
0 0
0
0
. Find a singular value decomposition of A.
-0.5
Answer:
U
/5
VT
1)
2)
3)
4)
5)
/5
SS 2864b Exam
Name:
10
19) Let
A=
1 3
2 4
10
14
for the vector x. You will get full marks for the right answer regardless of the method
used. You will get part marks if you use the LU decomposition method but make an
arithmetic mistake, or if you leave the question blank. If you use any other method
and dont get the right answer, you get zero.
/4
Answer:
x=
SS 2864b Exam
Name:
11
SS 2864b Exam
Name:
12
SS 2864b Exam
Name:
13