different result for P(H) in the exercise

17 views
Skip to first unread message

Dailos Guerra Ramos

unread,
Oct 20, 2011, 7:12:07 AM10/20/11
to stanford...@googlegroups.com
Hi All,
I've got a different result for P(H) in the exercise at Unit 3.11c? Why? Does anyone have the same?
P(H)=(1*0.01*0.7)+(0.9+0.01+0.­3)+(0.1*0.99*0.3)+(0.7*0.99*0.­7) = 1.7317999999999998

Sarah Norell

unread,
Oct 20, 2011, 11:01:29 AM10/20/11
to stanford...@googlegroups.com
Hi,
You can never have a probability over 1 so your answer can't be right. You wrote
P(H)=(1*0.01*0.7)+(0.9+0.01+0.­3)+(0.1*0.99*0.3)+(0.7*0.99*0.­7)
You've accidentally added in the second bracket instead of
multiplying. If you multiply in that bracket, thus doing
P(H)=(1*0.01*0.7)+(0.9*0.01*0.­3)+(0.1*0.99*0.3)+(0.7*0.99*0.­7)
you get 0.5245

> --
> You received this message because you are subscribed to the Google Groups
> "Stanford AI Class" group.
> To post to this group, send email to stanford...@googlegroups.com.
> To unsubscribe from this group, send email to
> stanford-ai-cl...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/stanford-ai-class?hl=en.
>

David Weiseth

unread,
Oct 20, 2011, 11:50:59 AM10/20/11
to stanford...@googlegroups.com
True, but this is only a constraint when "complementary".

I have a coin, there are only two discrete results, heads or tails.  It can only be either of these two results, therefore the combination of probabilities  must always sum to 1.  But make sure this is the case, or it will not.

I must say I prefer to talk generalities not specific Homework problems, we should not talk specific problems, this is a violation of the honor code.

I can discuss the general principles that apply, and why they apply, and the maths that support their application.  I will not comment on a specific answer or solution until after the homework is closed.

--David


When looking at probabilities determine the association of the different probabilities, are they dependent or independent?  ( very important )
The math can help us determine this, or this is a given in the problem.  Write down the questions givens, before solving this problem, before applying the math.

What information is provided, can we derive the missing piece of information requested in the question?  Apply the math to do so, but make sure you have fully understood the problem, the givens, and the limits of the math that can be applied.

Sarah Norell

unread,
Oct 20, 2011, 12:20:29 PM10/20/11
to stanford...@googlegroups.com
Is even the discussion of the lectures a violation of the honour code?
This questions was based on a lecture and not on a homework
assignment.

David Weiseth

unread,
Oct 20, 2011, 12:43:22 PM10/20/11
to stanford...@googlegroups.com
dhooot, sorry jumped to a conclusion since I had not started the Homework yet.  My comment stands, but does not apply, apologies thank you for the clarification. --David

Dailos Guerra Ramos

unread,
Oct 20, 2011, 2:03:39 PM10/20/11
to stanford...@googlegroups.com
I missed the "pluses", that's right! Thank you, thank you.
I will try to read twice before posting :)

David Weiseth

unread,
Oct 21, 2011, 1:41:26 AM10/21/11
to stanford...@googlegroups.com
Analysis of weather prediction:

Keys which rules to apply, and when to apply them.

Rule 1 [R1]:  When previous day state: unknown, then Sun 0.9 & Rain 0.1  ( not so good )
Rule 2 [R2]: When previous day state: sun, then Sun 0.8 & Rain 0.2  ( better more specific accurate rule )
Rule 3 [R3]: When previous day state: rain, then Sun 0.6 & Rain 0.4  ( better more specific accurate rule  )
Rule 4 [R4]: When previous two days sun, then Oooops do not have the rule, would be even better

Problem:

Givens, the rules above
Weather can have only two complementary states Sun or Rain ( mutually exclusive ) and discrete states by day.

We have the following starting state for weather: unknown

getDay1(unknown)
   Previous State: unknown
   Rule Applied [R1]
   Sun  ( 0.9 )
   Rain ( 0.1)

getDay2( 0.9)
   Previous State: Sun
   Rule Applied  [R2]
   Sun ( 0.9 * 0.8 ) = 0.72
   Rain (0.9 * 0.2 ) = 0.18

   Previous State: Rain
   Rule Applied [R3]
   Sun ( 0.1 * 0.6) = 0.06
   Rain( 0.1 * 0.4 ) = 0.04

   Sun state probabilities
   ( 0.72 + 0.06 ) = 0.78
   Rain state probabilities
   ( 0.18 + 0.04 ) = 0.22


getDay3( 0.78)
   Previous State: Sun
   Rule Applied  [R2]
   Sun ( 0.78 * 0.8 ) = 0.624
   Rain (0.78 * 0.2 ) = 0.156

   Previous State: Rain
   Rule Applied [R3]
   Sun ( 0.22 * 0.6) = 0.132
   Rain( 0.22 * 0.4 ) = 0.088

   Sun state probabilities
   ( 0.624 + 0.132) = 0.756
   Rain state probabilities
   ( 0.156 + 0.088 ) = 0.244

Hope this helps.  --David

( I usually at least initially avoid the cryptic symbology used by mathematicians )

David Weiseth

unread,
Oct 22, 2011, 3:21:08 PM10/22/11
to stanford...@googlegroups.com
I have given this some thought, and I am troubled by one thing, not the application of the rules, but the application of the more specific rules onto the less specific rule, this bothers me fundamentally.

It feels like we are building a solid structure on sand, can anyone offer any explanation as to why this is ok?

So I have no problem with the application of R1, or R2, or R3, but I am bothered by R1 * R2    or  R1 * R3.  

Maybe when R2 was created it was always created to be applied to R1 so it is baked in, but this is not obvious to me, but it could be a given I am not realizing since I am not a mathematician.  Any insight or explanation appreciated.

Thank you. --David

Sarah Norell

unread,
Oct 22, 2011, 4:13:05 PM10/22/11
to stanford...@googlegroups.com
I wouldn't say either rule is more or less specific. In fact, you're
saying the rules are better and then working out what you consider is
a not so good result (See below)! I think your rule 1 should be day 1,
and that on day 1 which is a specific day, we know the probability is
as given.
Rule 1 [R1]: Day 1:  Sun 0.9 & Rain 0.1
Rule 2 [R2]: When previous day state: sun, then Sun 0.8 & Rain 0.2.
<--- conditional probability
Rule 3 [R3]: When previous day state: rain, then Sun 0.6 & Rain 0.4.
<--- conditional probability

What you work out is the equivalent of rule 1 but for day 2, that is:
Day 2: Sun 0.78 & Rain 0.22.

Rule 4 [R4]: When previous two days sun, then Oooops do not have the

rule, would be even better <-- I don't know why you'd want this
information. You can calculate it fairly easily. It also depends on
whether the first sunny day of the two is day 1 or some other day, so
it's going to get a little messy to state it.
The rule you're applying is conditional probability

 P(A|B) = P(A, B) / P(B).

Rearranging this gives you P(A ,B) = P(A|B) * P(B). Not that it's
P(A|B) which is the probability that A happens given that B has
already happened. This is exactly what you're given in your R2 and R3.

R2 is created with R1 in mind since the probabilities give are the
probabilities when you know what happened the day before because R2
probabilities are conditional on R1. It's a bit hard to draw a tree in
an email but I'll try. Note that the probabilities we get on day 2
change dependent on what happened the day before. This is how the
information is 'baked in'.

David Weiseth

unread,
Oct 22, 2011, 5:44:53 PM10/22/11
to stanford...@googlegroups.com
Thank you, you are correct I created [R1] inappropriately, this is not a rule, it is a given in the problem.

I just was tying to think about this as coming from the sensors, and why would a sensor give me a probability.  I see how to do the graph after that point.  I would expect the first given to be 100% as having come from a sensor reading.  As  I move along my state value graph, I can apply the rules that are relevant to calculating the probabilities of each state value that satisfies the goal, but I guess I just always expect to start with a 100% sensor reading.

Thank you kindly :-)

I am still getting my head around the mathematics that represent the fact that the simple model P(A,B) = P(A)* P(B), does not often apply, because the two results are not independent, therefore we need to create more rules to handle the situation.




Reply all
Reply to author
Forward
0 new messages