Sale!

COMPSCI 589 Machine Learning Assignment: 1 Prerequisites

$40.00 $24.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (2 votes)

Section 1: Matrix Computations
Question 1 (28 points) Take the following objects:
• c ∈ R
• x ∈ R
N
• y ∈ R
M
• A ∈ R
O×P
• B ∈ R
Q×R
5/16/2021 1 Prerequisites
https://www.notion.so/justindomke/1-Prerequisites-668ddcb497074a59b81d330416cd5933 2/5
• C ∈ R
S×T
Take the following quantities:
1. cx
2. cA
3. Ax
4. x Ay ⊤
5. xy⊤
6. AB
7. ABC
For each of these, please provide:
1. What conditions must hold on N, M, ⋯, T in order for the quantity to make sense.
You can always assume these are finite integers no less than one, and do not need
to state this.
• If the quantity cannot makes sense, explain why and skip the remaining parts of
the question.
2. In what space the quantity lies.
3. A short Python function that computes the quantity, assuming that is a float ,
are 1-D numpy arrays, and are 2-D numpy arrays. You should use no
Numpy functions other than (a) to create an array for your answer (like
array=numpy.zeros(…) ) and (b) indexing (like x[i] or A[i,j] ). You may
optionally use array.shape to inspect the sizes of input arrays, but this is not
required.
c
x, y A, B, C
4. The time complexity of your function.
To get you started, if you were given the quantity
x y,

a set of correct answers would be
1) N = M
2) ℝ
5/16/2021 1 Prerequisites
https://www.notion.so/justindomke/1-Prerequisites-668ddcb497074a59b81d330416cd5933 3/5
3)
def x_dot_y(x,y): a = 0.0 N = x.shape[0] for i in range(N): a += x[i]*y[i]
return a
4) 𝒪(N)
FAQ
Section 2: Linear Algebra
Question 1 (18 points) Consider the matrix
[ .
2
−1
0
1
]
What are the eigenvectors and corresponding eigenvalues of this matrix? Make sure the
eigenvectors are linearly independent. Please also give a short argument in at most five
sentences.
Give two vectors of length 2, each with a corresponding scalar. For example, you might
(incorrectly) say
[3, 2] is an eigenvector with eigenvalue 21 because of blahblahblah.[
− 21, 1] is an eigenvector with eigenvalue π because of blahblahblah.
Question 2 (10 points) Consider the matrix
.

⎡ 1
2
−2
.5
2
−1
−1
−1
2 ⎦

What is this matrix’s rank? Give an integer, and explain why in at most two sentences.
FAQ
5/16/2021 1 Prerequisites
https://www.notion.so/justindomke/1-Prerequisites-668ddcb497074a59b81d330416cd5933 4/5
Section 3: Probability
Suppose that you roll two fair, independent six-sided dice. Let the results be the
random variables X and Y. Then, let
A = X + Y
be the sum of X and Y. Also let B = 1 if A is an even number and B = 0 otherwise.
Question 1 (3 points). What is 𝔼[B].
Question 2 (3 points). What is 𝔼[B|X = 2]?
Question 3 (3 points). What is 𝔼[B|X = 1, Y = 3]?
Question 4 (5 points). Is X independent of Y? Explain why in at most 2 sentences.
Question 5 (5 points). Is X independent of A? Explain why in at most 2 sentences.
Question 6 (5 points). Is X independent of B? Explain why in at most 2 sentences.
Section 4: Optimization
Suppose that . Give a solutions for each of the following, and a
short proof that your answer is correct. You may assume that N is odd.
a1, a2,⋯ , aN ∈ R
Question 1 (5 points) argmin (x − and . x a1)
2 minx(x − a1)
2
Question 2 (5 points) and
.
argminx
(x − a1)
2 + (x − a2)
2 minx(x − a1)
2 + (x −
a2)
2
Question 3 (5 points) argmin (x − and . x ∑n=1
N
an)
2 minx ∑n=1
(x −
N
an)
2
Question 4 (5 points) argmin ∣x − and . x a1∣ minx ∣x − a1∣
Question 5 (5 points) argmin ∣x − and x a1∣ + ∣x − a2∣ minx ∣x − a1∣ + ∣x − a2∣
Question 6 (5 points) argminx ∑n=1
∣x −
N
an∣
In some cases, the argmin might not be unique. If so, you can just give any minima.
FAQ
5/16/2021 1 Prerequisites
https://www.notion.so/justindomke/1-Prerequisites-668ddcb497074a59b81d330416cd5933 5/5