# Mathematics for Machine Learning: Linear Algebra Quiz Answers

## Get all Weeks Mathematics for Machine Learning: Linear Algebra Quiz Answers

### Mathematics for Machine Learning: Linear Algebra Week 01 Quiz Answers

#### Quiz 1: Exploring parameter space

Q1. In this exercise, we shall see how it is often convenient to use vectors in machine learning. These could be in the form of data itself, model parameters, and so on.

The purpose of this exercise is to set the scene for Linear Algebra and the rest of the maths we will cover in the specialization. If this is confusing right now – stick with us! We’ll build up your skills throughout the rest of the course. For this reason, we’ve set a low pass mark for this quiz, but even if you don’t pass in one go, reading the feedback from a wrong answer can often give more insight than guessing a correct answer!

* * *∗∗∗

The problem we shall focus on in this exercise is the distribution of heights in a population.

If we do a survey of the heights of people in a population, we may get a distribution like this:

This histogram indicates how likely it is for anyone in the survey to be in a particular height range. (6 ft is around 183 cm)

This histogram can also be represented by a vector, i.e. a list of numbers. In this case, we record the frequency of people with heights in little groups at 2.5 cm intervals, i.e. between 150 cm and 152.5 cm, between 152.5 cm and 155 cm, and so on. We can define this as the vector \mathbf{f}f with components,

f=⎡⎣⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢f150.0,152.5f152.5,155.0f155.0,157.5f157.5,160.0f160.0,162.5⋮⎤⎦⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥

These vector components are then the sizes of each bar in the histogram.

Of the following statements, select all that you think are true

• None of the other statements.
• There are at least 10 elements in the frequency vector, \mathbf{f}f.
• No one in the world is less than 160 cm tall.
• If another sample was taken under the same conditions, the frequencies would be exactly the same.
• If another sample was taken under the same conditions, the frequencies should be broadly similar.

Q2. One of the tasks of machine learning is to fit a model to data in order to represent the underlying distribution.

For the heights of a population, a model we may use to predict frequencies is the Normal (or Gaussian) distribution. This is a model for a bell-shaped curve, which looks like this

It has the slightly complicated equation,

g(x) = \frac{1}{\sigma\sqrt{2\pi}}\exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) g(x)=σ2π​1​exp(−2σ2(xμ)2​),

the exact form of which is unimportant, except that it is dependent on two parameters, the mean, \muμ, where the curve is centred, and the standard deviation, \sigmaσ, which is the characteristic width of the bell curve (measured from the mean).

We can put these two parameters in a vector, \mathbf{p} =

[μσ]

p=[μσ​].

Pick the parameter vector \mathbf{p}p which best describes the distribution pictured.

• \mathbf{p} =
• [143167]
• p=[143167​]
• \mathbf{p} =
• [15512]
• p=[155, 12​]
• \mathbf{p} =
• [16724]
• p=[16724​]
• \mathbf{p} =
• [1553]
• p=[1553​]
• \mathbf{p} =
• [16712]
• p=[16712​

Q3. Pick the Normal distribution that corresponds the closest to the parameter vector \mathbf{p} =

[33]

p=[33​].

Q4. A model allows us to predict the data in a distribution. In our example we can start with a parameter vector \mathbf{p}p and convert it to a vector of expected frequencies \mathbf{g}_\mathbf{p}gp​, for example,

gp=⎡⎣⎢⎢⎢⎢⎢⎢⎢⎢g150.0,152.5g152.5,155.0g155.0,157.5g157.5,160.0g160.0,162.5⋮⎤⎦⎥⎥⎥⎥⎥⎥⎥⎥

A model is only considered good if it fits the measured data well. Some specific values for the parameters will be better than others for a model. We need a way fit a model’s parameters to data and quantify how good that fit is.

One way of doing so is to calculate the “residuals”, which is the difference between the measured data and the modelled prediction for each histogram bin.

This is illustrated below. The model is shown in pink, the measured data is shown in orange and where they overlap is shown in green. The height of the pink and orange bars are the residuals.

A better fit would have as much overlap as it can, reducing the residuals as much as possible.

How could the model be improved to give the best fit to the data

• Keep the mean, \muμ, approximately the same.
• Keep the standard deviation, \sigmaσ, approximately the same.
• Increase the mean, \muμ.
• Increase the standard deviation, \sigmaσ.
• Decrease the standard deviation, \sigmaσ.
• Decrease the mean, \muμ.

Q5. The performance of a model can be quantified in a single number. One measure we can use is the Sum of Squared Residuals, \mathrm{SSR}SSR. Here we take all of the residuals (the difference between the measured and predicted data), square them and add them together.

In the language of vectors we can write this as, \mathrm{SSR}(\mathbf{p}) = |\mathbf{f}-\mathbf{g}_\mathbf{p}|^2SSR(p)=∣fgp​∣2, which will be explained further on in this course.

Use the following code block to play with parameters of a model, and try to get the best fit to the data.

1

2

3

4

5

# Play with values of μ and σ to find the best fit.

μ = 160 ; σ = 6

p = [μ, σ]

histogram(p)RunReset

Find a set of parameters with a fit \mathrm{SSR} \le 0.00051SSR≤0.00051

Input your fitted parameters into the code block below.

• 1
• 2
• 3
• # Replace μ and σ with values that minimize the SSR.
• p = [μ, σ]

Q6. Since each parameter vector \mathbf{p}p represents a different bell curve, each with its own value for the sum of squared residuals, \mathrm{SSR}SSR, we can draw the surface of \mathrm{SSR}SSR values over the space spanned by \mathbf{p}p, such as \muμ and \sigmaσ in this example.

Here is an illustration of this surface for our data.

Every point on this surface represents the SSR of a choice of parameters, with some bell curves performing better at representing the data than others.

We can take a ‘top-down’ view of the surface, and view it as a contour map, where each of the contours (in green here) represents a constant value for the \mathrm{SSR}SSR.

The goal in machine learning is to find the parameter set where the model fits the data as well as it possibly can. This translates into finding the lowest point, the global minimum, in this space.

Select all true statements below.

• None of the other statements.
• You get the same model by following along a contour line.
• At the minimum of the surface, the model exactly matches the measured data.
• Each point on the surface represents a set of parameters \mathbf{p}=[μσ]
• p=[μσ​].

Moving at right angles to contour lines in the parameter space will have the greatest effect on the fit than moving in other directions.

Q7. Often we can’t see the whole parameter space, so instead of just picking the lowest point, we have to make educated guesses where better points will be.

We can define another vector, \Delta\mathbf{p}Δp, in the same space as \mathbf{p}p that tells us what change can be made to \mathbf{p}p to get a better fit.

For example, a model with parameters \mathbf{p}’ = \mathbf{p} + \Delta\mathbf{p}p′=pp will produce a better fit to data if we can find a suitable \Delta\mathbf{p}Δp.

The second course in this specialization will detail how to calculate these changes in parameters, \Delta\mathbf{p}Δp.

Given the following contour map,

What \Delta\mathbf{p}Δp will give the best improvement in the model?

• \Delta\mathbf{p} =
• [−2−2]
• Δp=[−2−2​]
• \Delta\mathbf{p} =
• [22]
• Δp=[22​]
• \Delta\mathbf{p} =
• [−22]
• Δp=[−22​]
• \Delta\mathbf{p} =
• [2−2]
• Δp=[2−2​]

#### Quiz 2: Solving some simultaneous equations

Q1. In this quiz, you’ll be reminded of how to solve linear simultaneous equations as a way to practice some basic linear algebra. Some of the ideas presented here will be relevant later in the course.

Solving simultaneous equations is the process of finding the values of the variables (here xx and yy) that satisfy the system of equations. Let’s start with the simplest type of simultaneous equation, where we already know all but one of the variables:

3x – y = 23x−y=2

x = 4x=4

Substitute the value of xx into the first equation to find yy, then select the correct values of xx and yy below.

• x = 4, y = 2x=4,y=2
• x = 4x=4, y = 10y=10
• x = 4, y = 14x=4,y=14
• x = 4, y =-10x=4,y=−10

Q2. The first goal when solving simple simultaneous equations should be to isolate one of the variables. For example, try taking the second equation away from the first to solve the following pair of equations:

3x – 2y = 73x−2y=7

2x – 2y = 22x−2y=2

What value did you find for xx? Now substitute xx into one of the equations to find yy, and select the correct pair below:

• x = 3, y = 1x=3,y=1
• x = 7, y = 7x=7,y=7
• x = 5, y = 4x=5,y=4
• x = 1, y = -4x=1,y=−4

Q3. This method is called elimination, and you can use it even when the coefficients, the numbers in front of xx and yy, aren’t the same.

For example, to solve the following equations try multiplying both sides of the first equation by 22, then solve using the same method as the last question.

3x – 2y = 43x−2y=4

6x + 3y = 156x+3y=15

Select the correct values of xx and yy below:

• x = 4, y = -2x=4,y=−2
• x = 3, y = 1x=3,y=1
• x = 1, y = 2x=1,y=2
• x = 2, y = 1x=2,y=1

Q4. A very similar technique can be used to find the inverse of a matrix, which you will learn about in week three of this course.

There is also the substitution method, where we rearrange one of the equations to the form x = ay+bx=ay+b or y = cx+dy=cx+d and then substitute xx or yy into the other equation. Use any method you’d like to solve the following simultaneous equations:

-2x + 2y = 20−2x+2y=20

5x + 3y = 65x+3y=6

Select the correct values of xx and yy below:

• x = 5, y = 15x=5,y=15
• x = -5, y = 5x=−5,y=5
• x = -3, y = 7x=−3,y=7
• x = 3, y = 13x=3,y=13

Q5. Systems of simultaneous equations can have more than two unknown variables. Below there is a system with three; xx, yy and zz. First try to find one of the variables by elimination or substitution, which will lead to two equations and two unknown variables. Continue the process to find all of the variables.

Which values of xx, yy and zz solve the following equations?

3x – 2y + z = 73x−2y+z=7

x + y + z = 2x+y+z=2

3x – 2y – z = 33x−2y−z=3

Before you move on you might like to think about how many equations
you would need to uniquely determine four, five, or more variables. Are there are
any other rules for how the equations have to be related? In week two of this course you will learn
about linear independence, which is very closely related to this.

• x = 1, y = -1, z = -2x=1,y=−1,z=−2
• x = -1, y = -3, z = 4x=−1,y=−3,z=4
• x = 2, y = -2, z = 2x=2,y=−2,z=2
• x = 1, y = -1, z = 2x=1,y=−1,z=2

#### Quiz 3: Doing some vector operations

Q1. The aim of this quiz is to familiarise yourself with vectors and some basic vector operations.

For the following questions, the vectors \mathbf{a}a, \mathbf{b}b, \mathbf{c}c, \mathbf{d}d and \mathbf{e}e refer to those in this diagram:

The sides of each square on the grid are of length 11. What is the numerical representation of the vector \mathbf{a}a?

• [12​]
• [21​]
• [22​]
• [11​]

Q2. Which vector in the diagram corresponds to

[−12]

[−12​]?

• Vector \mathbf{a}a
• Vector \mathbf{b}b
• Vector \mathbf{c}c
• Vector \mathbf{d}d

Q3. What vector is 2\mathbf{c}2c?

• \mathbf{e}e
• [−22​]
• \mathbf{a}a
• [22​]

Q4. What vector is -\mathbf{b}−b?

• [−12​]
• \mathbf{e}e
• \mathbf{d}d
• [−21​]

Q5. In the previous videos you saw that vectors can be added by placing them start-to-end. For example, the following diagram represents the sum of two new vectors, \mathbf{u} + \mathbf{v}u+v:

The sides of each square on the grid are still of length 11. Which of the following equations does the diagram represent?

[12]

+

[01]

=

[22]

[12​]+[01​]=[22​]

[11]

+

[10]

=

[21]

[11​]+[10​]=[21​]

[12]

+

[10]

=

[22]

[12​]+[10​]=[22​]

[21]

+

[01]

=

[22]

[21​]+[01​]=[22​]

Q6. Let’s return to our vectors defined by the diagram below:

What is the vector \mathbf{b}+\mathbf{e}b+e?

• [−1−1​]
• [2−1​]
• [13]
• [−12​]

Q7. What is the vector \mathbf{d} – \mathbf{b}db?

• [−24]
• [4−2]
• [−4,2]
• [2−4]
##### Mathematics for Machine Learning: Linear Algebra Course Review

In our experience, we suggest you enroll in Mathematics for Machine Learning: Linear Algebra courses and gain some new skills from Professionals completely free and we assure you will be worth it.

Mathematics for Machine Learning: Linear Algebra Course for free, if you are stuck anywhere between a quiz or a graded assessment quiz, just visit Networking Funda to get Mathematics for Machine Learning: Linear Algebra Quiz Answers.

##### Get All Course Quiz Answers for the Business English Specialization

Business English: Finance and Economics Quiz Answers

Business English: Marketing and Sales Quiz Answers

##### Team Networking Funda

Welcome to the official Author Page of Team Networking Funda! Here, we are dedicated to unraveling the intricate world of networking, connectivity, and team dynamics. Our mission is to provide you with insightful, actionable advice and solutions that will help you build strong connections, foster collaboration, and achieve success in all aspects of your professional life.

🌐 Networking Insights: Dive into the art of networking with us, as we explore strategies, tips, and real-world examples that can elevate your networking game. Whether you're a seasoned pro or just starting, we have valuable insights to offer.

🤝 Team Synergy: Discover the secrets to creating high-performing teams. We delve into team dynamics, leadership, and communication to help you unlock the full potential of your team and achieve outstanding results.

🚀 Professional Growth: Explore the tools and techniques that can accelerate your professional growth. From career development to personal branding, we're here to guide you toward achieving your goals.

🌟 Success Stories: Be inspired by success stories, case studies, and interviews with experts who have mastered the art of networking and teamwork. Learn from their experiences and apply their insights to your journey.

💬 Engage and Connect: Join the conversation, leave comments, and share your own networking and team-building experiences. Together, we can create a vibrant community of like-minded professionals dedicated to growth and success.

Stay tuned for a wealth of resources that will empower you to excel in your professional life. We're here to provide you with the knowledge and tools you need to thrive in today's interconnected world.

We are Team Networking Funda, a group of passionate authors and networking enthusiasts committed to sharing our expertise and experiences in the world of networking and team building. With backgrounds in [Your Background or Expertise], we bring a diverse range of perspectives and insights to help you navigate the challenges and opportunities of professional networking and teamwork.

error: Content is protected !!