You are on page 1of 6

UpGrad & IIIT Bangalore Post Graduate Diploma

in Machine Learning & AI ​Sample Entrance Test ​(For


illustrative purpose only)

Maximum Time: 40
Mins

Section 1 Mathematics

Q1. A bag contains 12 red balls and 10 blue balls. A ball is drawn at random. The
probability that ball drawn is red is
A.12
B. 6/11
C. 5/11
D. 1

Q2. In a lottery, there are 10 prizes and 25 blanks. A lottery is drawn at random. What is
the probability of getting a prize?
A. 2/5
B. 2/7
C. 5/7
D. 1/10

Q3. How many different outcomes are possible if a coin is tossed 5


times? (examples: HTTHT, THTHT, and TTHTT are three different
outcomes.)
A. 10
B. 32
C. 20
D. 25

Q4. Consider the matrix below:


Which of the following matrices is equal to the matrix AB?
A.

B.


C.


D.

Q5. What is the minimum value of f(x,y) = x^2 + y^2 + 6x + 12 ?

A. 3
B. -3
C. 9
D. -9

Q6. If the arithmetic mean of 20 values is 10, then sum of these 20 values
is:

A. 100
B. 200
C. 220
D. 400

Q7. Which of the following is equivalent to


5​3​=125?

A. Log​3​(125) = 5 B.
Log​5​(125) = 3 C.
Log​125​(5) = 3 D.
None of the above

Q8. ax + by + c = 0 represents a line parallel to x–axis


if

A. a = 0, b = 0
B. a = 0, b!= 0
C. a!= 0, b = 0
D. c = 0

Q9. If t = 50, u = 25 and v = 16 then (2t + 3u)(2u - v) + 2(t -u)


is

A. 6000
B. 7000
C. 8000
D. 10000

Q10. The mean of a data set is equal to 10 and its standard deviation is equal to 1. If we add
5 to each data value, then the mean and standard deviation become
A. mean = 15, standard deviation =
6 B. mean = 10, standard deviation
= 6 C. mean = 15, standard
deviation = 1 D. mean = 10,
standard deviation = 1
Section 2:
Programming

Q1​. A palindrome is a word, phrase, or sequence that reads the same backwards as
forwards, e.g. ​madam.

Write a program that takes a string as input and tells whether the string is palindrome or
not.

Examples
Input
madam

Output
palindrome

Input
proble
m

Output ​not
palindrome

The output should be in lowercase, and EXACTLY as shown


above. If the string is palindrome, print ​palindrome ​If the string is
not palindrome, print ​not palindrome

Q2​. Fibonacci series is a series of numbers in which each number ( ​Fibonacci number ​) is the
sum of the two preceding numbers. The simplest is the series 0, 1, 1, 2, 3, 5, 8, 13 ... and so
on.

Write a program that takes a number n as input and prints the n​th ​number in the fibonacci
series.

Examples Input ​3 ​Output 1


​ ​Explanation Fibonacci
​ series starts with 0. The next number, by
definition of fibonacci numbers, is 1. The third number, the sum of previous two numbers, 0
and 1, is 2. The fourth number, the sum of previous two numbers is 3. Similarly, the fifth
number in sequence is 5 and the sixth number in the sequence is 8 (5 + 3).

Input ​8 ​Output 13
​ ​Note: Print the output exactly as shown. Do NOT print

any extra characters.

Q3. ​A binary number is a number expressed in the binary numeral system or base-2
numeral system which represents numeric values using two different symbols: typically 0
(zero) and 1 (one).

Computers understand the binary system of numbers, while humans tend to be more adept
at the decimal system of numbers, where the constituent numbers are from 0 to 9.

Write a program that takes a number of decimal format (a number of base 10) as input,
and converts it into its binary equivalent.

To convert a number from decimal to binary, we write down the decimal number and divide it
by 2. The remainder is noted, and the quotient is again divided by 2, until the original number
has been divided to zero.

For example: ​We have a number 4. We divide it by 2, giving us a remainder 0, and quotient 2.
Again, we divide the quotient by 2, giving remainder 0 and quotient 1. To get the binary
number, we start with the last quotient received, which is 1, and then append the remainders in
reverse order. So, the binary number for 4 is 100 (1 - quotient, 0 - second remainder, 0 - first
remainder)

Examples
Input ​4

Output
100

Input
7

Outpu

t 111

You might also like