Carleton University. Final Examination Winter DURATION: 2 HOURS No. of students: 275

Similar documents
Carleton University. Final Examination Fall DURATION: 2 HOURS No. of students: 223

Carleton University. Final Examination Fall DURATION: 2 HOURS No. of students: 275

Carleton University. Final Examination Fall DURATION: 2 HOURS No. of students: 195

Carleton University. Final Examination Winter DURATION: 2 HOURS No. of students: 152

Midterm COMP October 19, All questions must be answered on the scantron sheet. Write your name and student number on the scantron sheet.

COMP 2804 Assignment 4

COMP 2804 Assignment 2

HW MATH425/525 Lecture Notes 1

Chapter 5 : Probability. Exercise Sheet. SHilal. 1 P a g e

2.6 Tools for Counting sample points

Midterm Exam 1 Solution

STA 247 Solutions to Assignment #1

1 The Basic Counting Principles

Discrete Random Variables

MATH STUDENT BOOK. 12th Grade Unit 9

Discrete Structures for Computer Science

The probability of an event is viewed as a numerical measure of the chance that the event will occur.

Sets. Review of basic probability. Tuples. E = {all even integers} S = {x E : x is a multiple of 3} CSE 101. I = [0, 1] = {x : 0 x 1}

EECS 70 Discrete Mathematics and Probability Theory Fall 2015 Walrand/Rao Final

Discrete Probability

Discrete Structures Prelim 1 Selected problems from past exams

Math 151. Rumbos Fall Solutions to Review Problems for Exam 2. Pr(X = 1) = ) = Pr(X = 2) = Pr(X = 3) = p X. (k) =

Discrete Mathematics and Probability Theory Summer 2014 James Cook Final Exam

Topic -2. Probability. Larson & Farber, Elementary Statistics: Picturing the World, 3e 1

CSC Discrete Math I, Spring Discrete Probability

1. When applied to an affected person, the test comes up positive in 90% of cases, and negative in 10% (these are called false negatives ).

Example. If 4 tickets are drawn with replacement from ,

CS 441 Discrete Mathematics for CS Lecture 19. Probabilities. CS 441 Discrete mathematics for CS. Probabilities

Great Theoretical Ideas in Computer Science

4 Lecture 4 Notes: Introduction to Probability. Probability Rules. Independence and Conditional Probability. Bayes Theorem. Risk and Odds Ratio

Discrete Mathematics and Probability Theory Fall 2017 Ramchandran and Rao Midterm 2 Solutions

Mathematical Foundations of Computer Science Lecture Outline October 18, 2018

Section 13.3 Probability

Homework 4 Solution, due July 23

Discrete Mathematics and Probability Theory Fall 2010 Tse/Wagner MT 2 Soln

Overview. CSE 21 Day 5. Image/Coimage. Monotonic Lists. Functions Probabilistic analysis

P ( A B ) = P ( A ) P ( B ) 1. The probability that a randomly selected student at Anytown College owns a bicycle is

Example 1. The sample space of an experiment where we flip a pair of coins is denoted by:

Example. What is the sample space for flipping a fair coin? Rolling a 6-sided die? Find the event E where E = {x x has exactly one head}

COMPSCI 240: Reasoning Under Uncertainty

1 Probability Theory. 1.1 Introduction

Midterm 2. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You:

UC Berkeley, CS 174: Combinatorics and Discrete Probability (Fall 2008) Midterm 1. October 7, 2008

1. Consider a random independent sample of size 712 from a distribution with the following pdf. c 1+x. f(x) =

Introduction to Decision Sciences Lecture 11

Probability and random variables

Business Statistics. Lecture 3: Random Variables and the Normal Distribution

Monty Hall Puzzle. Draw a tree diagram of possible choices (a possibility tree ) One for each strategy switch or no-switch

Problems and results for the ninth week Mathematics A3 for Civil Engineering students

Some Review Problems for Exam 3: Solutions

Probability Notes. Definitions: The probability of an event is the likelihood of choosing an outcome from that event.

CMPSCI 240: Reasoning Under Uncertainty

Senior Math Circles November 19, 2008 Probability II

Exam 1 Review With Solutions Instructor: Brian Powers

Expectation, inequalities and laws of large numbers

Math 230 Final Exam, Spring 2009

ECE 302, Final 3:20-5:20pm Mon. May 1, WTHR 160 or WTHR 172.

Chapter 2 Class Notes

Discrete Mathematics and Probability Theory Summer 2015 Chung-Wei Lin Midterm 2

When working with probabilities we often perform more than one event in a sequence - this is called a compound probability.

Introduction to Probability Theory, Algebra, and Set Theory

STAT 31 Practice Midterm 2 Fall, 2005

Introduction to Probability, Fall 2009

DO NOT WRITE BELOW THIS LINE Total page 1: / 20 points. Total page 2: / 20 points

Econ 113. Lecture Module 2

Midterm Exam 1 (Solutions)

Chapter 2 PROBABILITY SAMPLE SPACE

MATH 3C: MIDTERM 1 REVIEW. 1. Counting

Probability Notes (A) , Fall 2010

NAME (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt): Name of Neighbor to your right (1 pt):

Name: Practice Final Exam May 8, 2012

Recitation 6. Randomization. 6.1 Announcements. RandomLab has been released, and is due Monday, October 2. It s worth 100 points.

CMSC Discrete Mathematics SOLUTIONS TO FIRST MIDTERM EXAM October 18, 2005 posted Nov 2, 2005

Random Variable. Pr(X = a) = Pr(s)

Class 26: review for final exam 18.05, Spring 2014

Notes. Combinatorics. Combinatorics II. Notes. Notes. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006

CSE 321 Solutions to Practice Problems

Alex Psomas: Lecture 17.

MA EXAM 3 Form A November 12, You must use a #2 pencil on the mark sense sheet (answer sheet).

Probability, For the Enthusiastic Beginner (Exercises, Version 1, September 2016) David Morin,

Exam 1. Problem 1: True or false

Lecture Notes 1 Basic Probability. Elements of Probability. Conditional probability. Sequential Calculation of Probability

Discrete Structures for Computer Science: Counting, Recursion, and Probability

k P (X = k)

Lecture 1. Chapter 1. (Part I) Material Covered in This Lecture: Chapter 1, Chapter 2 ( ). 1. What is Statistics?

Lecture 1. ABC of Probability

Lecture 2: Probability

IE 4521 Midterm #1. Prof. John Gunnar Carlsson. March 2, 2010

University of Illinois ECE 313: Final Exam Fall 2014

Notes on Discrete Probability

AMS7: WEEK 2. CLASS 2

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

Problem # Number of points 1 /20 2 /20 3 /20 4 /20 5 /20 6 /20 7 /20 8 /20 Total /150

Entropy. Probability and Computing. Presentation 22. Probability and Computing Presentation 22 Entropy 1/39

This exam contains 13 pages (including this cover page) and 10 questions. A Formulae sheet is provided with the exam.

Presentation on Theo e ry r y o f P r P o r bab a il i i l t i y

Semester 2 Final Exam Review Guide for AMS I

Math 461 B/C, Spring 2009 Midterm Exam 1 Solutions and Comments

Exam 1 Solutions. Problem Points Score Total 145

Conditional Probability (cont'd)

Transcription:

Carleton University Final Examination Winter 2017 DURATION: 2 HOURS No. of students: 275 Department Name & Course Number: Computer Science COMP 2804B Course Instructor: Michiel Smid Authorized memoranda: Calculator Students MUST count the number of pages in this examination question paper before beginning to write, and report any discrepancy to the proctor. This question paper has 12 pages (not including the cover page). This examination question paper MAY be taken from the examination room. In addition to this question paper, students require: an examination booklet: a Scantron sheet: no yes

COMP 2804B, WINTER 2017 1 Instructions: 1. All questions must be answered on the scantron sheet. 2. Write your name and student number on the scantron sheet. 3. You do not have to hand in this examination paper. 4. Calculators are allowed. Marking scheme: Each of the 25 questions is worth 1 mark. ( ) n k = n!. k!(n k)! Newton: (x + y) n = n k=0 ( n k) x n k y k. For 0 < x < 1, n=0 xn = 1/(1 x). Geometric distribution: Assume an experiment has a success probability of p. We perform the experiment until it is successful for the first time. The expected number of times we perform the experiment is 1/p.

COMP 2804B, WINTER 2017 2 1. Consider permutations a 1, a 2,..., a 10 of the set {1, 2,..., 10} for which a 1, a 3, a 5, a 7, a 9 are all odd and a 2, a 4, a 6, a 8, a 10 are all even. How many such permutations are there? (a) 10! (b) 5 5 5 5 (c) (5!) 2 (d) 2 (5!) 2 2. Let n 2 be an integer. Consider permutations a 1, a 2,..., a n of the set {1, 2,..., n} for which a 1 < a 2. How many such permutations are there? (a) n! 2 (b) n! (c) 2 ( n 2) (n 2)! (d) None of the above. 3. Let B be a set consisting of 45 bottles. Out of these, 17 are beer bottles, and the remaining 28 are cider bottles. Consider subsets of B that contain or exactly 5 beer bottles and zero or more cider bottles, exactly 5 cider bottles and zero or more beer bottles. How many such subsets are there? (a) ( ) 17 5 2 28 + 2 17 (28 ) 5 (b) ( ) 17 5 2 28 + 2 17 (28 ) ( 5 17 ) ( 5 28 ) 5 (c) 2 45 ( ) ( 17 5 28 ) 5 (d) 2 45 ( ) ( 17 5 28 ) 5

COMP 2804B, WINTER 2017 3 4. A bitstring b 1 b 2... b n is called a palindrome if b 1 b 2... b n = b n b n 1... b 1, i.e., reading the string from left to right gives the same result as reading it from right to left. Let n 3 be an odd integer. How many palindromes of length n are there? (a) 2 n 1 (b) 2 n 2 (c) 2 (n 1)/2 (d) 2 (n+1)/2 5. Let n 2 be an integer. What does 2 n 2 n 2 count? (a) The number of bitstrings of length n in which the first bit is 0 or the last bit is 1. (b) The number of bitstrings of length n in which the first bit is 0 and the last bit is 1. (c) The number of bitstrings of length n in which the first bit is equal to the last bit. (d) The number of bitstrings of length n in which the first bit is not equal to the last bit. 6. Consider a group of 100 students. In this group, 63 students like beer, 71 students like cider, and 25 students do not like beer and do not like cider. How many students like beer and cider? (a) 57 (b) 58 (c) 59 (d) 60

COMP 2804B, WINTER 2017 4 7. In this question, we consider bitstrings of length n, where n is an even integer, and in which the positions are numbered 1, 2,..., n. For any even integer n, let S n be the number of bitstrings of length n that have both of the following two properties: There is a 0 at every even position. The entire bitstring does not contain the substring 101. Which of the following is true for all even integers n 6? (a) S n = S n/2 + S (n/2) 3 (b) S n = S n 1 + S n 3 (c) S n = S n 2 + S n 3 (d) S n = S n 2 + S n 4 8. Consider bitstrings that contain at least one occurrence of 000. Let S n be the number of such strings having length n. Which of the following is true for n 4? (a) S n = S n 1 + S n 2 + 2 n 2 (b) S n = S n 1 + S n 2 + S n 3 + 2 n 3 (c) S n = S n 1 + S n 2 + S n 3 (d) S n = S n 1 + S n 2 + S n 3 + 2 n 4

COMP 2804B, WINTER 2017 5 9. Consider the recursive algorithm Hello, which takes as input an integer n 0: Algorithm Hello(n): if n = 0 or n = 1 then print hello else if n is even then Hello( n 2 ); Hello( n 2 1) else Hello(n 1); Hello(n 2) endif; endif If we run algorithm Hello(7), how many times is the word hello printed? (a) 9 (b) 10 (c) 11 (d) 12 10. We choose, uniformly at random, a string consisting of 14 characters, where each character is a lowercase letter. Let A be the event A = the string contains at least one vowel. (A vowel is one of the letters a, e, i, o, and u.) What is Pr(A)? (a) 1 (21/26) 14 (b) 1 (26/21) 14 (c) 5 (5/26) (21/26) 13 (d) 14 (5/26) (21/26) 13 11. Consider a group consisting of 7 girls and 6 boys. Elisa is one of the girls. How many ways are there to arrange these 13 people on a horizontal line such that Elisa has 2 neighbors, both of whom are girls? (The order on the line matters.) (a) 11 (6 2) 10! (b) 11 6 5 10! (c) 12 6 5 10! (d) 13 6 5 10!

COMP 2804B, WINTER 2017 6 12. Let X = {1, 2, 3,..., 10}. We choose, uniformly at random, a subset Y of X, where Y has size 5. Define the events A = 1 is an element of Y, B = 7 is an element of Y. What is Pr(A B)? (a) 4/8 (b) 5/8 (c) 4/9 (d) 5/9 13. We flip a fair coin, independently, five times. Define the events What is Pr(A B)? (a) 1/3 (b) 2/3 (c) 2/5 (d) 1/4 A = the coin comes up heads exactly four times, B = the fifth coin flip results in heads. 14. Let n 3 be an integer. Consider a uniformly random permutation a 1 a 2... a n of the set {1, 2,..., n}. Define the events A = a n = n, B = a 2 > a 1. Which of the following is true? (a) The events A and B are independent. (b) The events A and B are not independent. (c) None of the above.

COMP 2804B, WINTER 2017 7 15. Let n 5 be an integer. Consider a uniformly random permutation a 1 a 2... a n of the set {1, 2,..., n}. Define the events A = a 1 = 1, B = a n = 5. What is Pr(A B)? (a) 1 n 1 n(n 1) (b) 2 n 1 n(n 1) (c) 2 n 1 n 2 (d) None of the above. 16. Let A and B be two events in some sample space. You are given that Pr(A B) = Pr(B A), Pr(A B) = 1, Pr(A B) > 0. Which of the following is true? (a) Pr(A) < 1/2 (b) Pr(A) > 1/2 (c) Pr(A) < 1 (d) Pr(A) > 0 17. Consider a uniformly random permutation of the set {1, 2,..., 50}. Define the event A = in the permutation, both 8 and 4 are to the left of both 1 and 2. What is Pr(A)? (a) 1/3 (b) 2/3 (c) 1/5 (d) 1/6

COMP 2804B, WINTER 2017 8 18. You roll a fair red die and a fair blue die, independently of each other. Define the random variables X = the result of the red die, Y = the result of the blue die, Z = min(x, Y ). What is Pr(Z = 2)? (a) 5/18 (b) 1/6 (c) 1/4 (d) 1/3 19. Let n 3 be an integer and consider a group P 1, P 2,..., P n of n people. Each of these people has a uniformly random birthday, which is independent of the birthdays of the other people. We ignore leap years; thus, the year has 365 days. Define the random variable X to be the number of unordered triples {P i, P j, P k } of people (i.e., subsets consisting of three people) that have the same birthday. What is the expected value E(X) of X? Hint: Use indicator random variables. (a) 1 (n 365 2 3 1 (b) (n 365 3 3 (c) 1 n 3 365 2 (d) 1 n 3 365 3 ) ) 20. Consider a coin that comes up heads with probability 1/5 and comes up tails with probability 4/5. You flip this coin twice, independently of each other. For each heads, you win $100. For each tails, you win $50. Define the random variable X to be the amount (in dollars) that you win. What is the expected value E(X) of X? (a) 80 (b) 100 (c) 120 (d) 140

COMP 2804B, WINTER 2017 9 21. You are given a fair red die and a fair blue die. You roll each die once, independently of each other. Let (i, j) be the outcome, where i is the result of the red die and j is the result of the blue die. Define the random variables X = i j and Which of the following is true? Y = max(i, j). (a) The random variables X and Y are independent. (b) The random variables X and Y are not independent. (c) None of the above. 22. Consider the following recursive algorithm TwoTails, which takes as input a positive integer k: Algorithm TwoTails(k): // all coin flips made are mutually independent flip a fair coin twice; if the coin came up heads exactly twice then return 2 k else TwoTails(k + 1) endif You run algorithm TwoTails(1), i.e., with k = 1. Define the random variable X to be the value of the output of this algorithm. Let m 1 be an integer. What is Pr(X = 2 m )? (a) (1/4) m 3/4 (b) (1/4) m 1 3/4 (c) (3/4) m 1/4 (d) (3/4) m 1 1/4

COMP 2804B, WINTER 2017 10 23. Is the following statement true or false? For any two random variables X and Y, E(X Y ) = E(X) E(Y ). (a) The statement is true. (b) The statement is false. (c) None of the above. 24. Elisa Kazan has successfully completed her first term as President of the Carleton Computer Science Society. In order to celebrate this, Elisa decides to spend an evening in the Hyacintho Cactus Bar and Grill in downtown Ottawa. During this evening, Tan Tran is working as a server. Since Tan has been studying very hard for COMP 2804, he is a bit absent-minded: Every time a customer orders a drink, Tan serves the wrong drink with probability 1/12, independently of other orders. Elisa orders 7 ciders, one cider at a time. Let (D 1, D 2,..., D 7 ) be the sequence of drinks that Tan serves. Define the following random variable X: X = the number of indices i such that D i is a cider and D i+1 is not a cider. What is the expected value E(X) of X? (a) 44/144 (b) 55/144 (c) 66/144 (d) 77/144 25. How do you feel about writing an exam on Sunday afternoon? (a) I hate it!

COMP 2804B, WINTER 2017 11

COMP 2804B, WINTER 2017 12