STM4PSD (Semester 1) ASSIGNMENT 1, 2022 Due by 11:59pm on Monday 21 March, 2022. 1. Submit your assignment as a single scanned PDF file through the LMS before the due time. By submitting your work...

Alex


STM4PSD (Semester 1) ASSIGNMENT 1, 2022 Due by 11:59pm on Monday 21 March, 2022. 1. Submit your assignment as a single scanned PDF file through the LMS before the due time. By submitting your work electronically, you are affirming that it is all your own work, and you will be asked to confirm this as you submit it. 2. You may use facts from the reading materials and from the lab classes to answer these questions. 3. Working must be shown to support your answers. It is not only the final answer that is important, but your mastery of the required techniques, and the way you communicate your ideas and your approach to the problems. You will be assessed on the way you communicate your answers. 4. There are 20 total marks available for this assignment. There will be 14 marks awarded for correct solutions, 3 marks for written communication, and 3 completeness marks for making a reasonable attempt at all questions. 5. Late submissions for non-emergency reasons will not be accepted unless you have made an arrangement with the subject coordinator before the due date. 6. In accordance with department policy, students may be asked by the subject coordinator to verbally explain or demonstrate their answers. Question 1. A random variable X has the following probability mass function: x −3 −2 0 1 4 6 P (X = x) 0.174 0.092 0.023 0.340 0.341 0.030 For this question, use 3 decimal places of accuracy while performing all calculations, and give all final answers to 3 decimal places. (a) Write down the set ΩX . (b) Determine E(X), Var(X) and SD(X). (c) Let A denote the event “X is negative”, let B denote the event “X 6= 1”, and let C denote the event “X < 4”. note: zero is not a negative number. determine each of the following: (i) p (a), p (b) and p (c) (ii) p (a ∩ c), p (b ∩ c) and p (ac ∩b), (iii) p (a ∪ c), p (b ∪ c) and p (a ∪ cc) (iv) p (a | c) and p (b | ac) question 2. the kurtosis of a random variable x is defined as: e (( x − µ σ )4) , where µ = e(x) and σ = sd(x). it is used to measure the thickness of the tail sections of a probability distribution (with a higher kurtosis corresponding to fatter tails, and a lower kurtosis corresponding to thinner tails). (a) write code for an r function kurtosis which takes as input two variables: events and probabilities, and returns the kurtosis (as per the above definition) based on these values. the variable events is assumed to be a vector containing the events in the sample space of a discrete random variable x, and the variable probabilities is assumed to be a vector containining the respective probability of each event. hint: you should make use of the expected.value and variance functions from the week 2 lab class in your code. you may also find it helpful to model your solution on those functions. (b) use your function to verify that the kurtosis of the random variable x in question 1 is approximately 1.82. for this question, submit the code you write for part (a), and the commands used to evaluate part (b). 1 of 2 question 3. consider a simple communication system consisting of a transmitter and a receiver. the transmitter can send a signal consisting of either a 0 or a 1. because of radio interference, occasionally the transmitter will receive the wrong signal. for example, the transmitter may send a 0, but the transmitter receives a 1. it is known that, regardless of which signal is sent, the opposite signal will be received 4% of the time. that is, if a 0 is sent, then there is a 4% chance that a 1 will be received instead, and similarly, if a 1 is sent, then there is a 4% chance that a 0 will be received instead. otherwise, the correct signal is received. assume the transmitter sends out signals at random. let a denote the event that the transmitter sends a 0, and let b denote the event that the receiver receives a 0. after one day of receiving transmissions, 65% of all transmissions received were 0s. for this question, use 3 decimal places of accuracy while performing all calculations, and give all final answers to 3 decimal places. show all working. (a) describe, in words, what the probabilities p (b | a) and p (bc | ac) represent. (b) given the information above, state the probabilities p (b), p (b | a) and p (bc | ac). (c) use the law of total probability to express p (b) in terms of p (a). (d) use your answer to (c) to determine p (a). (e) describe, in words, what the probabilities p (ac | b) and p (ac | bc) represent. (f) determine p (ac | b) and p (ac | bc) using bayes’ theorem. question 4. consider the following transaction database: transaction id items 1 {lettuce, pumpkin, corn, beans, spinach} 2 {corn} 3 {lettuce, pumpkin, beans} 4 {lettuce, corn, beans} 5 {lettuce, pumpkin, beans, spinach} 6 {pumpkin, beans, spinach} 7 {lettuce, pumpkin, beans, spinach} 8 {lettuce, corn, beans} 9 {lettuce, pumpkin, corn, beans, spinach} 10 {corn} 11 {lettuce, pumpkin, corn, beans, spinach} for this question, give all answers to at least 3 decimal places. (a) determine all one-item and two-item item-sets with minimum support 0.6. show all steps of your working. (b) use your answer to (a) to determine all three-item item-sets with minimum support 0.6. (c) use your previous answers to determine all rules of the form {a} ⇒ {b} with minimum support 0.6. calculate the confidence and lift for each rule you find, presenting your final answer in table form. (d) consider the following two assocation rules: r1 : {beans, spinach} ⇒ {pumpkin} r2 : {pumpkin, beans} ⇒ {lettuce} (i) calculate the support, confidence and lift of the two association rules. (ii) on the basis of the given data, which of the two association rules would be a better predictor of cross-sales? explain your reasoning, referring to the calculations in part (i). 2 of 2 4”.="" note:="" zero="" is="" not="" a="" negative="" number.="" determine="" each="" of="" the="" following:="" (i)="" p="" (a),="" p="" (b)="" and="" p="" (c)="" (ii)="" p="" (a="" ∩="" c),="" p="" (b="" ∩="" c)="" and="" p="" (ac="" ∩b),="" (iii)="" p="" (a="" ∪="" c),="" p="" (b="" ∪="" c)="" and="" p="" (a="" ∪="" cc)="" (iv)="" p="" (a="" |="" c)="" and="" p="" (b="" |="" ac)="" question="" 2.="" the="" kurtosis="" of="" a="" random="" variable="" x="" is="" defined="" as:="" e="" ((="" x="" −="" µ="" σ="" )4)="" ,="" where="" µ="E(X)" and="" σ="SD(X)." it="" is="" used="" to="" measure="" the="" thickness="" of="" the="" tail="" sections="" of="" a="" probability="" distribution="" (with="" a="" higher="" kurtosis="" corresponding="" to="" fatter="" tails,="" and="" a="" lower="" kurtosis="" corresponding="" to="" thinner="" tails).="" (a)="" write="" code="" for="" an="" r="" function="" kurtosis="" which="" takes="" as="" input="" two="" variables:="" events="" and="" probabilities,="" and="" returns="" the="" kurtosis="" (as="" per="" the="" above="" definition)="" based="" on="" these="" values.="" the="" variable="" events="" is="" assumed="" to="" be="" a="" vector="" containing="" the="" events="" in="" the="" sample="" space="" of="" a="" discrete="" random="" variable="" x,="" and="" the="" variable="" probabilities="" is="" assumed="" to="" be="" a="" vector="" containining="" the="" respective="" probability="" of="" each="" event.="" hint:="" you="" should="" make="" use="" of="" the="" expected.value="" and="" variance="" functions="" from="" the="" week="" 2="" lab="" class="" in="" your="" code.="" you="" may="" also="" find="" it="" helpful="" to="" model="" your="" solution="" on="" those="" functions.="" (b)="" use="" your="" function="" to="" verify="" that="" the="" kurtosis="" of="" the="" random="" variable="" x="" in="" question="" 1="" is="" approximately="" 1.82.="" for="" this="" question,="" submit="" the="" code="" you="" write="" for="" part="" (a),="" and="" the="" commands="" used="" to="" evaluate="" part="" (b).="" 1="" of="" 2="" question="" 3.="" consider="" a="" simple="" communication="" system="" consisting="" of="" a="" transmitter="" and="" a="" receiver.="" the="" transmitter="" can="" send="" a="" signal="" consisting="" of="" either="" a="" 0="" or="" a="" 1.="" because="" of="" radio="" interference,="" occasionally="" the="" transmitter="" will="" receive="" the="" wrong="" signal.="" for="" example,="" the="" transmitter="" may="" send="" a="" 0,="" but="" the="" transmitter="" receives="" a="" 1.="" it="" is="" known="" that,="" regardless="" of="" which="" signal="" is="" sent,="" the="" opposite="" signal="" will="" be="" received="" 4%="" of="" the="" time.="" that="" is,="" if="" a="" 0="" is="" sent,="" then="" there="" is="" a="" 4%="" chance="" that="" a="" 1="" will="" be="" received="" instead,="" and="" similarly,="" if="" a="" 1="" is="" sent,="" then="" there="" is="" a="" 4%="" chance="" that="" a="" 0="" will="" be="" received="" instead.="" otherwise,="" the="" correct="" signal="" is="" received.="" assume="" the="" transmitter="" sends="" out="" signals="" at="" random.="" let="" a="" denote="" the="" event="" that="" the="" transmitter="" sends="" a="" 0,="" and="" let="" b="" denote="" the="" event="" that="" the="" receiver="" receives="" a="" 0.="" after="" one="" day="" of="" receiving="" transmissions,="" 65%="" of="" all="" transmissions="" received="" were="" 0s.="" for="" this="" question,="" use="" 3="" decimal="" places="" of="" accuracy="" while="" performing="" all="" calculations,="" and="" give="" all="" final="" answers="" to="" 3="" decimal="" places.="" show="" all="" working.="" (a)="" describe,="" in="" words,="" what="" the="" probabilities="" p="" (b="" |="" a)="" and="" p="" (bc="" |="" ac)="" represent.="" (b)="" given="" the="" information="" above,="" state="" the="" probabilities="" p="" (b),="" p="" (b="" |="" a)="" and="" p="" (bc="" |="" ac).="" (c)="" use="" the="" law="" of="" total="" probability="" to="" express="" p="" (b)="" in="" terms="" of="" p="" (a).="" (d)="" use="" your="" answer="" to="" (c)="" to="" determine="" p="" (a).="" (e)="" describe,="" in="" words,="" what="" the="" probabilities="" p="" (ac="" |="" b)="" and="" p="" (ac="" |="" bc)="" represent.="" (f)="" determine="" p="" (ac="" |="" b)="" and="" p="" (ac="" |="" bc)="" using="" bayes’="" theorem.="" question="" 4.="" consider="" the="" following="" transaction="" database:="" transaction="" id="" items="" 1="" {lettuce,="" pumpkin,="" corn,="" beans,="" spinach}="" 2="" {corn}="" 3="" {lettuce,="" pumpkin,="" beans}="" 4="" {lettuce,="" corn,="" beans}="" 5="" {lettuce,="" pumpkin,="" beans,="" spinach}="" 6="" {pumpkin,="" beans,="" spinach}="" 7="" {lettuce,="" pumpkin,="" beans,="" spinach}="" 8="" {lettuce,="" corn,="" beans}="" 9="" {lettuce,="" pumpkin,="" corn,="" beans,="" spinach}="" 10="" {corn}="" 11="" {lettuce,="" pumpkin,="" corn,="" beans,="" spinach}="" for="" this="" question,="" give="" all="" answers="" to="" at="" least="" 3="" decimal="" places.="" (a)="" determine="" all="" one-item="" and="" two-item="" item-sets="" with="" minimum="" support="" 0.6.="" show="" all="" steps="" of="" your="" working.="" (b)="" use="" your="" answer="" to="" (a)="" to="" determine="" all="" three-item="" item-sets="" with="" minimum="" support="" 0.6.="" (c)="" use="" your="" previous="" answers="" to="" determine="" all="" rules="" of="" the="" form="" {a}="" ⇒="" {b}="" with="" minimum="" support="" 0.6.="" calculate="" the="" confidence="" and="" lift="" for="" each="" rule="" you="" find,="" presenting="" your="" final="" answer="" in="" table="" form.="" (d)="" consider="" the="" following="" two="" assocation="" rules:="" r1="" :="" {beans,="" spinach}="" ⇒="" {pumpkin}="" r2="" :="" {pumpkin,="" beans}="" ⇒="" {lettuce}="" (i)="" calculate="" the="" support,="" confidence="" and="" lift="" of="" the="" two="" association="" rules.="" (ii)="" on="" the="" basis="" of="" the="" given="" data,="" which="" of="" the="" two="" association="" rules="" would="" be="" a="" better="" predictor="" of="" cross-sales?="" explain="" your="" reasoning,="" referring="" to="" the="" calculations="" in="" part="" (i).="" 2="" of="">
Mar 12, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here