Starting from:

$39.99

MIT6006 Problem Set 0 Solution



Please write your solutions in the L ATEX and Python templates provided. Aim for concise solutions; convoluted and obtuse descriptions might receive low marks, even when they are correct.


Problem 0-1. Let and B = {3i | i ∈ {1, 2, 4, 5}}.
Evaluate: (a) A ∩ B (b) |A ∪ B| (c) |A − B|
Problem 0-2. Let X be the random variable representing the number of heads seen after flipping a fair coin three times. Let Y be the random variable representing the outcome of rolling two fair six-sided dice and multiplying their values. Please compute the following expected values.
Evaluate: (a) E[X] (b) E[Y ] (c) E[X + Y ]
Problem 0-3. Let A = 600/6 and B = 60 mod 42. Are these statements True or False?
Evaluate: (a) A ≡ B (mod 2) (b) A ≡ B (mod 3) (c) A ≡ B (mod 4)
2
Problem 0-4. Prove by induction that , for any integer n ≥ 1.
Problem 0-5. Prove by induction that every connected undirected graph G = (V, E) for which |E| = |V | − 1 is acyclic.
Problem 0-6. An increasing subarray of an integer array is any consecutive sequence of ar- ray integers whose values strictly increase. Write Python function count long subarrays(A) which accepts Python Tuple A = ( a0,a 1,...,a n−1) of n > 0 positive integers, and returns the number of longest increasing subarrays of A, i.e., the number of increasing subarrays with length at least as large as every other increasing subarray. For example, if A = (1,3,4,2,7,5,6,9,8), your program should return 2 since the maximum length of any increasing subarray of A is three and there are two increasing subarrays with that length: specifically, subarrays (1,3,4) and (5,6,9). You can download a code template containing some test cases from the website.
MIT OpenCourseWare
https://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms

More products