PROBABILITY AND STATISTICS IN DATA SCIENCE USING PYTHON EXAM SOLVED #3, Exams of Computer Science

PROBABILITY AND STATISTICS IN DATA SCIENCE USING PYTHON EXAM SOLVED #3

Typology: Exams

2025/2026

Available from 02/09/2026

YourExamPlug
YourExamPlug šŸ‡æšŸ‡¦

1.4K documents

1 / 34

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PROBABILITY AND STATISTICS IN DATA SCIENCE USING
PYTHON EXAM SOLVED #2
1.1 (T or F) Probability and Statistics provide mathematical tools for estimating the
likelihood of random events - correct answer True
1.1 Which of the following are best solved using probability and statistics?
A) Predicting the number of rainy days in April
B) Approximating the closing price of IBM stock tomorrow.
C) Estimating your potential winnings in a game of Blackjack.
D) Guessing the winner of the next World Cup. - correct answer A, B, C, D
1.1 What are probability and statistics useful for?
A) Quantifying Uncertainty
B) Finding exact solutions to mathematical equations.
C) Making Predictions about the future. - correct answer A & C
There is no uncertainty in B.
1.2 When the number of coin flips increases, the distribution of the sum of Heads (1)
and Tails (-1) becomes:
A) More concentrated around zero
B) Skewed to positive values
C) Skewed to negative values
D) More spread out across all possibilities - correct answer A. The randomness will
even out, and what we get is the average of -1 and 1 which is 0.
1.3 If we flip a coin a thousand times and get 507 heads, can we conclude with
certainity that the coin is unbiased? - correct answer No
1.3 In rolling a fair 6-sided die 1200 times, roughly how many times would you expect to
see a 2? - correct answer 200.
Because 1200 x 1/6 = 200.
1/6 is the probability to get a 2.
1.3 A coin is tossed 1000 times and turns up heads 700 times. Is the coin biased? -
correct answer Yes.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22

Partial preview of the text

Download PROBABILITY AND STATISTICS IN DATA SCIENCE USING PYTHON EXAM SOLVED #3 and more Exams Computer Science in PDF only on Docsity!

PROBABILITY AND STATISTICS IN DATA SCIENCE USING

PYTHON EXAM SOLVED

1.1 (T or F) Probability and Statistics provide mathematical tools for estimating the likelihood of random events - correct answer True 1.1 Which of the following are best solved using probability and statistics? A) Predicting the number of rainy days in April B) Approximating the closing price of IBM stock tomorrow. C) Estimating your potential winnings in a game of Blackjack. D) Guessing the winner of the next World Cup. - correct answer A, B, C, D 1.1 What are probability and statistics useful for? A) Quantifying Uncertainty B) Finding exact solutions to mathematical equations. C) Making Predictions about the future. - correct answer A & C There is no uncertainty in B. 1.2 When the number of coin flips increases, the distribution of the sum of Heads (1) and Tails (-1) becomes: A) More concentrated around zero B) Skewed to positive values C) Skewed to negative values D) More spread out across all possibilities - correct answer A. The randomness will even out, and what we get is the average of -1 and 1 which is 0. 1.3 If we flip a coin a thousand times and get 507 heads, can we conclude with certainity that the coin is unbiased? - correct answer No 1.3 In rolling a fair 6-sided die 1200 times, roughly how many times would you expect to see a 2? - correct answer 200. Because 1200 x 1/6 = 200. 1/6 is the probability to get a 2. 1.3 A coin is tossed 1000 times and turns up heads 700 times. Is the coin biased? - correct answer Yes.

The probability that an ubiased coin would generate 700 heads is small. Hence we can be confident that it is biased. 1.3 Which of the following describes the differences between probability and statistics? A) Probability predicts what will happen. Statistics, in part, uses what has already happened. B) Probability requires existing data. Statistics requires underlying models. C) they're the same thing. - correct answer A 1.4 What is the probability of drawing a Queen from a deck of 52 cards? - correct answer 4/ 1.4 (True or False) If we repeat an experiment many times, the long-term frequencies of the outcomes converge to the probabiilities. - correct answer True 2.1 (T or F). The empty set is unique - correct answer True 2.1 (T or F) The universal set (Omega) is unique - correct answer False 2.1 Which of the following hold? A) 0 exists {0, 1} B) a exists {A, B} C) {a, b} exists {{a, b}, c} - correct answer A and C 2.1 Recall that /zero/ is the empty set. How many elements do the following sets have?

  1. /zero/
  2. {/zero/}
  3. {/zero/, /zero/}
  4. {{/zero/}, /zero/} - correct answer 1. 0
  5. 1
  6. 1
  7. 2 2.1 How many elements do the following sets have?
  8. {a, b}
  9. {{a, b}} 3.{{a, b}, {b, a}, {a, b, a}}
  10. {a, b, {a, b}} - correct answer 1. 2
  11. 1
  12. 1
  13. 3

2.2 Which of the following are true?

  1. E exists in {1, 2, ..., 10}
  2. Pi exists in (3, 3.5)
  3. 2 exists in [-2, 2) - correct answer 2. 2.3 Visualizing Sets A venn diagram for 2 sets has 4 regions, for three sets has 8 regions. How many regions are there in a Venn diagram of 4 sets? - correct answer 16. 2.4 If S is a proper, or strict, subset of T, then:
  4. S cannot be empty
  5. T cannot be empty
  6. S and T must intersect - correct answer 2. 2.4 Given the expression 'm exists in A', what can be said?
  7. M belongs to A
  8. A is a member of m
  9. M is an element of the set A
  10. M is a set of elements
  11. A contains m - correct answer 1. 3. 5 2.4 Which of the following is not true
  12. {red, green, blue} = {blue, red, green}
  13. {1, 2, 3} contains 1
  14. 2 exists in {all odd integers} - correct answer 3. 2.4 Which of the following holds
  15. {3, 4} is not a proper superset of {3, 4}
  16. {3, 4} != {3, 4}
  17. {4, 3} is a proper subset of {3, 4}
  18. {3, 4} is a proper subset of {4, 3} - correct answer 1. 2.4 Which of the following are subsets of A = [2, 4)
  19. C = {2, 3, 4}
  20. D = (2, 4)
  21. E = /emptyset/ - correct answer 2 and 3

2.4 Let P(S) be the collection of all subsets of S, and Q(S) be the collection of all proper subsets of S. Which of the following hold for every set of S

  1. P(S) is a subset of Q(S)
  2. P(S) is a superset of Q(S)
  3. P(S) is a proper subset of Q(S)
  4. P(S) = Q(S) - correct answer 2 and 3. The collection of Q(S) is P(S) minus S itself. Hence superset, and proper subset hold, while the rest do not. 2.4 Which of the following set pairs intersect?
  5. {1, 2, 3} and {2, 4, 6}
  6. {prime numbers} and {even numbers}
  7. /emptyset/ and /emptyset/
  8. {/emptyset/, 1, 2} and {/emptyset/} - correct answer 1 and 2 2.5 If A - B = A for sets A and B, then:
  9. B must be an empty set
  10. B must be a subset of A
  11. A and B must intersect
  12. A and B must be disjoint - correct answer 4. 2.5 if Omega = {x, y, z}, then {x, y}^c is:
  13. Emptyset
  14. Z
  15. {z}
  16. {x, y} - correct answer 3. 2.5 Which of the following equals G for all Omega and G?
  17. G - emptyset
  18. Omega - G
  19. Omega - G^c
  20. G intersect emptyset - correct answer 1. True
  21. False. Omega - G = G^c
  22. True
  23. False Omega intersect emptyset = emptyset 2.5 Which of the following imply A = B
  1. Holds as (x, y) is in the left set iff x exists in A, y exists in B, and y exists in C, iff (x, y) is in the right set. 3.1 The Python definition A = set(range(1, 10)) implies that A has size:
  2. 2
  3. 9
  4. 10
  5. 11 - correct answer A has 9 elements as the elements are 1 to 9 3.1 A square of an integer, for example, 0, 1, 4, 9 is called a perfect square. How many perfect squares are <= 100? - correct answer 11 3.1 Which of the following sets are finite?
  6. Weeks in a year
  7. Students at UCSD
  8. Odd primes
  9. Positive integer divisors of 30? - correct answer 1, 2, and 4 3.1 Which of the following sets are finite?
  10. {X exists in Z | x^2 <= 10}
  11. {X exists in Z | x^3 <= 10}
  12. {X exists in N | x^3 <= 10}
  13. {X exists in R | x^2 <= 10}
  14. {X exists in R | x^3 = 10} - correct answer 1, 3, 5. Explanation.
  15. {-3, -2, ..., 3}
  16. {x exists in Z| x <= 2}
  17. {0, 1, 2}
  18. False, not writing this shit out.
  19. True {10.333333} 3.2 We saw that the size of a union of two disjoint sets is the sum of their sizes. If two sets are not necessarily disjoint, then the size of their union is:
  20. At least the sum of the set sizes
  21. At most the sum of the set sizes
  22. Could be smaller, same, or larger than the sum of the set sizes. - correct answer 2. 3.2 Which of the following are finite for every finite set A and infinite set B?
  1. A intersect B
  2. A union B
  3. A - B
  4. B - A
  5. A symmetric difference B - correct answer 1 and 3 3.2 Which of the following pairs A and B satisfy |A union B| = |A| + |B|?
  6. {1, 2} and {0, 5}
  7. {1, 2} and {2, 3}
  8. {English words starting with the letter 'a'} and {English words ending with the letter 'a'}
  • correct answer 1. 3.2 |A union B union C| = |A| + |B| + |C| whenever:
  1. A and B are disjoint and B and C are disjoint: True or False
  2. A and B are disjoint, B and C are disjoint, and A and C are disjoint True or False - correct answer 1. False
  3. True 3.2 Recall that a square of an integer, for example, 1, 4 and 9 is called a perfect square. How many integers between 1 and 100 inclusive, are not perfect squares? - correct answer 90 3.3 When does |A union B| = |A| + |B|?
  4. When at least one of A and B is empty?
  5. When A and B are disjoint
  6. Both of the above. - correct answer Both of above. 3.3 In a high school graduation exam, 80% examinees passed english, 85% passed math, and 75% passed both. If 40 examinees failed both subjects, what is the total number of examinees? - correct answer 400 How many integers in [1, 100] do not contain the digit 6? - correct answer 81 Out of 100 foreign journalists who speak Chinese, English, or French at a preference: 60 speak Chinese. 65 speak english 60 speak french 35 speak both C and E 25 speak both Chinese and French

3.4 (Cartesian Products) Taking the geometric view of Cartesian products, if A and B are real intervals of positive length in R, then A x B is a:

  1. Line,
  2. Rectangle
  3. Circle 4 triangle - correct answer 2. 3.4 (Cartesian Products) How many positive divisors does 2016 have? - correct answer 36 3.5 (Cartesian Powers) The set {000, 001, ..., 111} of all 3 bit strings has the following number of subsets:
  4. 2^
  5. 2^
  6. 2^
  7. 2^9 - correct answer 3. 3.5 (Cartesian Powers) Find the number of 7-character (capital letter or digit) license plates possible if:
  8. There are no further restrictions
  9. The first 3 characters are letter and the last 4 are numbers
  10. Letters and numbers alternate E.G. A3B5A7Q - correct answer 1. 78364164096
  11. 175760000
  12. 632736000 3.5 (Cartesian Powers) If P and Q are sets, then |P| ^ |Q| is the number of functions from:
  13. From P to Q
  14. From Q to P - correct answer 2 3.5 (Cartesian Powers) Recall that the power set P(S) of a set is the collection of all subsets of S. For A = {1, 2, 3} and B = {x, y} calculate the following cardinalities.
  15. |P(A)|
  16. |P(B)| 3.|A x B^2|
  17. |P(A x B)|
  18. |P(A) x B|
  1. |P(P(A))| - correct answer 1. 8
  2. 4
  3. 12
  4. 64
  5. 16
  6. 256 3.5 (Cartesian Powers) Let G = {0, 2, 4, 6, 8} what is |G^4|?
  7. 5^
  8. 4^
  9. 5!
  10. 0 + 2 + 4 + 6 + 8 - correct answer 1 3.5 (Cartesian Powers) Let A be a set with size 5. How many strict subsets does A have? - correct answer 31 3.6 An n-variable Boolean function maps {0, 1}^n to {0, 1}. How many 4-variable Boolean functions are there?
  11. 16
  12. 256
  13. 65,536 - correct answer 3. 3.6 Palindrome questions, first digit of an integer palindrome cannot be 0.
  14. How many positive 5-digit integer palindromes are there?
  15. How many are even, for example 29192?
  16. How many contain 7 or 8, for example 27172 or 38783 - correct answer 1. 900
  17. 400
  18. 452 3.6 How many 5-digit ternary strings are there without 4 consecutive 0s, 1s, or 2s? For example. 01210 and 11211 are counted. But 20000, 11112, and 22222 are excluded. - correct answer 228 3.6 A password consists of 4 or 5 characters. Each an uppercase letter, lowercase letter, or a digit. How many passwords are there if each of the three character types must appear at least once? - correct answer 312 3.6 How many ordered pairs (A, B), where A, B are subsets of {1, 2, 3, 4, 5} have:
  19. A intersect B = \emptyset\
  20. A intersect B = {1}
  21. |A intersect B| = 1 - correct answer 1. 243

4.1 In how many ways can 8 identical rocks be placed on an 8 x 8 chessboard so that none can capture any other, namely no row and no column contains more than one rook? - correct answer 40320 4.1In how many ways can 8 distinguishable rooks be placed on a 8x8 chessboard so that none can capture any other, namely no row and no column contains more than one rook? For example, in a 2x2 chessboard, you can place 2 rooks labeled 'a' and 'b' in 4 ways. There are 4 locations to place 'a', and that location determines the location of 'b' - correct answer 1625702400 4.1 In how many ways can 7 men and 7 women can sit around a table so that men and women alternate. Assume that all rotations of a configuration are identical hence counted as just one. - correct answer 3628800 4.1 In how many ways can three couples be seated in a row so that each couple sits together (namely next to each other):

  1. In a row
  2. In a circle - correct answer 1. 48
  3. 96 4.2 How many 2-permutations do we have for set {1, 2, 3, 4}?
  4. 8
  5. 12
  6. 16 - correct answer 2 4.2 In how many ways can 5 cars, a BMW, Chevy, Fiat, Honda, and a Kia park in 8 spots? - correct answer 6720 4.2 Find the number of 7 character (capital letter or digit) license plates possible if no character can repeat and:
  7. There are no further restrictions
  8. The first 3 characters are letters and the last 4 are numbers
  9. Letters and numbers alternate - correct answer 1. 42072307200
  10. 78624000
  11. 336960000 4.2 A derangement is a permutation of the elements such that none appear in its original position. For example, the only derangements of {1, 2, 3} are {2, 3, 1} and {3, 1, 2}. How many derangements does {1, 2, 3, 4} have? - correct answer 9

4.2 Eight books are placed on a shelf. Three of them form a 3-volume series, two form a 2-volume series, and 3 stand on their own. In how many ways can the eight books be arranged so that the books in the 3-volume series are placed together according to their correct order, and so are the books in the 2-volume series? Noted that there is only one correct order for each series. - correct answer 120 4.2 Which of the following is larger for k <= n?

  1. The number of k-permutations of an n-set
  2. The number of k-subsets of an n-set - correct answer 1. 4.3 In how many ways can a basketball coach select 5 starting players form a team of 15?
  3. 15! / 5! * 10!
  4. 15!/10!
  5. 15!/5! - correct answer 1.

1.In how many ways can you select a group of 2 people out of 5?

  1. In how many ways can you select a group of 3 out of 5?
  2. In how many ways can you divide 5 people into two group, where the first group has 2 people and the second has 3? - correct answer 1. 10
  3. 10 4.3 Ten points are placed on a plane, with no three on the same line. Find the number of: (Check the question in the quizzes)
  4. Lines connecting two of the two points.
  5. These lines that do not pass through two specific points (say A or B)
  6. Triangles formed by 3 of the points
  7. These triangles that contain a given point
  8. These triangles contain the side AB - correct answer 1. 45
  9. 28
  10. 120
  11. 36
  12. 8 4.3 A standard 52-card deck consists of 4 suits and 13 ranks. Find the number of 5 card hands where:

4.5 For a positive integer n, n choose (n-1) equals to:

  1. 1
  2. N-
  3. N
  4. N+1 - correct answer n A deck n >= 5 cards has as many 5-card hands as 2-card hands. What is n? - correct answer 7 4.5 if (n+2)C5 = 12(nc3). Find n - correct answer n = 14 4.6 Find the expansion of (x+y)^3 using the stuff in this course:
  5. X^3 + y^
  6. X^3 + x^2y + xy^2 + y^
  7. X^3 + 3x^2y + 3xy^2 + y^3 - correct answer 3. 4.6 What is the coefficient of x^2 in the expansion of (x+2)^
  8. 12
  9. 24
  10. 48 - correct answer 4 choose 2 * 2^2 = 24
  11. What is the coefficient of x^4 in the expansion of (2x - 1)^
  12. What is the constant term in the expansion of (x - 2/x)^6 - correct answer 1. -

4.6 What is the coefficient of x^2 in the expansion of (x+2)^4(x+3)^5 - correct answer 23112 4.6 Which of the following are equal?

  1. 10 choose 4
  2. 10 Choose 5 3 10 choose 6
  3. 9 choose 5 + 9 choose 6 - correct answer 1, 3, 4 4.7 What is the coefficient of xy in the expansion (x+y+2)^
  4. 12
  5. 24
  1. 48 - correct answer 3. 4.7 In how many ways can you give three baseball tickets, three soccer tickets, and three opera tickets, all general admission, to nine friends so each get one ticket? - correct answer 1680 4.7 How many ways can we divide 12 people into:
  2. Three labeled groups evenly
  3. Three unlabeled groups evenly
  4. Three labeled groups with 3, 4, and 5 people
  5. Three unlabeled groups with 3, 4, and 5 people.
  6. Three unlabeled groups with 3, 3, and 6 people - correct answer 1. 34650
  7. 5775
  8. 27720
  9. 27720
  10. 9240
  11. What is the coefficient of x^3y^2 in expansion of (x + 2y + 1)^
  12. What is the coefficient of x^3 in expansion of (x^2 - x + 2)^10 - correct answer 1. 10080

4.7 How many terms are there in the expansions of (x + y + z)^10 + (x - y + z)^10 - correct answer 36 4.7 How many anagrams, with or without meaning, does "REFEREE" have such that:

  1. There is no constraint
  2. Two R's are separated
  3. It contains subword "EE"
  4. It begins with letter "R" - correct answer 1. 105
  5. 75
  6. 102
  7. 30 4.7 How many anagrams, with or without meaning, do the following words have?
  8. CHAIR
  9. INDIA
  10. SWIMMING - correct answer 1. 120
  11. 60
  12. 10080
  1. Get number 3
  2. Get an even number
  3. Get a positive number - correct answer 1 and 2 5.1 Imagine a single experiment where we flip a coin 6 times, and get 'heads, tails, heads, heads, heads, heads'. Which of the following statements hold?
  4. The coin is not fair
  5. The coins 'tail' probability is 1/
  6. The sequence is an outcome in the sample space.
  7. The sample space of the experiment is {head, tail}. - correct answer 3. 5.2 An outcome in a uniform probability space has probability 1/10. What is the size of the sample space? - correct answer 10 5.2 Which of the following sample spaces are uniform?
  8. {land, sea} for a random point on a globe
  9. {odd, even} for a random integer from {1, 2, ..., 100}
  10. {leap year, non-leap year} for a random year before 2019
  11. {two heads, two tails, one head, and one tail} when flipping two fair coins
  12. {distance to origin} for a random point in {-3, -1, 1, 3} x {-4, -2, 2, 4} - correct answer 2 and 5 5.2 Given a uniform probability space {1, 2, 3, ..., 100}, what is the probability that the outcome contains the digit 1? - correct answer 19/ 5.3 What is the probability of drawing a Red Ace from a standard deck of cards? - correct answer 2/52. Heart ace and diamond ace? 5.3 Which of the following holds for every event A?
  13. P(A) >= 0
  14. P(A) <= 1
  15. P(A) + P(A^c) = 1
  16. P(A) = P(A^c)
  17. A = emptyset --> P(A) = 0
  18. P(A) = 0 --> A = emptyset - correct answer 1, 2, 3, 5 5.3 Which of the following always hold for events A and B?
  19. A is a subset of B --> P(A) less than or equal to P(B)
  20. P(A) <= P(B) --> A is a subset of B - correct answer 1.

5.3 Which of the following implies P(S - T) = P(S) - P(T) for events S and T

  1. T is a subset of S
  2. T is a proper subset of S
  3. S = T
  4. S is a subset of T - correct answer 1, 2, 3 5.3 50% of UCSD students play soccer, 40% play basketball, 30% play both. What is the probability that a random UCSD student does not play any of the two games?
  5. 0

5 0.6 - correct answer 3 5.3 Which of the following are events in the sample space: Omega = {1, 2, 3, 4, 5}

  1. {1, 2, 3}
  2. Emptyset
  3. Omega
  4. {1}
  5. {0, 3, 4} - correct answer 1, 2, 3, 4 For the uniform space {1, 2, ..., 10} find:
  6. P({primes})
  7. P({multiples of 3}) - correct answer 1. 4/
  8. 3/ 5.3 A bag contains 5 red and 3 blue balls.
  9. Pick one ball at random and observe its random color. What is the size of the color sample space?
  10. What is P(blue)?
  11. Two balls added to the bag and P(blue) = 0.4. How many of the two balls are blue?
  12. Two balls are removed from the original bag and now P(blue) = 0.5. How many of the two balls were blue? - correct answer 1. 2
  13. 3/
  14. 1
  15. 0