DSAI Admission Level Check 2025-26 M1
DSAI Admission Level Check 2025-26 M1
M1 intake
The MSc Data Science and Artificial Intelligence (DSAI) is a master's degree of excellence, requiring
a solid grounding in programming, algorithms, statistics and probability.
To self-assess your level in these subjects, please complete the exercises on Python and
Statistics. We recommend that you take the time to do these exercises, and above all that
you do them yourself, without any help or use of Chat GPT.
If you struggle to complete these exercises, it may indicate that following the MSc DSAI program
will be challenging and may lead to difficulties in succeeding. Therefore, please take this
assessment seriously and submit your solutions within this document in a single PDF format.
You fill find the exercices in the following pages.
Comment if any :
Comment if any :
EXERCISES IN PYTHON PROGRAMMING
Comment if any :
Admission MSc DSAI
Michel RIVEILL
December 2024
1 Linear algebra
Exercise I. We consider the following system of linear equations:
2x1 + 3x2 + x3
=8
4x1 + 7x2 + 5x3 = 20
−2x2 + 2x3 = 0.
Exercise III. Let X be a discrete random variable with the following proba-
bility distribution function:
1
Exercise IV. Let three independant real value random variables X1 , X2 et
X3 with E[X1 ] = 2, E[X2 ] = 3, E[X3 ] = 0, V [X1 ] = 1, V [X2 ] = 2, V [X3 ] = 3 :
1. Compute E[2X1 + 3]
2. Compute V [2X1 + 3]
1. Compute E[X̄n ]
2. Compute V [X̄n ]
3. Give the distribution of X̄n
2
3 Python programming
Exercise VII. It is commonly said that one human year is equivalent to 7
dog years. However this simple conversion fails to recognize that dogs reach
adulthood in approximately two years. As a result, some people believe that it
is better to count each of the first two human years as 10.5 dog years, and then
count each additional human year as 4 dog years.
Write a program that implements the conversion from human years to dog
years described in the previous paragraph. Ensure that your program works
correctly for conversions of less than two human years and for conversions of
two or more human years. Your program should display an appropriate error
message if the user enters a negative number.
Exercise VIII. A univariate quadratic function has the form f (x) = ax2 +
bx + c, where a, b and c are constants, and a is non-zero. The roots of a
quadratic function can be found by finding the values of x that satisfy the
quadratic equation ax2 + bx + c = 0. A quadratic function may have 0, 1 or 2
real roots. These roots can be computed using the quadratic formula:
√
−b ± b2 − 4ac
root =
2a
The portion of the expression under the square root sign is called the dis-
criminant. If the discriminant is negative then the quadratic equation does not
have any real roots. If the discriminant is 0, then the equation has one real root.
Otherwise the equation has two real roots, and the expression must be evaluated
twice, once using a plus sign, and once using a minus sign, when computing the
numerator.
Write a program that computes the real roots of a quadratic function. Your
program should begin by prompting the user for the values of a, b and c. Then
it should display a message indicating the number of real roots, along with the
values of the real roots (if any).
Exercise IX. The edit distance between two strings is a measure of their simi-
larity—the smaller the edit distance, the more similar the strings are with regard
to the minimum number of insert, delete and substitute operations needed to
transform one string into the other.
Consider the strings kitten and sitting. The first string can be transformed
into the second string with the following operations: Substitute the k with an
s, substitute the e with an i, and insert a g at the end of the string. This is the
smallest number of operations that can be performed to transform kitten into
sitting. As a result, the edit distance is 3.
Write a recursive function that computes the edit distance between two
strings. Use the following algorithm:
3
If the length of s is 0 then
Return the length of t
Else if the length of t is 0 then
Return the length of s
Else
Set cost to 0
If the last character in s does not equal the last character in t then
Set cost to 1
Set d1 equal to the edit distance between all characters \
except the last one in s, and all characters in t, plus 1
Set d2 equal to the edit distance between all characters in s, \
and all characters except the last one in t, plus 1
Set d3 equal to the edit distance between all characters \
except the last one in s, and all characters \
except the last one in t, plus cost
Return the minimum of d1, d2 and d3
Use your recursive function to write a program that reads two strings from
the user and displays the edit distance between them.