FIT5197 2019 S1 Assignment 1 (25 marks)
Wray Buntine 18 March 2019
Contents
1 Details 2
2 Probabilities in Cards (2 marks) 3
2.1 Aspecialflush(1mark)………………………………… 3 2.2 Norepeats(1mark) ………………………………….. 3
3 PDF and Expectations (3 Marks) 3
3.1 Plot(1/2mark)…………………………………….. 3 3.2 Mean(1/2mark)……………………………………. 4 3.3 Variance(1mark) …………………………………… 4 3.4 Skewness(1mark) …………………………………… 4
4 Distributions (2 marks) 4
4.1 Model(1mark)…………………………………….. 4 4.2 Checking(1mark) …………………………………… 4
5 Entropy (3 Marks) 4
5.1 Conditionalprobabilities(1mark) …………………………… 5 5.2 Entropies(1marks) ………………………………….. 5 5.3 Coding(1mark) ……………………………………. 5
6 Maximum likelihood estimation of parameters (3 marks) 5
6.1 Maximumlikelihoodfitting(2marks) …………………………. 5
7 Central Limit Theorem (7 marks) 6
7.1 Samplingdistribution(2marks) ……………………………. 6 7.2 Simulation(2marks)………………………………….. 6 7.3 Plottingnormality(3marks) ……………………………… 6
Submission due date: by 11:59pm on Friday 12 April 2019 (end of Week 6)
1
1 Details
Marks
This assignment contains 6 questions. There are 25 marks in total for the assignment and it counts for 25% of your overall grade for the unit. Also, 3 of the 25 marks are awarded for code quality and 2 of the marks awarded for presentation of results, for instance use of plots. That leaves 20 marks for individual answers. You must show all working, so we can see how you obtain your answer. Marks are assigned for working as well as the correct answer.
Your solutions
Please put your name or student number on the first page of your solutions. Do not copy questions in your solutions. Only include question numbers. If you use any external resources for developing your results, please remember to provide the link to the source.
Special consideration and late submissions
Please contact unit CE Wray Buntine Wray.Buntine@monash.edu for special consideration as per Monash policy. If an extension has been given then submission after the due date is allowed with no penalty being incurred. If no extension has been given then assignments submitted after the due date, there will be penalised 5% per day up to a maximum of 10 days late.
Submitting your assignment on Moodle
Please submit your assignment through Moodle via upload a Word or PDF document as well as R markdown you used to generate results.
• If you choose to use R markdown file to directly knit Word/PDF document, you would need to type in Latex equations for Question 1,2 and 5. Find more information about using latex in R markdown files here. You may also find the R markdown cheatsheet useful.
• You can also work with Word and R markdown separately. In this case you would need to type your answers in Word and also copy R code (using the format: Courier New), results and figures to the Word document.
We will mark your submission mostly using your Word/PDF document. However, you need to make sure your R markdown file is executable in case we need to check your code.
Code quality marks
Your R code will be reviewed for conciseness, efficiency, explainability and quality. Inline documentation, for instance, should demarcate key sections and explain more obtuse operations, but shouldn’t be over verbose. Out of the 25 marks, 3 will be awarded for code quality.
Presentation marks
Your presentation of results using R will be reviewed. How well do you use plots or other means of ordering and conveying results. Out of the 25 marks, 2 will be awarded for presentation using R.
2
2 Probabilities in Cards (2 marks)
Have a regular deck of cards with no jokers (13 cards per suit, 4 suits) giving 52 cards. Suppose we draw a 5 card hand, so 5 cards without replacement. For each answer write out the full calculation in R to show working.
Note there are 52! different 5 card hands if ordering of the draw is considered, and each is equally likely. If 47!
ordering of the draw is ignored, there are 52 different 5 card hands. 5
2.1 A special flush (1 mark)
What is the probability of getting a royal flush but where the cards ordered by rank have alternate color? That is, order the cards as 10,J,Q,K,A and then check to see they have alternate colour. Note in a proper royal flush, it is all the one suit, but we have changed that to alternate colour. So, for example “red 10, black J, red Q, black K, red A” is OK but “red J, black 10, red Q, black K, red A” is not OK because once reordered in rank the alternating colour no longer holds. Note the order in which they are drawn from the pack is not considered.
HINT: This event is defined ignoring the order of the draw, so count out the number of such hands (ignoring the order of the draw), and divide by 52.
5
2.2 No repeats (1 mark)
What is the probability that in the sequence of cards, as they are drawn, no rank occurs twice in a row? So ignoring the suit, the following are allowed: A, 10, 4, J, 10 or A, 10, A, 4, A, but the following are not allowed: A, A, 10, 4, A (A repeated in positions 1 and 2), A, 4, 10, 10, J (10 repeated in positions 3 and 4).
HINT: This event is defined using the order of the draw, so count out the number of such hands, and divide by 52!/47!.
3 PDF and Expectations (3 Marks)
Let X have the PDF given by a function with a different negative and positive part.
f(x) = 12(1+x)2 7
= 12(1−x)3 7
= 0
You can use Wolfram Alpha to do the definite integrals, for instance
https://www.wolframalpha.com/input/?i=integral+(1-x)%5E3+from+0+to+1
3.1 Plot (1/2 mark)
Draw the plot in R.
for−1