# KV Basic Methods of Data Analysis - Exercise
###### tags: `Exercise`
## Unit 1
Exercise: Consider sample {2; 3; 5; 4; 5; 3; 2; 3} of size n = 8. Compute relative and absolute frequencies of different measurements!
---
Exercise: for sample {2; 3; 5; 7; 4; 5; 3; 2; 3; 7; 9; 3} compute arithmetic mean, mode and quartiles.
---
Exercise: Consider again the sample {2; 3; 5; 7; 4; 5; 3; 2; 3; 7; 9; 3} and compute standard deviation, range and interquartile range. Discuss the results.
---
Exercise: name at least three further practical examples, where correlation -!-> dependency can be observed as well.
---
## Unit 2

$x=\frac{13}{2}$
$y=8$
$z=- \frac{3}{2}$
---

15
---

---

## Unit 3
Consider an urn containing 6 red and 10 black balls. Suppose we draw three balls without replacement. Answer the following questions:
1. What is the probability of drawing at least one red ball? (Hint: complementary probability might makes it easier)
A: $1 - \frac{10}{16} \cdot \frac{9}{15} \cdot\frac{8}{14} =0.78571$
2. What is the probability of getting a black ball in the second and a red ball in the third drawing?
A: $\frac{10}{16} \cdot \frac{9}{15} \cdot \frac{6}{14} +\frac{6}{16} \cdot \frac{10}{15} \cdot \frac{5}{14}=0.25$
3. What is the probability of getting a red ball in the third drawing?
A: $0.375$
4. What is the probability of having gotten a black ball in the second drawing if you know that there has been at least one red ball in total (i.e. in all three drawings)?
A: $0.411$
5. What is the probability to draw the same color in the first and the third drawing?
A: $0.486$
---

p(A1)=0.6, p(A2)=0.49,p(A1 ∩ A2)=0.294, p(A1|A2)=0.6,p(A2|A1)=0.35, A1 and A2 are not independent
p(A3)=0.4, p(A4)=0.4,p(A3 ∩ A4)=0.12, p(A3|A4)=0.3,p(A4|A3)=0.3, A3 and A4 are not independent
Coin: p(0)=0.0156, p(1)=0.0938, p(2)=0.2344, p(3)=0.3125, p(4)=0.2344, p(5)=0.0938, p(6)=0.0156
---

1.) https://moodle.jku.at/jku/mod/streamurl/view.php?id=4830439 @ 6min
2.) px(x=0)=0.35, px(x=1)=0.65, py(y=3)=0.36, py(y=4)=0.27, py(y=5)=0.37
3.)

---
A test predicts with 99.9 % probability a positive test result for a HIV infected person. With 99.8 % probability it yields a negative result for a person which is not infected. In total, 0.05 % of all Austrian people are infected.
1. How many of 1000 tested people who are infected get a negative test result (false negative)?
FN = 1
2. How many out of 1000 non HIV-infected people wrongly get a positive result (false positive)?
FP = 2
3. A random person takes the test and its result is positive. How large is the probability that the person is not infected?
0.8
1. Sketch the discrete density function and cumulative distribution function for the binomial distributions B(5; 0:2), B(5; 0:8). What are the expectations and variances?
2. Sketch the continuous density function and cumulative distribution function for the normal distributions N(0; 1), N(-2; 3). What are the expectations and variances?
---
Exercise: the sample mean is a maximum likelihood estimator for the mean of a normal distribution.
---