[SOLVED] ceng222 - hw1

30.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

Rate this product

Answer 1

a)

b)

For both cases, each dice has values, say x,y,z. Then their expected values will be equal to E(x + y + z) which is equal to E(x) + E(y) + E(z) by the linearity of expected value.

  • For two red and one yellow dice case, E(2 Red + Y ellow) = 2 × E(Red) + E(Y ellow) = 7
  • For two yellow and one blue dice case, E(2 Y ellow+Blue) = 2×E(Y ellow)+E(Blue) = 5.67 In order to maximize the total value, first option should be chosen, as its expected value is higher.

c)

When 4 is guaranteed, E(Blue) will be equal to 4. Because of that change, E(2 Y ellow+Blue) = 8 This time, second option’s expected value is higher, so second option should be chosen. d)

Given that the value is 3, the probability that the rolled die is red is P(Red|3), also:

by Baye’s Law and the law of total probability.

As

e)

For the total value 6, there are two combinations.

Red    Yellow

3           3

5           1

is the probability that the total value will be 6 when a single red die and a single

yellow die is rolled together.

Answer 2

a)

By the third line of Table 1, P(A = 0,I = 2) = 0.17

b)

As there are probabilities for only A = 0 and A = 1, P(A = 2,I = 0) = 0 c)

P(A = 0,I = 2) + P(A = 1,I = 1) = 0.17 + 0.11 = 0.28

d)

P(A = 1,I = 0)+P(A = 1,I = 1)+P(A = 1,I = 2)+P(A = 1,I = 3) = 0.12+0.11+0.22+0.15 =

0.6

e)

  • PA(0) = P(0,0) + P(0,1) + P(0,2) + P(0,3) = 0.08 + 0.13 + 0.17 + 0.02 = 0.4
  • PA(1) = P(1,0) + P(1,1) + P(1,2) + P(1,3) = 0.12 + 0.11 + 0.22 + 0.15 = 0.6
  • PI(0) = P(0,0) + P(1,0) = 0.08 + 0.12 = 0.2
  • PI(1) = P(0,1) + P(1,1) = 0.13 + 0.11 = 0.24
  • PI(2) = P(0,2) + P(1,2) = 0.17 + 0.22 = 0.39
  • PI(3) = P(0,3) + P(1,3) = 0.02 + 0.15 = 0.17
I\A 0 1 2 3 PA(a)
0 0.08 0.13 0.17 0.02 0.4
1 0.12 0.11 0.22 0.15 0.6
PI(i) 0.2 0.24 0.39 0.17 1

f)

In order to electric outages be independent, PA(a) × PI(i) = P(a,i) for all cases.

As cases other than PA(0) × PI(0) = P(0,0) and PA(1) × PI(0) = P(1,0) does not satisfy the condition, electric outages in Ankara and Istanbul are not independent.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.