From 54391eea4a6c09a300dad8b5dfd68030c25cd585 Mon Sep 17 00:00:00 2001 From: Matthew M-B Date: Sun, 30 Jun 2024 01:53:07 -0400 Subject: [PATCH] Add fall midterms --- .../comp2804/midterm-fall-2014/1/index.md | 9 +++ .../comp2804/midterm-fall-2014/1/question.ts | 21 ++++++ .../comp2804/midterm-fall-2014/10/index.md | 9 +++ .../comp2804/midterm-fall-2014/10/question.ts | 27 ++++++++ .../comp2804/midterm-fall-2014/11/index.md | 9 +++ .../comp2804/midterm-fall-2014/11/question.ts | 21 ++++++ .../comp2804/midterm-fall-2014/12/index.md | 9 +++ .../comp2804/midterm-fall-2014/12/question.ts | 36 +++++++++++ .../comp2804/midterm-fall-2014/13/index.md | 9 +++ .../comp2804/midterm-fall-2014/13/question.ts | 42 ++++++++++++ .../comp2804/midterm-fall-2014/14/index.md | 9 +++ .../comp2804/midterm-fall-2014/14/question.ts | 21 ++++++ .../comp2804/midterm-fall-2014/15/index.md | 9 +++ .../comp2804/midterm-fall-2014/15/question.ts | 26 ++++++++ .../comp2804/midterm-fall-2014/16/index.md | 9 +++ .../comp2804/midterm-fall-2014/16/question.ts | 21 ++++++ .../comp2804/midterm-fall-2014/17/index.md | 9 +++ .../comp2804/midterm-fall-2014/17/question.ts | 22 +++++++ .../comp2804/midterm-fall-2014/2/index.md | 9 +++ .../comp2804/midterm-fall-2014/2/question.ts | 20 ++++++ .../comp2804/midterm-fall-2014/3/index.md | 9 +++ .../comp2804/midterm-fall-2014/3/question.ts | 21 ++++++ .../comp2804/midterm-fall-2014/4/index.md | 9 +++ .../comp2804/midterm-fall-2014/4/question.ts | 34 ++++++++++ .../comp2804/midterm-fall-2014/5/index.md | 9 +++ .../comp2804/midterm-fall-2014/5/question.ts | 17 +++++ .../comp2804/midterm-fall-2014/6/index.md | 9 +++ .../comp2804/midterm-fall-2014/6/question.ts | 21 ++++++ .../comp2804/midterm-fall-2014/7/index.md | 9 +++ .../comp2804/midterm-fall-2014/7/question.ts | 20 ++++++ .../comp2804/midterm-fall-2014/8/index.md | 9 +++ .../comp2804/midterm-fall-2014/8/question.ts | 21 ++++++ .../comp2804/midterm-fall-2014/9/index.md | 9 +++ .../comp2804/midterm-fall-2014/9/question.ts | 36 +++++++++++ .../comp2804/midterm-fall-2015/1/index.md | 9 +++ .../comp2804/midterm-fall-2015/1/question.ts | 24 +++++++ .../comp2804/midterm-fall-2015/10/index.md | 9 +++ .../comp2804/midterm-fall-2015/10/question.ts | 27 ++++++++ .../comp2804/midterm-fall-2015/11/index.md | 9 +++ .../comp2804/midterm-fall-2015/11/question.ts | 21 ++++++ .../comp2804/midterm-fall-2015/12/index.md | 9 +++ .../comp2804/midterm-fall-2015/12/question.ts | 44 +++++++++++++ .../comp2804/midterm-fall-2015/13/index.md | 9 +++ .../comp2804/midterm-fall-2015/13/question.ts | 36 +++++++++++ .../comp2804/midterm-fall-2015/14/index.md | 9 +++ .../comp2804/midterm-fall-2015/14/question.ts | 64 +++++++++++++++++++ .../comp2804/midterm-fall-2015/15/index.md | 9 +++ .../comp2804/midterm-fall-2015/15/question.ts | 24 +++++++ .../comp2804/midterm-fall-2015/16/index.md | 9 +++ .../comp2804/midterm-fall-2015/16/question.ts | 28 ++++++++ .../comp2804/midterm-fall-2015/17/index.md | 9 +++ .../comp2804/midterm-fall-2015/17/question.ts | 26 ++++++++ .../comp2804/midterm-fall-2015/2/index.md | 9 +++ .../comp2804/midterm-fall-2015/2/question.ts | 21 ++++++ .../comp2804/midterm-fall-2015/3/index.md | 9 +++ .../comp2804/midterm-fall-2015/3/question.ts | 21 ++++++ .../comp2804/midterm-fall-2015/4/index.md | 9 +++ .../comp2804/midterm-fall-2015/4/question.ts | 21 ++++++ .../comp2804/midterm-fall-2015/5/index.md | 9 +++ .../comp2804/midterm-fall-2015/5/question.ts | 21 ++++++ .../comp2804/midterm-fall-2015/6/index.md | 9 +++ .../comp2804/midterm-fall-2015/6/question.ts | 24 +++++++ .../comp2804/midterm-fall-2015/7/index.md | 9 +++ .../comp2804/midterm-fall-2015/7/question.ts | 26 ++++++++ .../comp2804/midterm-fall-2015/8/index.md | 9 +++ .../comp2804/midterm-fall-2015/8/question.ts | 20 ++++++ .../comp2804/midterm-fall-2015/9/index.md | 9 +++ .../comp2804/midterm-fall-2015/9/question.ts | 21 ++++++ .../comp2804/midterm-fall-2016/1/index.md | 9 +++ .../comp2804/midterm-fall-2016/1/question.ts | 24 +++++++ .../comp2804/midterm-fall-2016/10/index.md | 9 +++ .../comp2804/midterm-fall-2016/10/question.ts | 27 ++++++++ .../comp2804/midterm-fall-2016/11/index.md | 9 +++ .../comp2804/midterm-fall-2016/11/question.ts | 22 +++++++ .../comp2804/midterm-fall-2016/12/index.md | 9 +++ .../comp2804/midterm-fall-2016/12/question.ts | 37 +++++++++++ .../comp2804/midterm-fall-2016/13/index.md | 9 +++ .../comp2804/midterm-fall-2016/13/question.ts | 36 +++++++++++ .../comp2804/midterm-fall-2016/14/index.md | 9 +++ .../comp2804/midterm-fall-2016/14/question.ts | 40 ++++++++++++ .../comp2804/midterm-fall-2016/15/index.md | 9 +++ .../comp2804/midterm-fall-2016/15/question.ts | 25 ++++++++ .../comp2804/midterm-fall-2016/16/index.md | 9 +++ .../comp2804/midterm-fall-2016/16/question.ts | 28 ++++++++ .../comp2804/midterm-fall-2016/17/index.md | 9 +++ .../comp2804/midterm-fall-2016/17/question.ts | 29 +++++++++ .../comp2804/midterm-fall-2016/2/index.md | 9 +++ .../comp2804/midterm-fall-2016/2/question.ts | 21 ++++++ .../comp2804/midterm-fall-2016/3/index.md | 9 +++ .../comp2804/midterm-fall-2016/3/question.ts | 22 +++++++ .../comp2804/midterm-fall-2016/4/index.md | 9 +++ .../comp2804/midterm-fall-2016/4/question.ts | 21 ++++++ .../comp2804/midterm-fall-2016/5/index.md | 9 +++ .../comp2804/midterm-fall-2016/5/question.ts | 21 ++++++ .../comp2804/midterm-fall-2016/6/index.md | 9 +++ .../comp2804/midterm-fall-2016/6/question.ts | 21 ++++++ .../comp2804/midterm-fall-2016/7/index.md | 9 +++ .../comp2804/midterm-fall-2016/7/question.ts | 28 ++++++++ .../comp2804/midterm-fall-2016/8/index.md | 9 +++ .../comp2804/midterm-fall-2016/8/question.ts | 22 +++++++ .../comp2804/midterm-fall-2016/9/index.md | 9 +++ .../comp2804/midterm-fall-2016/9/question.ts | 20 ++++++ .../comp2804/midterm-fall-2017/1/index.md | 9 +++ .../comp2804/midterm-fall-2017/1/question.ts | 21 ++++++ .../comp2804/midterm-fall-2017/10/index.md | 9 +++ .../comp2804/midterm-fall-2017/10/question.ts | 21 ++++++ .../comp2804/midterm-fall-2017/11/index.md | 9 +++ .../comp2804/midterm-fall-2017/11/question.ts | 25 ++++++++ .../comp2804/midterm-fall-2017/12/index.md | 9 +++ .../comp2804/midterm-fall-2017/12/question.ts | 47 ++++++++++++++ .../comp2804/midterm-fall-2017/13/index.md | 9 +++ .../comp2804/midterm-fall-2017/13/question.ts | 23 +++++++ .../comp2804/midterm-fall-2017/14/index.md | 9 +++ .../comp2804/midterm-fall-2017/14/question.ts | 44 +++++++++++++ .../comp2804/midterm-fall-2017/15/index.md | 9 +++ .../comp2804/midterm-fall-2017/15/question.ts | 39 +++++++++++ .../comp2804/midterm-fall-2017/16/index.md | 9 +++ .../comp2804/midterm-fall-2017/16/question.ts | 25 ++++++++ .../comp2804/midterm-fall-2017/17/index.md | 9 +++ .../comp2804/midterm-fall-2017/17/question.ts | 31 +++++++++ .../comp2804/midterm-fall-2017/2/index.md | 9 +++ .../comp2804/midterm-fall-2017/2/question.ts | 35 ++++++++++ .../comp2804/midterm-fall-2017/3/index.md | 9 +++ .../comp2804/midterm-fall-2017/3/question.ts | 25 ++++++++ .../comp2804/midterm-fall-2017/4/index.md | 9 +++ .../comp2804/midterm-fall-2017/4/question.ts | 25 ++++++++ .../comp2804/midterm-fall-2017/5/index.md | 9 +++ .../comp2804/midterm-fall-2017/5/question.ts | 21 ++++++ .../comp2804/midterm-fall-2017/6/index.md | 9 +++ .../comp2804/midterm-fall-2017/6/question.ts | 21 ++++++ .../comp2804/midterm-fall-2017/7/index.md | 9 +++ .../comp2804/midterm-fall-2017/7/question.ts | 24 +++++++ .../comp2804/midterm-fall-2017/8/index.md | 9 +++ .../comp2804/midterm-fall-2017/8/question.ts | 22 +++++++ .../comp2804/midterm-fall-2017/9/index.md | 9 +++ .../comp2804/midterm-fall-2017/9/question.ts | 20 ++++++ .../comp2804/midterm-fall-2018/1/index.md | 9 +++ .../comp2804/midterm-fall-2018/1/question.ts | 22 +++++++ .../comp2804/midterm-fall-2018/10/index.md | 9 +++ .../comp2804/midterm-fall-2018/10/question.ts | 28 ++++++++ .../comp2804/midterm-fall-2018/11/index.md | 9 +++ .../comp2804/midterm-fall-2018/11/question.ts | 25 ++++++++ .../comp2804/midterm-fall-2018/12/index.md | 9 +++ .../comp2804/midterm-fall-2018/12/question.ts | 30 +++++++++ .../comp2804/midterm-fall-2018/13/index.md | 9 +++ .../comp2804/midterm-fall-2018/13/question.ts | 24 +++++++ .../comp2804/midterm-fall-2018/14/index.md | 9 +++ .../comp2804/midterm-fall-2018/14/question.ts | 42 ++++++++++++ .../comp2804/midterm-fall-2018/15/index.md | 9 +++ .../comp2804/midterm-fall-2018/15/question.ts | 38 +++++++++++ .../comp2804/midterm-fall-2018/16/index.md | 9 +++ .../comp2804/midterm-fall-2018/16/question.ts | 27 ++++++++ .../comp2804/midterm-fall-2018/17/index.md | 9 +++ .../comp2804/midterm-fall-2018/17/question.ts | 27 ++++++++ .../comp2804/midterm-fall-2018/2/index.md | 9 +++ .../comp2804/midterm-fall-2018/2/question.ts | 29 +++++++++ .../comp2804/midterm-fall-2018/3/index.md | 9 +++ .../comp2804/midterm-fall-2018/3/question.ts | 21 ++++++ .../comp2804/midterm-fall-2018/4/index.md | 9 +++ .../comp2804/midterm-fall-2018/4/question.ts | 25 ++++++++ .../comp2804/midterm-fall-2018/5/index.md | 9 +++ .../comp2804/midterm-fall-2018/5/question.ts | 25 ++++++++ .../comp2804/midterm-fall-2018/6/index.md | 9 +++ .../comp2804/midterm-fall-2018/6/question.ts | 21 ++++++ .../comp2804/midterm-fall-2018/7/index.md | 9 +++ .../comp2804/midterm-fall-2018/7/question.ts | 22 +++++++ .../comp2804/midterm-fall-2018/8/index.md | 9 +++ .../comp2804/midterm-fall-2018/8/question.ts | 26 ++++++++ .../comp2804/midterm-fall-2018/9/index.md | 9 +++ .../comp2804/midterm-fall-2018/9/question.ts | 25 ++++++++ 170 files changed, 3031 insertions(+) create mode 100644 src/content/questions/comp2804/midterm-fall-2014/1/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/1/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/10/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/10/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/11/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/11/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/12/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/12/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/13/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/13/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/14/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/14/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/15/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/15/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/16/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/16/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/17/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/17/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/2/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/2/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/3/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/3/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/4/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/4/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/5/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/5/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/6/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/6/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/7/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/7/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/8/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/8/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2014/9/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2014/9/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/1/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/1/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/10/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/10/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/11/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/11/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/12/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/12/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/13/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/13/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/14/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/14/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/15/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/15/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/16/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/16/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/17/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/17/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/2/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/2/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/3/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/3/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/4/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/4/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/5/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/5/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/6/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/6/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/7/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/7/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/8/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/8/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2015/9/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2015/9/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/1/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/1/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/10/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/10/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/11/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/11/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/12/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/12/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/13/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/13/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/14/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/14/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/15/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/15/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/16/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/16/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/17/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/17/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/2/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/2/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/3/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/3/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/4/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/4/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/5/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/5/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/6/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/6/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/7/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/7/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/8/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/8/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2016/9/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2016/9/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/1/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/1/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/10/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/10/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/11/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/11/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/12/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/12/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/13/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/13/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/14/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/14/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/15/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/15/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/16/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/16/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/17/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/17/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/2/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/2/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/3/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/3/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/4/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/4/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/5/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/5/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/6/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/6/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/7/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/7/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/8/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/8/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2017/9/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2017/9/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/1/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/1/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/10/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/10/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/11/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/11/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/12/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/12/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/13/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/13/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/14/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/14/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/15/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/15/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/16/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/16/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/17/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/17/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/2/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/2/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/3/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/3/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/4/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/4/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/5/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/5/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/6/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/6/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/7/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/7/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/8/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/8/question.ts create mode 100644 src/content/questions/comp2804/midterm-fall-2018/9/index.md create mode 100644 src/content/questions/comp2804/midterm-fall-2018/9/question.ts diff --git a/src/content/questions/comp2804/midterm-fall-2014/1/index.md b/src/content/questions/comp2804/midterm-fall-2014/1/index.md new file mode 100644 index 00000000..28117a28 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/1/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/1 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/1/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/1/question.ts b/src/content/questions/comp2804/midterm-fall-2014/1/question.ts new file mode 100644 index 00000000..4cdab8f2 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/1/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 2$ be an integer. How many bitstrings of length $n$ are there that contain at least two + 1s? +`; + +const label1 = "${n \\choose 2} \\cdot 2^{n-2}$"; +const label2 = "$n \\cdot 2^{n-1}$"; +const label3 = "$2^{n} - 1 - n$"; +const label4 = "$2^{n} - n$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/10/index.md b/src/content/questions/comp2804/midterm-fall-2014/10/index.md new file mode 100644 index 00000000..af04660b --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/10/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/10 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/10/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/10/question.ts b/src/content/questions/comp2804/midterm-fall-2014/10/question.ts new file mode 100644 index 00000000..677f0467 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/10/question.ts @@ -0,0 +1,27 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +The function $f : \mathbb{N} \rightarrow \mathbb{N}$ is defined by + $$ + \begin{align} + f(0) &= 8 \\ + f(n) &= f(n - 1) + 6n - 8\; \ \mathrm{for}\ n \geq 1 + \end{align} + $$ + What is $f(n)$? +`; + +const label1 = String.raw`$f(n) = 2n^{2} - 5n + 7$`; +const label2 = String.raw`$f(n) = 2n^{2} - 5n + 8$`; +const label3 = String.raw`$f(n) = 3n^{2} - 5n + 8$`; +const label4 = String.raw`$f(n) = 4n^{2} - 5n + 8$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/11/index.md b/src/content/questions/comp2804/midterm-fall-2014/11/index.md new file mode 100644 index 00000000..cd2a1017 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/11/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/11 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/11/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/11/question.ts b/src/content/questions/comp2804/midterm-fall-2014/11/question.ts new file mode 100644 index 00000000..af769906 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/11/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $B_n$ be the number of bitstrings of length $n$ that do not contain 1111. Which of the following + is true? +`; + +const label1 = String.raw`$B_n = B_{n-1} + B_{n-2} + B_{n-3}$`; +const label2 = String.raw`$B_n = B_{n-1} + B_{n-2} + B_{n-3} + B_{n-4}$`; +const label3 = String.raw`$B_n = 2^{n} - 2^{n-4}$`; +const label4 = String.raw`$B_n = 2^{n} - (n-3) \cdot 2^{n-4}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/12/index.md b/src/content/questions/comp2804/midterm-fall-2014/12/index.md new file mode 100644 index 00000000..47d75f9c --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/12/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/12 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/12/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/12/question.ts b/src/content/questions/comp2804/midterm-fall-2014/12/question.ts new file mode 100644 index 00000000..1f741a77 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/12/question.ts @@ -0,0 +1,36 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` + + + Consider the following recursive algorithm $\Fib$, which takes as input an + integer $n \geq 0$: + +

+ $\mathbf{Algorithm}\ \Fib(n)\mathrm{:}$
+ $\mathbf{if}\ n = 0\ \mathrm{or}\ n = 1$
+ $\mathbf{then}\ f = n$
+ $\mathbf{else}\ f = \Fib(n - 1) + \Fib(n - 2)$
+ $\mathbf{endif};$
+ $\mathbf{return}\ f$
+

+ + When running $\Fib(9)$, how many calls are there to $\Fib(4)$? +`; + +const label1 = String.raw`6`; +const label2 = String.raw`7`; +const label3 = String.raw`8`; +const label4 = String.raw`9`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/13/index.md b/src/content/questions/comp2804/midterm-fall-2014/13/index.md new file mode 100644 index 00000000..56d08c4d --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/13/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/13 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/13/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/13/question.ts b/src/content/questions/comp2804/midterm-fall-2014/13/question.ts new file mode 100644 index 00000000..f75b7dbe --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/13/question.ts @@ -0,0 +1,42 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` + + + Consider the following recursive algorithm $\Silly$, which takes as input an integer $n \geq 1$ which is a power of 2: + +

+ $\mathbf{Algorithm}\ \Silly(n)\mathrm{:}$
+ $\mathbf{if}\ n = 1$
+ $\mathbf{then}\ \text{drink one pint of beer}$
+ $\mathbf{else}\ \mathbf{if}\ n = 2$
+ $\elsesp \mathbf{then}\ \text{fart once}$
+ $\elsesp \mathbf{else}\ \text{fart once};$
+ $\elsesp \elsesp \Silly(n / 2);$
+ $\elsesp \elsesp \text{fart once}$
+ $\elsesp \mathbf{endif}$
+ $\mathbf{endif}$ +

+ + For $n$ a power of 2, let $F(n)$ be the number of times you fart when running algorithm $\Silly(n)$. + Which of the following is true?
+ (n.b., $\log$ denotes the base-2 logarithm) +`; + +const label1 = String.raw`$F(n) = \log n\ \mathrm{for}\ n \geq 1.$`; +const label2 = String.raw`$F(n) = 2 \log n\ \mathrm{for}\ n \geq 1.$`; +const label3 = String.raw`$F(n) = (2 \log n) - 1\ \mathrm{for}\ n \geq 1.$`; +const label4 = String.raw`$F(n) = (2 \log n) - 1\ \mathrm{for}\ n \geq 2.$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/14/index.md b/src/content/questions/comp2804/midterm-fall-2014/14/index.md new file mode 100644 index 00000000..87eb2ffc --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/14/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/14 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/14/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/14/question.ts b/src/content/questions/comp2804/midterm-fall-2014/14/question.ts new file mode 100644 index 00000000..c557bbd0 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/14/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +You flip a fair coin 5 times. What is the probability that the first flip results in heads or the + fifth flip results in heads? +`; + +const label1 = String.raw`1/4`; +const label2 = String.raw`1/2`; +const label3 = String.raw`3/4`; +const label4 = String.raw`1`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/15/index.md b/src/content/questions/comp2804/midterm-fall-2014/15/index.md new file mode 100644 index 00000000..01329b0e --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/15/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/15 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/15/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/15/question.ts b/src/content/questions/comp2804/midterm-fall-2014/15/question.ts new file mode 100644 index 00000000..36f232d7 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/15/question.ts @@ -0,0 +1,26 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +You flip a fair coin 5 times. Define the events + [defs] + A = "the number of heads is odd" + [/defs] + and + [defs] + B = "the number of tails is even". + [/defs] + Which of the following is true? +`; + +const label1 = String.raw`$\Pr(A) = \Pr(B)$`; +const label2 = String.raw`$\Pr(A) < \Pr(B)$`; +const label3 = String.raw`$\Pr(A) > \Pr(B)$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/16/index.md b/src/content/questions/comp2804/midterm-fall-2014/16/index.md new file mode 100644 index 00000000..18cc92bb --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/16/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/16 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/16/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/16/question.ts b/src/content/questions/comp2804/midterm-fall-2014/16/question.ts new file mode 100644 index 00000000..fe2f79c8 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/16/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider 10 boxes and 10 balls. We throw each ball, uniformly, in a random box. What is the + probability that, after we have thrown all 10 balls, none of the 10 boxes is empty? +`; + +const label1 = String.raw`$\frac{10!}{10^{10}}$`; +const label2 = String.raw`$\frac{10^{10}}{10!}$`; +const label3 = String.raw`$1 - \frac{10 \cdot (9/10)^{10}}{10^{10}}$`; +const label4 = String.raw`None of the above.`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/17/index.md b/src/content/questions/comp2804/midterm-fall-2014/17/index.md new file mode 100644 index 00000000..1c316d9f --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/17/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/17 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/17/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/17/question.ts b/src/content/questions/comp2804/midterm-fall-2014/17/question.ts new file mode 100644 index 00000000..7360c19f --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/17/question.ts @@ -0,0 +1,22 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Assume you write a multiple-choice exam that consists of 100 questions. For each question, 4 options + are given, one of which is the correct one. If you answer each of the 100 questions by choosing an + answer uniformly at random, what is the probability that you have exactly one correct answer? +`; + +const label1 = String.raw`$\frac{100}{4^{100}}$`; +const label2 = String.raw`$\frac{3^{99}}{4^{100}}$`; +const label3 = String.raw`$\frac{100 + 3^{99}}{4^{100}}$`; +const label4 = String.raw`$\frac{100 \cdot 3^{99}}{4^{100}}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/2/index.md b/src/content/questions/comp2804/midterm-fall-2014/2/index.md new file mode 100644 index 00000000..e27dc2d0 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/2/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/2 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/2/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/2/question.ts b/src/content/questions/comp2804/midterm-fall-2014/2/question.ts new file mode 100644 index 00000000..3d5401d3 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/2/question.ts @@ -0,0 +1,20 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +How many bitstrings of length 99 are there that start with 1010 or end with 1010? +`; + +const label1 = String.raw`$2^{91}$`; +const label2 = String.raw`$2^{95} + 2^{95}$`; +const label3 = String.raw`$2^{96} - 2^{91}$`; +const label4 = String.raw`$2^{99} - 2^{96}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/3/index.md b/src/content/questions/comp2804/midterm-fall-2014/3/index.md new file mode 100644 index 00000000..71e76116 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/3/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/3 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/3/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/3/question.ts b/src/content/questions/comp2804/midterm-fall-2014/3/question.ts new file mode 100644 index 00000000..0250e685 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/3/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider 17 boys and 17 girls. How many ways are there to arrange them on a line if all boys are + standing next to each other and all girls are standing next to each other? +`; + +const label1 = String.raw`$17! + 17!$`; +const label2 = String.raw`$2(17! + 17!)$`; +const label3 = String.raw`$(17!)^2$`; +const label4 = String.raw`$2(17!)^2$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/4/index.md b/src/content/questions/comp2804/midterm-fall-2014/4/index.md new file mode 100644 index 00000000..f297c4cf --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/4/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/4 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/4/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/4/question.ts b/src/content/questions/comp2804/midterm-fall-2014/4/question.ts new file mode 100644 index 00000000..fbdad267 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/4/question.ts @@ -0,0 +1,34 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider 12 boys, 17 girls, and 25 dogs. How many ways are there to arrange them on a line if + +`; + +const label1 = String.raw`$12! + 17! + 25!$`; +const label2 = String.raw`$2(12! + 17! + 25!)$`; +const label3 = String.raw`$(12!)(17!)(25!)$`; +const label4 = String.raw`$2(12!)(17!)(25!)$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/5/index.md b/src/content/questions/comp2804/midterm-fall-2014/5/index.md new file mode 100644 index 00000000..8f0ccb07 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/5/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/5 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/5/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/5/question.ts b/src/content/questions/comp2804/midterm-fall-2014/5/question.ts new file mode 100644 index 00000000..69bd6e21 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/5/question.ts @@ -0,0 +1,17 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Is the following true or false? In any group of 900 people, there must be at least three people that + have the same birthday. +`; + +const label1 = String.raw`True`; +const label2 = String.raw`False`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/6/index.md b/src/content/questions/comp2804/midterm-fall-2014/6/index.md new file mode 100644 index 00000000..1c7ffa72 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/6/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/6 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/6/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/6/question.ts b/src/content/questions/comp2804/midterm-fall-2014/6/question.ts new file mode 100644 index 00000000..b491452d --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/6/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider a square with sides of length 3. Assume this square contains 10 points. Which of the + following is true? +`; + +const label1 = String.raw`At least two of these $n$ points are at distance at most $1$.`; +const label2 = String.raw`At least two of these $n$ points are at distance at most $\left. 1 \middle/ \sqrt{2} \right.$.`; +const label3 = String.raw`At least two of these $n$ points are at distance at most $\sqrt{2}$.`; +const label4 = String.raw`None of the above.`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/7/index.md b/src/content/questions/comp2804/midterm-fall-2014/7/index.md new file mode 100644 index 00000000..00362f03 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/7/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/7 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/7/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/7/question.ts b/src/content/questions/comp2804/midterm-fall-2014/7/question.ts new file mode 100644 index 00000000..9f653676 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/7/question.ts @@ -0,0 +1,20 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +What is the coefficient of $x^{20}y^{80}$ in the expansion of $(5x - 3y)^{100}$? +`; + +const label1 = "$-{100 \\choose 80} 5^{20}3^{80}$"; +const label2 = "${100 \\choose 80} 5^{20}3^{80}$"; +const label3 = "${100 \\choose 80} 5^{80}3^{20}$"; +const label4 = "${80 \\choose 100} 5^{20}3^{80}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/8/index.md b/src/content/questions/comp2804/midterm-fall-2014/8/index.md new file mode 100644 index 00000000..e7a84fa9 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/8/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/8 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/8/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/8/question.ts b/src/content/questions/comp2804/midterm-fall-2014/8/question.ts new file mode 100644 index 00000000..e5ac6284 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/8/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +How many solutions are there to the equation $x_1 + x_2 + x_3 + x_4 = 27$, where $x_1 \geq 0$, + $x_2 \geq 0$, $x_3 \geq 0$, and $x_4 \geq 0$ are integers? +`; + +const label1 = "${30 \\choose 3}$"; +const label2 = "${30 \\choose 4}$"; +const label3 = "${31 \\choose 3}$"; +const label4 = "${31 \\choose 4}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2014/9/index.md b/src/content/questions/comp2804/midterm-fall-2014/9/index.md new file mode 100644 index 00000000..eacdc5d9 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/9/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2014/9 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2014/9/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2014/9/question.ts b/src/content/questions/comp2804/midterm-fall-2014/9/question.ts new file mode 100644 index 00000000..639971c7 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2014/9/question.ts @@ -0,0 +1,36 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $m \geq 1$ and $n \geq 1$ be integers. Consider a rectangle whose horizontal side has length $m$ + and whose vertical side has length $n$. A path from the bottom-left corner to the top-right corner is + called valid, if in each step, it either goes one unit to the right or one unit upwards.
+ In the example below, you see a valid path for the case when $m = 5$ and $n = 3$. + + + + How many valid paths are there? +`; + +const label1 = "${m + n \\choose n - 1}$"; +const label2 = "${m + n \\choose n}$"; +const label3 = "$2^{m + n}$"; +const label4 = "$2^m + 2^n$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/1/index.md b/src/content/questions/comp2804/midterm-fall-2015/1/index.md new file mode 100644 index 00000000..f978fa0c --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/1/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/1 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/1/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/1/question.ts b/src/content/questions/comp2804/midterm-fall-2015/1/question.ts new file mode 100644 index 00000000..807c7418 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/1/question.ts @@ -0,0 +1,24 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +The Carleton Computer Science Society has a Board of Directors consisting of a President, two + Vice-Presidents, and a five-person Advisory Board. The President cannot be Vice-President and cannot be + on the Advisory Board. A Vice-President cannot be on the Advisory Board. Let $n$ be the number of + students in Carleton's Computer Science program, where $n \geq 8$. In how many ways can a Board of + Directors be chosen? +`; + +const label1 = String.raw`$n{n \choose 2}{n \choose 5}$`; +const label2 = String.raw`$(n-2){n\choose 2}{n-2 \choose 5}$`; +const label3 = String.raw`$(n-5){n \choose 2}{n-1 \choose 5}$`; +const label4 = String.raw`$(n-7){n \choose 2}{n-2 \choose 5}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/10/index.md b/src/content/questions/comp2804/midterm-fall-2015/10/index.md new file mode 100644 index 00000000..9dd7f56e --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/10/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/10 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/10/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/10/question.ts b/src/content/questions/comp2804/midterm-fall-2015/10/question.ts new file mode 100644 index 00000000..e16eb52b --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/10/question.ts @@ -0,0 +1,27 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +The function $f : \mathbb{N} \rightarrow \mathbb{N}$ is defined by + $$ + \begin{align} + f(0) &= 7 \\ + f(n) &= f(n - 1) + 10n - 6\; \ \mathrm{for}\ n \geq 1 + \end{align} + $$ + What is $f(n)$? +`; + +const label1 = String.raw`$f(n) = 4n^2 - 2n + 7$`; +const label2 = String.raw`$f(n) = 4n^2 - n + 7$`; +const label3 = String.raw`$f(n) = 5n^2 - 2n + 7$`; +const label4 = String.raw`$f(n) = 5n^2 - n + 7$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/11/index.md b/src/content/questions/comp2804/midterm-fall-2015/11/index.md new file mode 100644 index 00000000..c6f4ea0f --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/11/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/11 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/11/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/11/question.ts b/src/content/questions/comp2804/midterm-fall-2015/11/question.ts new file mode 100644 index 00000000..94d26837 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/11/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $S_n$ be the number of bitstrings of length $n$ that contain the substring 0000. Which of the + following is true? +`; + +const label1 = String.raw`$S_n = S_{n-1} + S_{n-2} + S_{n-3} + S_{n-4}$`; +const label2 = String.raw`$S_n = S_{n-1} + S_{n-2} + S_{n-3} + S_{n-4}\ +$ $ 2^{n-4}$`; +const label3 = String.raw`$S_n = S_{n-1} + S_{n-2} + S_{n-3}$`; +const label4 = String.raw`$S_n = S_{n-1} + S_{n-2} + S_{n-3} + 2^{n-3}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/12/index.md b/src/content/questions/comp2804/midterm-fall-2015/12/index.md new file mode 100644 index 00000000..bf7a34d5 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/12/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/12 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/12/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/12/question.ts b/src/content/questions/comp2804/midterm-fall-2015/12/question.ts new file mode 100644 index 00000000..e536c2cd --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/12/question.ts @@ -0,0 +1,44 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 1$ be an integer and let $S_n$ be the number of ways in which $n$ can be written as a + sum of 1s and 2s, such that + + For example, if $n = 7$, then both + $$ + 7 = 1 + 2 + 1 + 2 + 1 + $$ + and + $$ + 7 = 2 + 1 + 1 + 2 + 1 + $$ + are allowed, whereas + $$ + 7 = 1 + 2 + 2 + 1 + 1 + $$ + is not allowed.
+ + Which of the following is true? +`; + +const label1 = String.raw`$S_n = S_{n-1} + S_{n-2}$`; +const label2 = String.raw`$S_n = S_{n-1} + S_{n-3}$`; +const label3 = String.raw`$S_n = S_{n-2} + S_{n-3}$`; +const label4 = String.raw`$S_n = S_{n-1} + S_{n-2} + S_{n-3}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/13/index.md b/src/content/questions/comp2804/midterm-fall-2015/13/index.md new file mode 100644 index 00000000..46dd368d --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/13/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/13 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/13/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/13/question.ts b/src/content/questions/comp2804/midterm-fall-2015/13/question.ts new file mode 100644 index 00000000..2db0eda6 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/13/question.ts @@ -0,0 +1,36 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` + + + Consider the following recursive algorithm $\Fib$, which takes as input an + integer $n \geq 0$: + +

+ $\mathbf{Algorithm}\ \Fib(n)\mathrm{:}$
+ $\mathbf{if}\ n = 0\ \mathrm{or}\ n = 1$
+ $\mathbf{then}\ f = n$
+ $\mathbf{else}\ f = \Fib(n - 1) + \Fib(n - 2)$
+ $\mathbf{endif};$
+ $\mathbf{return}\ f$
+

+ + When running $\Fib(55)$, how many calls are there to $\Fib(50)$? +`; + +const label1 = String.raw`6`; +const label2 = String.raw`7`; +const label3 = String.raw`8`; +const label4 = String.raw`9`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/14/index.md b/src/content/questions/comp2804/midterm-fall-2015/14/index.md new file mode 100644 index 00000000..b9b4b625 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/14/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/14 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/14/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/14/question.ts b/src/content/questions/comp2804/midterm-fall-2015/14/question.ts new file mode 100644 index 00000000..62d50f6a --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/14/question.ts @@ -0,0 +1,64 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` + + + Consider the following recursive algorithm $\JustinBieber$, which takes as input an integer $n \geq 1$, + which is a power of 2: + + (see document for missing code) + + For $n$ a power of 2, let $B(n)$ be the number of times you print "I don't like Justin Bieber" when + running algorithm $\JustinBieber(n)$. Which of the following is true?
+ (n.b., $\log$ denotes the base-2 logarithm) +`; + +//
+// $\mathbf{Algorithm}\ \JustinBieber(n)\mathrm{:}$
+// $\mathbf{if}\ n = 1$
+// $\mathbf{then}\ \text{order chicken wings}$
+// $\mathbf{else}\ \mathbf{if}\ n = 2$ +// +// +// +// +// +// +// +//
$\elsesp \mathbf{then}$ +// $\text{drink one pint of}$ $\text{India Pale Ale}$ +//
+// +// +// +// +// +// +// +//
+// $\elsesp \mathbf{else}\ \mathrm{print}\ \text{``}$ +// +// $\text{I don't like}$ $\text{Justin Bieber''};$ +//
+// $\elsesp \elsesp \JustinBieber(n / 2)$
+// $\elsesp \mathbf{endif}$
+// $\mathbf{endif}$ +//
+ +const label1 = String.raw`$B(n) = \log n - 1\ \text{for all}\ n \geq 2.$`; +const label2 = String.raw`$B(n) = \log n - 1\ \text{for all}\ n \geq 1.$`; +const label3 = String.raw`$B(n) = \log n\ \text{for all}\ n \geq 2.$`; +const label4 = String.raw`$B(n) = n - 2\ \text{for all}\ n \geq 2.$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/15/index.md b/src/content/questions/comp2804/midterm-fall-2015/15/index.md new file mode 100644 index 00000000..63e82cd1 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/15/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/15 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/15/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/15/question.ts b/src/content/questions/comp2804/midterm-fall-2015/15/question.ts new file mode 100644 index 00000000..2d6d83e2 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/15/question.ts @@ -0,0 +1,24 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +You flip a fair coin 7 times. Define the event + [defs] + A = "the result of the first flip is equal to the result of the 7-th flip". + [/defs] + What is $\Pr(A)$? +`; + +const label1 = String.raw`$\frac{2^5 + 2}{2^7}$`; +const label2 = String.raw`$1/2$`; +const label3 = String.raw`$1/3$`; +const label4 = String.raw`$1/4$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/16/index.md b/src/content/questions/comp2804/midterm-fall-2015/16/index.md new file mode 100644 index 00000000..2c729a3d --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/16/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/16 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/16/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/16/question.ts b/src/content/questions/comp2804/midterm-fall-2015/16/question.ts new file mode 100644 index 00000000..5cef7f65 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/16/question.ts @@ -0,0 +1,28 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +You roll a fair 6-sided die twice. Define the events + [defs] + A = "the sum of the results of the two rolls is 7" + [/defs] + and + [defs] + B = "the result of the first roll is 3". + [/defs] + Which of the following is true? +`; + +const label1 = String.raw`$\Pr(A) = \Pr(B)$`; +const label2 = String.raw`$\Pr(A) < \Pr(B)$`; +const label3 = String.raw`$\Pr(A) > \Pr(B)$`; +const label4 = String.raw`None of the above.`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/17/index.md b/src/content/questions/comp2804/midterm-fall-2015/17/index.md new file mode 100644 index 00000000..9130e0e2 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/17/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/17 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/17/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/17/question.ts b/src/content/questions/comp2804/midterm-fall-2015/17/question.ts new file mode 100644 index 00000000..fe6393ac --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/17/question.ts @@ -0,0 +1,26 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $S = \{1,2,3,4,5,6,7\}$. You choose a uniformly random 3-element subset $X$ of $S$. Thus, + each 3-element subset of $S$ has a probability of $\left. 1 \middle/ {7 \choose 3} \right.$ of being $X$. + Define the event + [defs] + A = "4 is an element of $X$". + [/defs] + What is $\Pr(A)$? +`; + +const label1 = String.raw`7/15`; +const label2 = String.raw`15/7`; +const label3 = String.raw`3/7`; +const label4 = String.raw`7/3`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/2/index.md b/src/content/questions/comp2804/midterm-fall-2015/2/index.md new file mode 100644 index 00000000..bd0b75ea --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/2/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/2 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/2/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/2/question.ts b/src/content/questions/comp2804/midterm-fall-2015/2/question.ts new file mode 100644 index 00000000..26b877b5 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/2/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $S$ be a set of 25 elements and let $x$, $y$, and $z$ be three distinct elements of $S$. What is + the number of subsets of $S$ that contain both $x$ and $y$, but do not contain $z$? +`; + +const label1 = String.raw`$2^{25} - 2^{22}$`; +const label2 = String.raw`$2^{25} - 2^{24} + 2^{23}$`; +const label3 = String.raw`$2^{22}$`; +const label4 = String.raw`$2^{23}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/3/index.md b/src/content/questions/comp2804/midterm-fall-2015/3/index.md new file mode 100644 index 00000000..6f6a8391 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/3/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/3 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/3/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/3/question.ts b/src/content/questions/comp2804/midterm-fall-2015/3/question.ts new file mode 100644 index 00000000..db5ac2de --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/3/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $A$ be a set of 6 elements and let $B$ be a set of 13 elements. How many one-to-one (i.e., + injective) functions $f : A \rightarrow B$ are there? +`; + +const label1 = String.raw`$5 \cdot 6 \cdot 7 \cdot 8 \cdot 9 \cdot 10 \cdot 11 \cdot 12 \cdot 13$`; +const label2 = String.raw`$6 \cdot 7 \cdot 8 \cdot 9 \cdot 10 \cdot 11 \cdot 12 \cdot 13$`; +const label3 = String.raw`$7 \cdot 8 \cdot 9 \cdot 10 \cdot 11 \cdot 12 \cdot 13$`; +const label4 = String.raw`$8 \cdot 9 \cdot 10 \cdot 11 \cdot 12 \cdot 13$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/4/index.md b/src/content/questions/comp2804/midterm-fall-2015/4/index.md new file mode 100644 index 00000000..62cdbfcc --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/4/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/4 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/4/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/4/question.ts b/src/content/questions/comp2804/midterm-fall-2015/4/question.ts new file mode 100644 index 00000000..b5939398 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/4/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +For any integer $n \geq 2$, let $S_n$ be the number of bitstrings of length $n$ in which the first + bit is not equal to the last bit. Which of the following is true? +`; + +const label1 = String.raw`$S_n = 2^{n-2}$`; +const label2 = String.raw`$S_n = 2^{n-1}$`; +const label3 = String.raw`$S_n = 2^{n} - 2^{n-2}$`; +const label4 = String.raw`$S_n = 2^{n} - 2^{n-1} + 2^{n-2}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/5/index.md b/src/content/questions/comp2804/midterm-fall-2015/5/index.md new file mode 100644 index 00000000..4d4745d8 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/5/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/5 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/5/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/5/question.ts b/src/content/questions/comp2804/midterm-fall-2015/5/question.ts new file mode 100644 index 00000000..a8769da0 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/5/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider strings of length 99 consisting of the characters $a$, $b$, and $c$. How many such strings + are there that start with $abc$ or end with $bbb$? +`; + +const label1 = String.raw`$3^{96} + 3^{96}$`; +const label2 = String.raw`$3^{99} - 2 \cdot 3^{96}$`; +const label3 = String.raw`$2 \cdot 3^{96} - 3^{93}$`; +const label4 = String.raw`None of the above.`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/6/index.md b/src/content/questions/comp2804/midterm-fall-2015/6/index.md new file mode 100644 index 00000000..633c9dd9 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/6/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/6 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/6/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/6/question.ts b/src/content/questions/comp2804/midterm-fall-2015/6/question.ts new file mode 100644 index 00000000..8b3ec6e8 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/6/question.ts @@ -0,0 +1,24 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +What does + $$ + \sum_{k=1}^{m} {m \choose k} + $$ + count? +`; + +const label1 = String.raw`The number of non-empty subsets of a set of size $m$.`; +const label2 = String.raw`The number of subsets of a set of size $m$.`; +const label3 = String.raw`The number of bitstrings of length $m$ having exactly $k$ many 1s.`; +const label4 = String.raw`None of the above.`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/7/index.md b/src/content/questions/comp2804/midterm-fall-2015/7/index.md new file mode 100644 index 00000000..873fff56 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/7/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/7 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/7/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/7/question.ts b/src/content/questions/comp2804/midterm-fall-2015/7/question.ts new file mode 100644 index 00000000..6f1e8a67 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/7/question.ts @@ -0,0 +1,26 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` + + + In the city of $\ShortLastName$, every person has a last name consisting of two characters, the first one being + an uppercase letter and the second one being a lowercase letter. What is the minimum number of people + needed so that we can guarantee that at least 4 of them have the same last name? +`; + +const label1 = String.raw`$3 \cdot 26^{2}$`; +const label2 = String.raw`$4 \cdot 26^{2}$`; +const label3 = String.raw`$3 \cdot 26^{2} + 1$`; +const label4 = String.raw`$4 \cdot 26^{2} + 1$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/8/index.md b/src/content/questions/comp2804/midterm-fall-2015/8/index.md new file mode 100644 index 00000000..64b1c802 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/8/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/8 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/8/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/8/question.ts b/src/content/questions/comp2804/midterm-fall-2015/8/question.ts new file mode 100644 index 00000000..7f07fa5f --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/8/question.ts @@ -0,0 +1,20 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +What is the coefficient of $x^{81}y^{7}$ in the expansion of $(3x-17y)^{88}$? +`; + +const label1 = "${88 \\choose 7} \\cdot 3^{81} \\cdot 17^7$"; +const label2 = "$- {88 \\choose 7} \\cdot 3^{81} \\cdot 17^7$"; +const label3 = "${88 \\choose 7} \\cdot 3^7 \\cdot 17^{81}$"; +const label4 = "$- {88 \\choose 7} \\cdot 3^7 \\cdot 17^{81}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2015/9/index.md b/src/content/questions/comp2804/midterm-fall-2015/9/index.md new file mode 100644 index 00000000..89adb26e --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/9/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2015/9 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2015/9/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2015/9/question.ts b/src/content/questions/comp2804/midterm-fall-2015/9/question.ts new file mode 100644 index 00000000..4233262e --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2015/9/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +How many solutions are there to the equation $x_1 + x_2 + x_3 + x_4 = 55$, + where $x_1 \geq 0$, $x_2 \geq 0$, $x_3 \geq 0$, and $x_4 \geq 0$ are integers? +`; + +const label1 = "${58 \\choose 3}$"; +const label2 = "${58 \\choose 4}$"; +const label3 = "${59 \\choose 3}$"; +const label4 = "${59 \\choose 4}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/1/index.md b/src/content/questions/comp2804/midterm-fall-2016/1/index.md new file mode 100644 index 00000000..0c892a89 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/1/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/1 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/1/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/1/question.ts b/src/content/questions/comp2804/midterm-fall-2016/1/question.ts new file mode 100644 index 00000000..dfefdfbc --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/1/question.ts @@ -0,0 +1,24 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Carleton's Computer Science program has $f$ female students and $m$ male students, where + $f \geq 1$ and $f + m \geq 4$. The Carleton Computer Science Society has a Board of Directors + consisting of a President and three Vice-Presidents, all of whom are Computer Science students. + The President is female and cannot be a Vice-President. In how many ways can a Board of Directors + be chosen? +`; + +const label1 = "${f + m \\choose 4}$"; +const label2 = "$f \\cdot {f + m - 1 \\choose 3}$"; +const label3 = "$f \\cdot {f + m \\choose 3}$"; +const label4 = "$(f - 1) \\cdot {f + m \\choose 3}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/10/index.md b/src/content/questions/comp2804/midterm-fall-2016/10/index.md new file mode 100644 index 00000000..6a2417ae --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/10/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/10 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/10/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/10/question.ts b/src/content/questions/comp2804/midterm-fall-2016/10/question.ts new file mode 100644 index 00000000..e48a0e7a --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/10/question.ts @@ -0,0 +1,27 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +The function $f : \mathbb{N} \rightarrow \mathbb{R}$ is defined by + $$ + \begin{align} + f(0) &= 7, \\ + f(n) &= \frac{n}{3} \cdot f(n - 1)\; \ \mathrm{for}\ n \geq 1. + \end{align} + $$ + What is $f(n)$? +`; + +const label1 = String.raw`$f(n) = 7 \cdot \frac{n!}{3^n}$`; +const label2 = String.raw`$f(n) = 7^n \cdot \frac{n!}{3^n}$`; +const label3 = String.raw`$f(n) = 7 \cdot \frac{(n + 1)!}{3^n}$`; +const label4 = String.raw`$f(n) = 7^n \cdot \frac{(n + 1)!}{3^n}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/11/index.md b/src/content/questions/comp2804/midterm-fall-2016/11/index.md new file mode 100644 index 00000000..a3ac08d3 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/11/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/11 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/11/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/11/question.ts b/src/content/questions/comp2804/midterm-fall-2016/11/question.ts new file mode 100644 index 00000000..de929791 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/11/question.ts @@ -0,0 +1,22 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +For any integer $n \geq 1$, let $B_n$ be the number of bitstrings of length $n$ that do not + contain the substring 11 and do not contain the substring 101. Which of the following is true + for any $n \geq 4$? +`; + +const label1 = String.raw`$B_n = B_{n - 1} + B_{n - 2}$`; +const label2 = String.raw`$B_n = B_{n - 1} + B_{n - 3}$`; +const label3 = String.raw`$B_n = B_{n - 2} + B_{n - 3}$`; +const label4 = String.raw`$B_n = B_{n - 2} + B_{n - 4}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/12/index.md b/src/content/questions/comp2804/midterm-fall-2016/12/index.md new file mode 100644 index 00000000..529c67c1 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/12/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/12 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/12/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/12/question.ts b/src/content/questions/comp2804/midterm-fall-2016/12/question.ts new file mode 100644 index 00000000..c6cb1dc2 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/12/question.ts @@ -0,0 +1,37 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 1$ be an integer, and let $S_n$ be the number of ways in which $n$ can be written + as a sum of 3s and 4s, such that the order in which the 3s and 4s occur in the sum matters. + For example, $S_5 = 0$, because 5 cannot be written as a sum of 3s and 4s. + We have $S_{11} = 3$, because + + + + + + + + +
$11$ + $= 3 + 4 + 4 = 4 + 3 + 4$ + $= 4 + 4 + 3.$ +
+ + Which of the following is true for any $n \geq 5$? +`; + +const label1 = String.raw`$S_n = 2 \cdot S_{n - 1}$`; +const label2 = String.raw`$S_n = S_{n - 1} + S_{n - 2}$`; +const label3 = String.raw`$S_n = S_{n - 2} + S_{n - 3}$`; +const label4 = String.raw`$S_n = S_{n - 3} + S_{n - 4}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/13/index.md b/src/content/questions/comp2804/midterm-fall-2016/13/index.md new file mode 100644 index 00000000..14da14b4 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/13/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/13 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/13/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/13/question.ts b/src/content/questions/comp2804/midterm-fall-2016/13/question.ts new file mode 100644 index 00000000..2113293a --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/13/question.ts @@ -0,0 +1,36 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` + + + Consider the following recursive algorithm $\Fib$, which takes as input an + integer $n \geq 0$: + +

+ $\mathbf{Algorithm}\ \Fib(n)\mathrm{:}$
+ $\mathbf{if}\ n = 0\ \mathrm{or}\ n = 1$
+ $\mathbf{then}\ f = n$
+ $\mathbf{else}\ f = \Fib(n - 1) + \Fib(n - 2)$
+ $\mathbf{endif};$
+ $\mathbf{return}\ f$
+

+ + When running $\Fib(12)$, how many calls are there to $\Fib(8)$? +`; + +const label1 = String.raw`4`; +const label2 = String.raw`5`; +const label3 = String.raw`6`; +const label4 = String.raw`7`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/14/index.md b/src/content/questions/comp2804/midterm-fall-2016/14/index.md new file mode 100644 index 00000000..1d56f0c7 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/14/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/14 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/14/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/14/question.ts b/src/content/questions/comp2804/midterm-fall-2016/14/question.ts new file mode 100644 index 00000000..3c1295fc --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/14/question.ts @@ -0,0 +1,40 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` + + + Consider the following recursive algorithm $\ElisaDrinksCider$, which takes as input an integer + $n \geq 1$, which is a power of 2: + +

+ $\mathbf{Algorithm}\ \ElisaDrinksCider(n)\mathrm{:}$
+ $\mathbf{if}\ n = 1$
+ $\mathbf{then}\ \text{order Fibonachos}$
+ $\mathbf{else}\ \ElisaDrinksCider(n / 2);$
+ $\elsesp \text{drink \(n\) bottles of cider};$
+ $\elsesp \ElisaDrinksCider(n / 2)$
+ $\mathbf{endif}$ +

+ + For $n$ a power of 2, let $C(n)$ be the total number of bottles of cider that you drink when running algorithm + $\ElisaDrinksCider(n)$. Which of the following is true for any $n \geq 1$ that is a power of 2?
+ (n.b., $\log$ denotes the base-2 logarithm) +`; + +const label1 = String.raw`$C(n) = n \log n - 1$`; +const label2 = String.raw`$C(n) = n \log n + 1$`; +const label3 = String.raw`$C(n) = n \log n$`; +const label4 = String.raw`$C(n) = 2n \log n$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/15/index.md b/src/content/questions/comp2804/midterm-fall-2016/15/index.md new file mode 100644 index 00000000..5d034c91 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/15/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/15 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/15/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/15/question.ts b/src/content/questions/comp2804/midterm-fall-2016/15/question.ts new file mode 100644 index 00000000..7e89663d --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/15/question.ts @@ -0,0 +1,25 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +You flip a fair coin 9 times. Define the event + [defs] + A = "the result of the first flip is not equal to the result of the second flip". + [/defs] + + What is $\Pr(A)$? +`; + +const label1 = String.raw`1/4`; +const label2 = String.raw`1/3`; +const label3 = String.raw`1/2`; +const label4 = String.raw`1`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/16/index.md b/src/content/questions/comp2804/midterm-fall-2016/16/index.md new file mode 100644 index 00000000..65090c00 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/16/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/16 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/16/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/16/question.ts b/src/content/questions/comp2804/midterm-fall-2016/16/question.ts new file mode 100644 index 00000000..70f99845 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/16/question.ts @@ -0,0 +1,28 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider 4 people, each of which has a uniformly random birthday. We ignore leap years; thus, one year + has 365 days. Define the event + + [defs] + A = "at least 2 of these 4 people have the same birthday". + [/defs] + + What is $\Pr(A)$? +`; + +const label1 = "${4 \\choose 2} \\cdot \\frac{1}{365}$"; +const label2 = + "${4 \\choose 2} \\cdot \\frac{1}{365} + {4 \\choose 3} \\cdot \\frac{1}{365^2} + {4 \\choose 4} \\cdot \\frac{1}{365^3}$"; +const label3 = "$1 - \\frac{361 \\cdot 362 \\cdot 363 \\cdot 364}{365^4}$"; +const label4 = "$1 - \\frac{362 \\cdot 363 \\cdot 364}{365^3}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/17/index.md b/src/content/questions/comp2804/midterm-fall-2016/17/index.md new file mode 100644 index 00000000..f319f141 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/17/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/17 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/17/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/17/question.ts b/src/content/questions/comp2804/midterm-fall-2016/17/question.ts new file mode 100644 index 00000000..15e4388c --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/17/question.ts @@ -0,0 +1,29 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +In the game of Hearthstone, you are given a deck of 18 distinct cards. One of the cards is the Raven Idol. + You choose a uniformly random hand of 3 cards. Define the event + + (see document for missing code) + + What is $\Pr(A)$? +`; + +// [defs] +// A = $\text{``}$the hand of 3 cards contains the Raven Idol$\,\text{''}.$ +// [/defs] + +const label1 = String.raw`3/17`; +const label2 = String.raw`3/18`; +const label3 = String.raw`3/19`; +const label4 = String.raw`4/19`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/2/index.md b/src/content/questions/comp2804/midterm-fall-2016/2/index.md new file mode 100644 index 00000000..fab454a8 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/2/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/2 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/2/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/2/question.ts b/src/content/questions/comp2804/midterm-fall-2016/2/question.ts new file mode 100644 index 00000000..152c6a7f --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/2/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $k$ and $n$ be integers with $2 \leq k \leq n$ and consider the set $S = \{1,2,\dots,n\}$. + What is the number of $k$-element subsets of $S$ that do not contain 1 and do not contain 2? +`; + +const label1 = "${n - 1 \\choose k - 1}$"; +const label2 = "${n - 1 \\choose k}$"; +const label3 = "${n - 2 \\choose k - 2}$"; +const label4 = "${n - 2 \\choose k}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/3/index.md b/src/content/questions/comp2804/midterm-fall-2016/3/index.md new file mode 100644 index 00000000..f7899b94 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/3/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/3 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/3/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/3/question.ts b/src/content/questions/comp2804/midterm-fall-2016/3/question.ts new file mode 100644 index 00000000..87f3c96b --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/3/question.ts @@ -0,0 +1,22 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $k$ and $n$ be integers with $2 \leq k \leq n$ and consider the set $S = \{1,2,\dots,n\}$. + What is the number of $k$-element subsets of $S$ that do not contain 1 or do not contain 2? +`; + +const label1 = "${n - 1 \\choose k} + {n - 1 \\choose k}$"; +const label2 = "${n - 2 \\choose k}$"; +const label3 = "${n \\choose k} - {n - 2 \\choose k - 2}$"; +const label4 = + "${n \\choose k} - {n - 1 \\choose k - 1} - {n - 1 \\choose k - 1}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/4/index.md b/src/content/questions/comp2804/midterm-fall-2016/4/index.md new file mode 100644 index 00000000..1444dea4 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/4/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/4 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/4/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/4/question.ts b/src/content/questions/comp2804/midterm-fall-2016/4/question.ts new file mode 100644 index 00000000..683da233 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/4/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +For any integer $n \geq 3$, let $B_n$ be the number of bitstrings of length $n$ in which the first + three bits are not all equal. Which of the following is true? +`; + +const label1 = String.raw`$B_n = 2 \cdot 2^{n - 3}$`; +const label2 = String.raw`$B_n = 6 \cdot 2^{n - 3}$`; +const label3 = String.raw`$B_n = 2^n - 2$`; +const label4 = String.raw`$B_n = 2^n - 6$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/5/index.md b/src/content/questions/comp2804/midterm-fall-2016/5/index.md new file mode 100644 index 00000000..17cb1f4d --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/5/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/5 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/5/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/5/question.ts b/src/content/questions/comp2804/midterm-fall-2016/5/question.ts new file mode 100644 index 00000000..197ef75d --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/5/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider strings of length 4 consisting of the characters $a$, $b$, $c$, and $d$. + How many such strings are there that start with $ad$ or end with $dcb$? +`; + +const label1 = String.raw`17`; +const label2 = String.raw`18`; +const label3 = String.raw`19`; +const label4 = String.raw`20`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/6/index.md b/src/content/questions/comp2804/midterm-fall-2016/6/index.md new file mode 100644 index 00000000..bbe1a853 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/6/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/6 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/6/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/6/question.ts b/src/content/questions/comp2804/midterm-fall-2016/6/question.ts new file mode 100644 index 00000000..a44ab960 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/6/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 5$ and consider strings of length $n$ consisting of the characters $a$, $b$, $c$, and $d$. + How many such strings are there that start with $ad$ or end with $dcb$? +`; + +const label1 = String.raw`$4^{n - 2} + 4^{n - 3} - 4^{n - 5}$`; +const label2 = String.raw`$4^{n - 2} + 4^{n - 3}$`; +const label3 = String.raw`$4^n - 4^{n - 5}$`; +const label4 = String.raw`$4^n - 4^{n - 2} - 4^{n - 3}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/7/index.md b/src/content/questions/comp2804/midterm-fall-2016/7/index.md new file mode 100644 index 00000000..c32fe240 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/7/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/7 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/7/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/7/question.ts b/src/content/questions/comp2804/midterm-fall-2016/7/question.ts new file mode 100644 index 00000000..44ee1cca --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/7/question.ts @@ -0,0 +1,28 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +What does + $$ + {w \choose 3} \cdot {m \choose 2} + {w \choose 4} \cdot m + {w \choose 5} + $$ + count? +`; + +const label1 = String.raw`The number of ways to choose 5 people out of a group consisting of $w$ women and $m$ men, + where at most 3 women can be chosen.`; +const label2 = String.raw`The number of ways to choose 5 people out of a group consisting of $w$ women and $m$ men, + where at most 3 men can be chosen.`; +const label3 = String.raw`The number of ways to choose 5 people out of a group consisting of $w$ women and $m$ men, + where at least 3 women must be chosen.`; +const label4 = String.raw`The number of ways to choose 5 people out of a group consisting of $w$ women and $m$ men, + where at least 3 men must be chosen.`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/8/index.md b/src/content/questions/comp2804/midterm-fall-2016/8/index.md new file mode 100644 index 00000000..0ecd8efe --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/8/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/8 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/8/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/8/question.ts b/src/content/questions/comp2804/midterm-fall-2016/8/question.ts new file mode 100644 index 00000000..d7190a3d --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/8/question.ts @@ -0,0 +1,22 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 2$ be an integer and let $S$ be a set of $m$ integers. What is the minimum value + of $m$ such that we can guarantee that $S$ contains at least two elements whose difference + is divisible by $n$? +`; + +const label1 = String.raw`$n - 1$`; +const label2 = String.raw`$n$`; +const label3 = String.raw`$n + 1$`; +const label4 = String.raw`$n + 2$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2016/9/index.md b/src/content/questions/comp2804/midterm-fall-2016/9/index.md new file mode 100644 index 00000000..ab81ed24 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/9/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2016/9 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2016/9/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2016/9/question.ts b/src/content/questions/comp2804/midterm-fall-2016/9/question.ts new file mode 100644 index 00000000..8148486d --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2016/9/question.ts @@ -0,0 +1,20 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +What is the coefficient of $x^{24}y^{26}$ in the expansion of $(5x - 7y)^{50}$? +`; + +const label1 = "$- {50 \\choose 24} \\cdot 5^{26} \\cdot 7^{24}$"; +const label2 = "$- {50 \\choose 26} \\cdot 5^{24} \\cdot 7^{26}$"; +const label3 = "${50 \\choose 24} \\cdot 5^{26} \\cdot 7^{24}$"; +const label4 = "${50 \\choose 26} \\cdot 5^{24} \\cdot 7^{26}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/1/index.md b/src/content/questions/comp2804/midterm-fall-2017/1/index.md new file mode 100644 index 00000000..45e499f3 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/1/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/1 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/1/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/1/question.ts b/src/content/questions/comp2804/midterm-fall-2017/1/question.ts new file mode 100644 index 00000000..a5d7841f --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/1/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 8$ be an even integer and let $S = \{1,2,3,\dots,n\}$. Consider 7-element subsets of $S$ + that consist of 4 even numbers and 3 odd numbers. How many such subsets are there? +`; + +const label1 = "${n/2 \\choose 4} \\cdot {n/2 \\choose 3}$"; +const label2 = "${n \\choose 4} \\cdot {n \\choose 3}$"; +const label3 = "${n/2 \\choose 4} + {n/2 \\choose 3}$"; +const label4 = "${n \\choose 4} + {n \\choose 3}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/10/index.md b/src/content/questions/comp2804/midterm-fall-2017/10/index.md new file mode 100644 index 00000000..c0f6375f --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/10/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/10 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/10/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/10/question.ts b/src/content/questions/comp2804/midterm-fall-2017/10/question.ts new file mode 100644 index 00000000..d3eec085 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/10/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +A bitstring is called 01-free if it does not contain 01. + Let $n \geq 2$ be an integer. How many 01-free bitstrings of length $n$ are there? +`; + +const label1 = String.raw`$n-1$`; +const label2 = String.raw`$n$`; +const label3 = String.raw`$n+1$`; +const label4 = String.raw`$n+2$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/11/index.md b/src/content/questions/comp2804/midterm-fall-2017/11/index.md new file mode 100644 index 00000000..81c44bcd --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/11/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/11 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/11/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/11/question.ts b/src/content/questions/comp2804/midterm-fall-2017/11/question.ts new file mode 100644 index 00000000..644655d5 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/11/question.ts @@ -0,0 +1,25 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +A bitstring is called 00-free if it does not contain two 0's next to each other. + In class, we have seen that for any $m \geq 1$, the number of 00-free + bitstrings of length $m$ is equal to the $(m + 2)$-th Fibonacci number $f_{m+2}$.
+ + What is the number of 00-free bitstrings of length 20 that have 0 at position 7? + (The positions are numbered $1,2,\dots,20$.) +`; + +const label1 = String.raw`$f_{7} \cdot f_{15}$`; +const label2 = String.raw`$f_{8} \cdot f_{14}$`; +const label3 = String.raw`$f_{8} \cdot f_{15}$`; +const label4 = String.raw`$f_{7} \cdot f_{14}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/12/index.md b/src/content/questions/comp2804/midterm-fall-2017/12/index.md new file mode 100644 index 00000000..bf0cfbec --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/12/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/12 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/12/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/12/question.ts b/src/content/questions/comp2804/midterm-fall-2017/12/question.ts new file mode 100644 index 00000000..4ac79240 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/12/question.ts @@ -0,0 +1,47 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +The functions $f : \mathbb{N}^2 \rightarrow \mathbb{N}$ and $g : \mathbb{N} \rightarrow \mathbb{N}$ + are recursively defined as follows: + + + + + + + + + + + + + + + + + + + + + + + +
$f(m, 0)$$= m\ \;$$\mathrm{if}\ m \geq 0,$
$f(m, n)$$= 1 + f(m, n - 1)\ \;$$\mathrm{if}\ m \geq 0$ $\mathrm{and}\ n \geq 1,$
$g(0)$$= 1,$
$g(n)$$= 5 \cdot g(n - 1)\ \;$$\mathrm{if}\ n \geq 1.$
+ + For any integer $n \geq 0$, what is $f(g(n), g(n))$? +`; + +const label1 = String.raw`$2 \cdot 5^{n}$`; +const label2 = String.raw`$2 \cdot 5^{n-1}$`; +const label3 = String.raw`$(5^{n})^{2}$`; +const label4 = String.raw`$(5^{n-1})^{2}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/13/index.md b/src/content/questions/comp2804/midterm-fall-2017/13/index.md new file mode 100644 index 00000000..6d0110cf --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/13/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/13 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/13/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/13/question.ts b/src/content/questions/comp2804/midterm-fall-2017/13/question.ts new file mode 100644 index 00000000..e3dd76aa --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/13/question.ts @@ -0,0 +1,23 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider strings of characters, where each character is $a$, $b$, or $c$. Such a string is called ccc-free + if it does not contain ccc.
+ + For any integer $n \geq 4$, let $B_n$ be the number of ccc-free strings of length $n$. Which of the following is true? +`; + +const label1 = String.raw`$B_n = B_{n-1} + B_{n-2} + B_{n-3}$`; +const label2 = String.raw`$B_n = 2 \cdot B_{n-1} + 2 \cdot B_{n-2} + 2 \cdot B_{n-3}$`; +const label3 = String.raw`$B_n = 2 \cdot B_{n-1} + 2 \cdot B_{n-2} + B_{n-3}$`; +const label4 = String.raw`$B_n = B_{n-1} + B_{n-2} + 2 \cdot B_{n-3}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/14/index.md b/src/content/questions/comp2804/midterm-fall-2017/14/index.md new file mode 100644 index 00000000..cfd99f14 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/14/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/14 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/14/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/14/question.ts b/src/content/questions/comp2804/midterm-fall-2017/14/question.ts new file mode 100644 index 00000000..d39a6bed --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/14/question.ts @@ -0,0 +1,44 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 1$ be an integer and consider a $2 \times n$ board $B_n$ consisting of a total of $2n$ square cells. + The top part of the figure below shows $B_{13}$. + + + + A brick is a horizontal or vertical board consisting of 2 square cells; see the bottom part of the figure + above. A tiling of the board $B_n$ is a placement of bricks on the board such that + + The figure below shows a tiling of $B_{13}$. + + + + Let $T_n$ be the number of different tilings of the board $B_n$. Which of the following is true for any $n \geq 3$? +`; + +const label1 = String.raw`$T_n = T_{n + 1} + T_{n + 2}$`; +const label2 = String.raw`$T_n = T_{n - 1} + T_{n - 2}$`; +const label3 = String.raw`$T_n = 2 \cdot T_{n - 1} + T_{n - 2}$`; +const label4 = String.raw`$T_n = T_{n - 1} + 2 \cdot T_{n - 2}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/15/index.md b/src/content/questions/comp2804/midterm-fall-2017/15/index.md new file mode 100644 index 00000000..bd4c9953 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/15/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/15 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/15/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/15/question.ts b/src/content/questions/comp2804/midterm-fall-2017/15/question.ts new file mode 100644 index 00000000..2ae874c9 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/15/question.ts @@ -0,0 +1,39 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` + + + Consider the recursive algorithm $\Hello$, which takes as input an integer $n \geq 0$: + + (see document for missing code) + + If you run algorithm $\Hello(5)$, how many times is the word "hello" printed? +`; + +//

+// $\mathbf{Algorithm}\ \Hello(n)\mathrm{:}$
+// $\mathbf{if}\ n = 0\ \mathrm{or}\ n = 1$
+// $\mathbf{then}\ \text{print ``hello''}$
+// $\mathbf{else}\ \Hello(n - 1);$
+// $\elsesp \text{print ``hello''};$
+// $\elsesp \Hello(n - 2)$
+// $\mathbf{endif}$ +//

+ +const label1 = String.raw`13`; +const label2 = String.raw`14`; +const label3 = String.raw`15`; +const label4 = String.raw`16`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/16/index.md b/src/content/questions/comp2804/midterm-fall-2017/16/index.md new file mode 100644 index 00000000..d875fd57 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/16/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/16 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/16/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/16/question.ts b/src/content/questions/comp2804/midterm-fall-2017/16/question.ts new file mode 100644 index 00000000..e7cab3dd --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/16/question.ts @@ -0,0 +1,25 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $X = \{1,2,...,20\}$. You choose a uniformly random 7-element subset $Y$ of $X$. Define the + event + [defs] + A = "3 is an element of $Y$ or 13 is an element of $Y$". + [/defs] + What is $\Pr(A)$? +`; + +const label1 = String.raw`$\frac{{19 \choose 6} + {19 \choose 6}}{{20 \choose 7}}$`; +const label2 = String.raw`$\frac{2 \cdot {20 \choose 6} - {20 \choose 5}}{{20 \choose 7}}$`; +const label3 = String.raw`$\frac{2 \cdot {19 \choose 7} - {18 \choose 7}}{{20 \choose 7}}$`; +const label4 = String.raw`$\frac{2 \cdot {19 \choose 6} - {18 \choose 5}}{{20 \choose 7}}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/17/index.md b/src/content/questions/comp2804/midterm-fall-2017/17/index.md new file mode 100644 index 00000000..4c1bac8c --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/17/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/17 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/17/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/17/question.ts b/src/content/questions/comp2804/midterm-fall-2017/17/question.ts new file mode 100644 index 00000000..8761fc03 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/17/question.ts @@ -0,0 +1,31 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +After having proctored the midterm, Alexa, Farah, May, and Shelly decide to go trick-or-treating. + For any house that the ladies visit, if they do not receive candy, they throw rotten eggs at the + house.
+ + Let $m \geq 7$ and $n \geq 7$ be integers. There are $m$ houses whose owners hand out candy and + there are $n$ houses whose owners do not hand out candy.
+ + The ladies choose a uniformly random subset of 7 houses and visit these 7 houses. Define the event + [defs] + A = "the ladies throw rotten eggs at exactly 2 of the 7 chosen houses". + [/defs] + What is $\Pr(A)$? +`; + +const label1 = String.raw`$\frac{{m \choose 5} + {n \choose 2}}{{m+n \choose 7}}$`; +const label2 = String.raw`$\frac{{m \choose 5} \cdot {n \choose 2}}{{m+n \choose 7}}$`; +const label3 = String.raw`$\frac{{7 \choose 2}}{{m \choose 5} \cdot {n \choose 2}}$`; +const label4 = String.raw`$\frac{{7 \choose 2}}{{m+n \choose 7}}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/2/index.md b/src/content/questions/comp2804/midterm-fall-2017/2/index.md new file mode 100644 index 00000000..7e5a4a2e --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/2/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/2 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/2/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/2/question.ts b/src/content/questions/comp2804/midterm-fall-2017/2/question.ts new file mode 100644 index 00000000..1930b22f --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/2/question.ts @@ -0,0 +1,35 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $s \geq 1$, $t \geq 1$, and $k \geq 1$ be integers. The Carleton Computer Science Society is + organizing their annual Halloween party. At this party, there are + + These $s+t+k$ students are arranged on a line, such that all Supermen are standing next to each + other, all Trumps are standing next to each other, all Kims are standing next to each other, and no + Trump is standing next to any Kim. How many such arrangements are there? +`; + +const label1 = String.raw`$\left. (s+t+k)! \middle/ (s! \cdot t! \cdot k!) \right.$`; +const label2 = String.raw`$\left. (s+t+k)! \middle/ (2 \cdot s! \cdot t! \cdot k!) \right.$`; +const label3 = String.raw`$s! \cdot t! \cdot k!$`; +const label4 = String.raw`$2 \cdot s! \cdot t! \cdot k!$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/3/index.md b/src/content/questions/comp2804/midterm-fall-2017/3/index.md new file mode 100644 index 00000000..2f447301 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/3/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/3 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/3/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/3/question.ts b/src/content/questions/comp2804/midterm-fall-2017/3/question.ts new file mode 100644 index 00000000..5f0c7372 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/3/question.ts @@ -0,0 +1,25 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 1$ be an integer. Consider functions + $$ + f : \{1,2,3,\dots,n\} \rightarrow \{1,2,3,\dots,7n\} + $$ + such that, for each $i$ with $1 \leq i \leq n$, $f(i)$ is divisible by 7. How many such functions + are there? +`; + +const label1 = String.raw`$(7n)^{n}$`; +const label2 = String.raw`$n^{7n}$`; +const label3 = String.raw`$n^{n}$`; +const label4 = String.raw`$7^{n}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/4/index.md b/src/content/questions/comp2804/midterm-fall-2017/4/index.md new file mode 100644 index 00000000..63b3ec65 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/4/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/4 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/4/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/4/question.ts b/src/content/questions/comp2804/midterm-fall-2017/4/question.ts new file mode 100644 index 00000000..7725679a --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/4/question.ts @@ -0,0 +1,25 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $m \geq 5$ and $n \geq 5$ be integers. Let $P$ be a set consisting of $m$ strictly positive + integers, and let $N$ be a set consisting of $n$ strictly negative integers. Consider 5-element + subsets $A$ of $P \cup N$ such that the product of the elements in $A$ is strictly positive. How + many such subsets $A$ are there? +`; + +const label1 = + "${n \\choose 5} + {n \\choose 3} \\cdot {m \\choose 2} + n \\cdot {m \\choose 4}$"; +const label2 = + "${m \\choose 5} + {m \\choose 3} \\cdot {n \\choose 2} + m \\cdot {n \\choose 4}$"; +const label3 = "${m+n \\choose 5} - {n \\choose 5}$"; +const label4 = "${m \\choose 5} \\cdot {n \\choose 5}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/5/index.md b/src/content/questions/comp2804/midterm-fall-2017/5/index.md new file mode 100644 index 00000000..ff062f1c --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/5/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/5 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/5/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/5/question.ts b/src/content/questions/comp2804/midterm-fall-2017/5/question.ts new file mode 100644 index 00000000..77be179e --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/5/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 2$ be an even integer and let $S = \{1,2,3,\dots,n\}$. Consider subsets of $S$ that + contain at least one even number. How many such subsets are there? +`; + +const label1 = String.raw`$(n/2) \cdot 2^{n/2}$`; +const label2 = String.raw`$2^{n/2} + 2^{n/2}$`; +const label3 = String.raw`$2^{n} - 2^{n/2}$`; +const label4 = String.raw`$2^{n} + 2^{n/2}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/6/index.md b/src/content/questions/comp2804/midterm-fall-2017/6/index.md new file mode 100644 index 00000000..8ca2297d --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/6/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/6 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/6/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/6/question.ts b/src/content/questions/comp2804/midterm-fall-2017/6/question.ts new file mode 100644 index 00000000..3d6129cb --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/6/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 7$ be an integer and consider strings of length $n$ consisting of the characters $a$, $b$, + $c$, and $d$. How many such strings are there that start with $abc$ or end with $dddd$? +`; + +const label1 = String.raw`$4^{n-3} + 4^{n-4}$`; +const label2 = String.raw`$4^{n-3} + 4^{n-4} - 4^{n-7}$`; +const label3 = String.raw`$2 \cdot 4^{n-3} - 4^{n-7}$`; +const label4 = String.raw`$2 \cdot 4^{n-4} - 4^{n-7}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/7/index.md b/src/content/questions/comp2804/midterm-fall-2017/7/index.md new file mode 100644 index 00000000..db7b29ee --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/7/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/7 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/7/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/7/question.ts b/src/content/questions/comp2804/midterm-fall-2017/7/question.ts new file mode 100644 index 00000000..d66e13ab --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/7/question.ts @@ -0,0 +1,24 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 2$ be an integer. What does + $$ + \sum_{k=2}^{n} {{n}\choose{k}} \cdot 2^{n-k} + $$ + count? +`; + +const label1 = String.raw`The number of strings of length $n$, where each character is $a$ or $b$, that contain at least one $a$.`; +const label2 = String.raw`The number of strings of length $n$, where each character is $a$ or $b$, that contain at least 2 many $a$'s.`; +const label3 = String.raw`The number of strings of length $n$, where each character is $a$, $b$, or $c$, that contain at least one $a$.`; +const label4 = String.raw`The number of strings of length $n$, where each character is $a$, $b$, or $c$, that contain at least 2 many $a$'s.`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/8/index.md b/src/content/questions/comp2804/midterm-fall-2017/8/index.md new file mode 100644 index 00000000..5a7bc1a9 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/8/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/8 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/8/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/8/question.ts b/src/content/questions/comp2804/midterm-fall-2017/8/question.ts new file mode 100644 index 00000000..0ca107e0 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/8/question.ts @@ -0,0 +1,22 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider a square with sides of length 17. This square contains $n$ points. What is the minimum + value of $n$ such that we can guarantee that at least two of these points have distance at most + $\left. 17 \middle/ \sqrt{2} \right.$? +`; + +const label1 = String.raw`4`; +const label2 = String.raw`5`; +const label3 = String.raw`6`; +const label4 = String.raw`7`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2017/9/index.md b/src/content/questions/comp2804/midterm-fall-2017/9/index.md new file mode 100644 index 00000000..13f0ecdb --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/9/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2017/9 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2017/9/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2017/9/question.ts b/src/content/questions/comp2804/midterm-fall-2017/9/question.ts new file mode 100644 index 00000000..43abb085 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2017/9/question.ts @@ -0,0 +1,20 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +What is the coefficient of $x^{20}y^{80}$ in the expansion of $(7x-13y)^{100}$? +`; + +const label1 = "${100 \\choose 80} \\cdot 7^{20} \\cdot 13^{80}$"; +const label2 = "$- {100 \\choose 80} \\cdot 7^{20} \\cdot 13^{80}$"; +const label3 = "${100 \\choose 20} \\cdot 7^{80} \\cdot 13^{20}$"; +const label4 = "$- {100 \\choose 20} \\cdot 7^{80} \\cdot 13^{20}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/1/index.md b/src/content/questions/comp2804/midterm-fall-2018/1/index.md new file mode 100644 index 00000000..f7553ede --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/1/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/1 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/1/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/1/question.ts b/src/content/questions/comp2804/midterm-fall-2018/1/question.ts new file mode 100644 index 00000000..50471f40 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/1/question.ts @@ -0,0 +1,22 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 3$ be an integer and let $S$ be a set consisting of $n$ elements. How many ordered + triples $(A, B, C)$ are there for which $A \subseteq S$, $B \subseteq S$, $C \subseteq S$, and $A$, $B$, + and $C$ are pairwise disjoint? +`; + +const label1 = String.raw`$2^n$`; +const label2 = String.raw`$3^n$`; +const label3 = String.raw`$4^n$`; +const label4 = String.raw`$5^n$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/10/index.md b/src/content/questions/comp2804/midterm-fall-2018/10/index.md new file mode 100644 index 00000000..73127794 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/10/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/10 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/10/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/10/question.ts b/src/content/questions/comp2804/midterm-fall-2018/10/question.ts new file mode 100644 index 00000000..78874515 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/10/question.ts @@ -0,0 +1,28 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $n \geq 1$ be an integer and consider a set $\mathcal{B} = \{B_1,B_2,\dots,B_n\}$ of $n$ beer + bottles and a set $\mathcal{C} = \{C_1,C_2,\dots,C_n\}$ of $n$ cider bottles.
+ + For any integer $k$ with $0 \leq k \leq n$, consider subsets $X$ of $\mathcal{B} \cup \mathcal{C}$, + such that $X$ consists of exactly $k$ bottles and no two bottles in $X$ have the same index. (For + example, if $B_n \in X$, then $C_n \notin X$.)
+ + Let $F(n,k)$ be the number of such subsets X.
+ Which of the following is true for all integers $n \geq 2$ and $k$ with $1 \leq k \leq n - 1$? +`; + +const label1 = String.raw`$F(n,k) = F(n-1,k)\ +$ $ F(n-1,k-1)$`; +const label2 = String.raw`$F(n,k) = F(n-1,k)\ +$ $ 2 \cdot F(n-1,k-1)$`; +const label3 = String.raw`$F(n,k) = F(n,k-1)\ +$ $ F(n-1,k-1)$`; +const label4 = String.raw`$F(n,k) = F(n,k-1)\ +$ $ 2 \cdot F(n-1,k-1)$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/11/index.md b/src/content/questions/comp2804/midterm-fall-2018/11/index.md new file mode 100644 index 00000000..0a96bcfb --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/11/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/11 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/11/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/11/question.ts b/src/content/questions/comp2804/midterm-fall-2018/11/question.ts new file mode 100644 index 00000000..4cf5974c --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/11/question.ts @@ -0,0 +1,25 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +A bitstring is called 00-free, if it does not contain two 0's next to each other. + In class, we have seen that for any $m \geq 1$, + the number of 00-free bitstrings of length $m$ is equal to the $(m+2)$-th Fibonacci number $f_{m+2}$.
+ + What is the number of 00-free bitstrings of length 55 that have 0 at position 9, and 1 at position 40? + (The positions are numbered $1,2,\dots,55$.) +`; + +const label1 = String.raw`$f_7 \cdot f_{29} \cdot f_{15}$`; +const label2 = String.raw`$f_8 \cdot f_{30} \cdot f_{16}$`; +const label3 = String.raw`$f_9 \cdot f_{31} \cdot f_{17}$`; +const label4 = String.raw`$f_{10} \cdot f_{32} \cdot f_{18}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/12/index.md b/src/content/questions/comp2804/midterm-fall-2018/12/index.md new file mode 100644 index 00000000..0882e262 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/12/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/12 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/12/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/12/question.ts b/src/content/questions/comp2804/midterm-fall-2018/12/question.ts new file mode 100644 index 00000000..cf31800b --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/12/question.ts @@ -0,0 +1,30 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +The functions $f: \mathbb{N} \rightarrow \mathbb{N}$ and $g: \mathbb{N} \rightarrow \mathbb{N}$ are + recursively defined as follows: + $$ + \begin{alignat}{2} + f(0) &= 3, \\ + f(n) &= 5 + f(n - 1)\ \; &\mathrm{if}\ n \geq 1, \\ + g(0) &= 1, \\ + g(n) &= 2 \cdot g(n - 1) &\mathrm{if}\ n \geq 1. + \end{alignat} + $$ + For any integer $n \geq 0$, what is $f(g(n))$? +`; + +const label1 = String.raw`$3 + 5 \cdot 2^{n}$`; +const label2 = String.raw`$5 + 3 \cdot 2^{n}$`; +const label3 = String.raw`$2^{3 + 5n}$`; +const label4 = String.raw`$2^{5 + 3n}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/13/index.md b/src/content/questions/comp2804/midterm-fall-2018/13/index.md new file mode 100644 index 00000000..b4b640d2 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/13/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/13 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/13/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/13/question.ts b/src/content/questions/comp2804/midterm-fall-2018/13/question.ts new file mode 100644 index 00000000..90e9ba1b --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/13/question.ts @@ -0,0 +1,24 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider strings of characters, where each character is one of the 26 lowercase letters $a,b,c,\dots,z$. + Such a string is called $qq$-free, if it does not contain two $q$'s next to each other. + For any integer $n \geq 1$, let $Q_n$ be the number of $qq$-free strings of length $n$.
+ + Which of the following is true for any integer $n \geq 3$? +`; + +const label1 = String.raw`$Q(n) = 26 \cdot Q(n-1) + 26 \cdot Q(n-2)$`; +const label2 = String.raw`$Q(n) = 25 \cdot Q(n-1) + 25 \cdot Q(n-2)$`; +const label3 = String.raw`$Q(n) = 26 \cdot Q(n-1) + 25 \cdot Q(n-2)$`; +const label4 = String.raw`$Q(n) = 25 \cdot Q(n-1) + 26 \cdot Q(n-2)$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/14/index.md b/src/content/questions/comp2804/midterm-fall-2018/14/index.md new file mode 100644 index 00000000..1647d165 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/14/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/14 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/14/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/14/question.ts b/src/content/questions/comp2804/midterm-fall-2018/14/question.ts new file mode 100644 index 00000000..aaa7bd01 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/14/question.ts @@ -0,0 +1,42 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` + + + Consider the recursive algorithm $\Fart$, which takes as input an integer $n \geq 0$: + +

+ $\mathbf{Algorithm}\ \Fart(n)\mathrm{:}$
+ $\mathbf{if}\ n = 0\ \mathrm{or}\ n = 1$
+ $\mathbf{then}\ \text{eat one can of beans}$
+ $\mathbf{else}\ \mathbf{if}\ n\ \mathrm{is}\ \mathrm{even}$
+ $\elsesp \mathbf{then}\ \text{fart once};$
+ $\elsesp \thensp \Fart \left( n \middle/ 2 \right)$
+ $\elsesp \mathbf{else}\ \Fart(n + 1);$
+ $\elsesp \elsesp \text{fart once};$
+ $\elsesp \elsesp \Fart(n - 1)$
+ $\elsesp \mathbf{endif};$
+ $\mathbf{endif}$ +

+ + If you run algorithm $\Fart(9)$, how many times do you fart? +`; + +const label1 = String.raw`11`; +const label2 = String.raw`12`; +const label3 = String.raw`13`; +const label4 = String.raw`14`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/15/index.md b/src/content/questions/comp2804/midterm-fall-2018/15/index.md new file mode 100644 index 00000000..9e618019 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/15/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/15 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/15/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/15/question.ts b/src/content/questions/comp2804/midterm-fall-2018/15/question.ts new file mode 100644 index 00000000..aae79a0d --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/15/question.ts @@ -0,0 +1,38 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +The Carleton Computer Science Society is organizing their annual Halloween party. At this party, + + These students are arranged, uniformly at random, on a line. +
+ Define the event, + [defs] + A = "Donald Trump is standing next to Kim Jong Un". + [/defs] + What is $\Pr(A)$? +`; + +const label1 = String.raw`1/58`; +const label2 = String.raw`2/58`; +const label3 = String.raw`1/59`; +const label4 = String.raw`2/59`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/16/index.md b/src/content/questions/comp2804/midterm-fall-2018/16/index.md new file mode 100644 index 00000000..dabea1d1 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/16/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/16 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/16/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/16/question.ts b/src/content/questions/comp2804/midterm-fall-2018/16/question.ts new file mode 100644 index 00000000..f87ed897 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/16/question.ts @@ -0,0 +1,27 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Alexa, Tri, and Zoltan each have a uniformly random birthday. (We ignore leap years, so that one + year has 365 days.)
+ + Define the event + [defs] + A = "Alexa, Tri, and Zoltan have different birthdays". + [/defs] + What is $\text{Pr}(A)$? +`; + +const label1 = String.raw`$\frac{365^2}{363 \cdot 364}$`; +const label2 = String.raw`$\frac{363^3}{362 \cdot 363 \cdot 364}$`; +const label3 = String.raw`$\frac{363 \cdot 364}{365^2}$`; +const label4 = String.raw`$\frac{362 \cdot 363 \cdot 364}{365^3}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/17/index.md b/src/content/questions/comp2804/midterm-fall-2018/17/index.md new file mode 100644 index 00000000..2b8cc3c3 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/17/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/17 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/17/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/17/question.ts b/src/content/questions/comp2804/midterm-fall-2018/17/question.ts new file mode 100644 index 00000000..8dd687c5 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/17/question.ts @@ -0,0 +1,27 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +This midterm has 17 questions. For each question, four options are given. Assume that you answer each + question, by choosing one of the four options uniformly at random.
+ + Define the event + [defs] + A = "you answer exactly 7 questions correctly". + [/defs] + What $\Pr(A)$? +`; + +const label1 = String.raw`$\frac{{17 \choose 7} \cdot 3^{10}}{4^{17}}$`; +const label2 = String.raw`$\frac{{17 \choose 7} \cdot 2^{10}}{4^{17}}$`; +const label3 = String.raw`$\frac{{17 \choose 7}}{4^{17}}$`; +const label4 = String.raw`$\frac{4^{17}}{{17 \choose 7}}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/2/index.md b/src/content/questions/comp2804/midterm-fall-2018/2/index.md new file mode 100644 index 00000000..a7288060 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/2/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/2 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/2/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/2/question.ts b/src/content/questions/comp2804/midterm-fall-2018/2/question.ts new file mode 100644 index 00000000..ee686701 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/2/question.ts @@ -0,0 +1,29 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider bitstrings of length 9. The positions in these strings are numbered as $1,2,3,\dots,9$. + How many such bitstrings have the property that + +`; + +const label1 = String.raw`54`; +const label2 = String.raw`56`; +const label3 = String.raw`58`; +const label4 = String.raw`60`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/3/index.md b/src/content/questions/comp2804/midterm-fall-2018/3/index.md new file mode 100644 index 00000000..34dbff53 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/3/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/3 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/3/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/3/question.ts b/src/content/questions/comp2804/midterm-fall-2018/3/question.ts new file mode 100644 index 00000000..74106492 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/3/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider strings of length 15, where each character is a lowercase letter or an uppercase letter. + How many such strings contain at least two lowercase letters? +`; + +const label1 = String.raw`$52^{15} - 26^{15} - 15 \cdot 26^{14}$`; +const label2 = String.raw`$52^{15} - 26^{15} - 15 \cdot 26^{15}$`; +const label3 = String.raw`$52^{15} - 15 \cdot 26^{15}$`; +const label4 = String.raw`None of the above.`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/4/index.md b/src/content/questions/comp2804/midterm-fall-2018/4/index.md new file mode 100644 index 00000000..be9f0fdb --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/4/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/4 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/4/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/4/question.ts b/src/content/questions/comp2804/midterm-fall-2018/4/question.ts new file mode 100644 index 00000000..7c83378c --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/4/question.ts @@ -0,0 +1,25 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Elisa Kazan's neighborhood pub serves 8 different types of cider; denote these types by $C_1,C_2,\dots,C_8$. + Elisa invites 7 friends to this pub and orders one cider for each friend. Different + friends may get the same type of cider. (Elisa came by car and, therefore, orders a glass of water + for herself.)
+ In how many ways can Elisa place these orders of cider, such that exactly 4 of her friends get a + cider of type $C_3$? +`; + +const label1 = "${7 \\choose 4} \\cdot 7^3$"; +const label2 = "${7 \\choose 4} \\cdot 8^3$"; +const label3 = "${7 \\choose 4} \\cdot 7^4$"; +const label4 = "${7 \\choose 4} \\cdot 8^4$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/5/index.md b/src/content/questions/comp2804/midterm-fall-2018/5/index.md new file mode 100644 index 00000000..af9ee1e4 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/5/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/5 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/5/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/5/question.ts b/src/content/questions/comp2804/midterm-fall-2018/5/question.ts new file mode 100644 index 00000000..6040a50f --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/5/question.ts @@ -0,0 +1,25 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider the equation + $$ + x_1 + x_2 + x_3 + x_4 + x_5 = 17. + $$ + How many solutions $(x_1, x_2, x_3, x_4, x_5)$ does this equation have, where + $x_1 \geq 0$, $x_2 \geq 0$, $x_3 \geq 0$, $x_4 \geq 0$, and $x_5 \geq 0$ are all integers? +`; + +const label1 = "${22 choose 5}$"; +const label2 = "${22 choose 4}$"; +const label3 = "${21 choose 5}$"; +const label4 = "${21 choose 4}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/6/index.md b/src/content/questions/comp2804/midterm-fall-2018/6/index.md new file mode 100644 index 00000000..41a2f523 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/6/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/6 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/6/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/6/question.ts b/src/content/questions/comp2804/midterm-fall-2018/6/question.ts new file mode 100644 index 00000000..29d57fbe --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/6/question.ts @@ -0,0 +1,21 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Let $S$ be a subset of the set $\{1,2,3,\dots,50\}$.
+ What is the minimum size of this subset $S$, such that there must be at least two elements in $S$ whose sum is equal to 51? +`; + +const label1 = String.raw`25`; +const label2 = String.raw`26`; +const label3 = String.raw`27`; +const label4 = String.raw`28`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: true }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/7/index.md b/src/content/questions/comp2804/midterm-fall-2018/7/index.md new file mode 100644 index 00000000..cacb12ed --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/7/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/7 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/7/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/7/question.ts b/src/content/questions/comp2804/midterm-fall-2018/7/question.ts new file mode 100644 index 00000000..93c5d425 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/7/question.ts @@ -0,0 +1,22 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider 5-element subsets $\{x_1,x_2,x_3,x_4,x_5\}$ of the set $\{1,2,3,\dots,17\}$, + where $x_1 < x_2 < x_3 < x_4 < x_5$.
+ How many such subsets have the property that $x_3 = 7$? +`; + +const label1 = "${6 choose 2} cdot {10 choose 2}$"; +const label2 = "${6 choose 2} cdot {9 choose 2}$"; +const label3 = "${7 choose 2} cdot {10 choose 2}$"; +const label4 = "${7 choose 2} cdot {9 choose 2}$"; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: true }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/8/index.md b/src/content/questions/comp2804/midterm-fall-2018/8/index.md new file mode 100644 index 00000000..864df621 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/8/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/8 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/8/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/8/question.ts b/src/content/questions/comp2804/midterm-fall-2018/8/question.ts new file mode 100644 index 00000000..f3983203 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/8/question.ts @@ -0,0 +1,26 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +Consider a set $\mathcal{B} = \{B_1,B_2,\dots,B_{13}\}$ of 13 beer bottles and a set + $\mathcal{C} = \{C_1,C_2,\dots,C_{12}\}$ of 12 cider bottles.
+ + Consider subsets $X$ of $\mathcal{B} \cup \mathcal{C}$, such that $X$ consists of exactly 5 beer + bottles and all cider bottles in $X$ have an even index.
+ + How many such subsets $X$ are there? +`; + +const label1 = "${12 \\choose 5} \\cdot 2^6$"; +const label2 = "${13 \\choose 5} \\cdot 2^5$"; +const label3 = "${13 \\choose 5} \\cdot 2^6$"; +const label4 = "None of the above."; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: true }, + { label: label4, correct: false }, + ], +}; diff --git a/src/content/questions/comp2804/midterm-fall-2018/9/index.md b/src/content/questions/comp2804/midterm-fall-2018/9/index.md new file mode 100644 index 00000000..9b4206c0 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/9/index.md @@ -0,0 +1,9 @@ +--- +title: N/A +path: comp2804/midterm-fall-2018/9 +type: multiple-choice +author: Michiel Smid +question: comp2804/midterm-fall-2018/9/question.ts +tags: + - comp2804 +--- diff --git a/src/content/questions/comp2804/midterm-fall-2018/9/question.ts b/src/content/questions/comp2804/midterm-fall-2018/9/question.ts new file mode 100644 index 00000000..31c0ea89 --- /dev/null +++ b/src/content/questions/comp2804/midterm-fall-2018/9/question.ts @@ -0,0 +1,25 @@ +import type { MultipleChoiceQuestion } from "@common/MultipleChoiceQuestionGenerator"; + +const body = String.raw` +A bitstring $s_1s_2...s_n$ is called a palindrome, if $$s_1s_2...s_{n-1}s_n = s_ns_{n-1}...s_2s_1,$$ + i.e., reading the string from left to right gives the same string as when reading from right to left.
+ + For any integer $n \geq 1$, let $P_n$ be the number of bitstrings of length $n$ that are palindromes.
+ + Which of the following is true for any integer $n \geq 3$? +`; + +const label1 = String.raw`$P_n = 2 + P_{n-2}$`; +const label2 = String.raw`$P_n = 2 \cdot P_{n/2}$`; +const label3 = String.raw`$P_n = 2 \cdot P_{n-1}$`; +const label4 = String.raw`$P_n = 2 \cdot P_{n-2}$`; + +export const question: MultipleChoiceQuestion = { + body: body, + options: [ + { label: label1, correct: false }, + { label: label2, correct: false }, + { label: label3, correct: false }, + { label: label4, correct: true }, + ], +};