Author Topic: Umbrellas  (Read 6822 times)

0 Members and 1 Guest are viewing this topic.

Offline Nate

  • Full Member
  • ***
  • Posts: 425
  • You all suck
    • View Profile
Umbrellas
« on: April 13, 2008, 01:58:34 PM »
You have 2 umbrellas.
If you are at home and it is raining and you have an umbrella you take it with you.
If you are at work and it is raining and you have an umbrella you take it with you.
If it is not raining you do not take an umbrella with you.
If you do not have an umbrella at you current location you do not take one with you.

It rains with probability P.  What is the probability you get wet?

Offline Ender

  • Moderator
  • Hero Member
  • *****
  • Posts: 2398
    • View Profile
Re: Umbrellas
« Reply #1 on: April 13, 2008, 03:31:18 PM »
So I assume the guy doesn't just stay in his house all day? He leaves his home to go to work, stays at work for a while, then leaves to come back home. And I assume he doesn't go to, say, an outdoors picnic after work?

Offline Nate

  • Full Member
  • ***
  • Posts: 425
  • You all suck
    • View Profile
Re: Umbrellas
« Reply #2 on: April 13, 2008, 03:52:42 PM »
no just between the two places,

Offline Ender

  • Moderator
  • Hero Member
  • *****
  • Posts: 2398
    • View Profile
Re: Umbrellas
« Reply #3 on: April 13, 2008, 03:55:28 PM »
And does it only rain once on this day? And are we talking about one day only?

I feel like you need to clear some things up :P

Offline Nate

  • Full Member
  • ***
  • Posts: 425
  • You all suck
    • View Profile
Re: Umbrellas
« Reply #4 on: April 13, 2008, 06:15:21 PM »
Its called stochastic process.  Its raining with probability p whenever he leaves a state.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17928
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Umbrellas
« Reply #5 on: April 13, 2008, 06:39:12 PM »
So there are 2 states, A and B, and exactly one path between them. There is a probability, P, that on each move (A->B or B->A) it'll be raining. He starts with 2 umbrellas, one at each state, and if it's raining he'll always take it, and if not he always leaves it. What is the probability that he'll get wet on any given transition?

It's an interesting question, and I couldn't tell you the answer. I like it, though. :)

Offline Nate

  • Full Member
  • ***
  • Posts: 425
  • You all suck
    • View Profile
Re: Umbrellas
« Reply #6 on: April 13, 2008, 08:34:47 PM »
There is 3 states actually but you get the idea atleast

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17928
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Umbrellas
« Reply #7 on: April 13, 2008, 10:00:28 PM »
Well, I was trying to summarize the problem. But I think that was a hint. Hmm..

A: You're at a place with 0 umbrellas
B: You're at a place with 1 umbrella
C: You're at a place with 2 umbrellas

I drew up a state graph, and the only wet transition is A->C. I also wrote down the probability of each transition happening. However, I don't know what to do from here. It's been far too long since I worked with this stuff. :)



<edit> starting state is obviously B.

Offline Nate

  • Full Member
  • ***
  • Posts: 425
  • You all suck
    • View Profile
Re: Umbrellas
« Reply #8 on: April 13, 2008, 10:44:00 PM »
Whats the probability of being in state A? (Markov Chain)


<edit> It doesn't matter where you start, transitions are independent of past-states.  Only state that matters is the current one.
« Last Edit: April 13, 2008, 10:54:34 PM by Nate »

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17928
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Umbrellas
« Reply #9 on: April 13, 2008, 11:47:27 PM »
Whats the probability of being in state A? (Markov Chain)
*shrug* and I don't want to learn. :)


<edit> It doesn't matter where you start, transitions are independent of past-states.  Only state that matters is the current one.
Doesn't help. :)

Offline Ender

  • Moderator
  • Hero Member
  • *****
  • Posts: 2398
    • View Profile
Re: Umbrellas
« Reply #10 on: April 14, 2008, 03:26:06 AM »
Its called stochastic process.  Its raining with probability p whenever he leaves a state.

Okay, thanks. The problem sounds cool but I won't be able to get around to it for another week since I have so much schoolwork due this week.

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10326
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Umbrellas
« Reply #11 on: April 15, 2008, 05:12:46 AM »
If he has an umbrella at both home and work, his chance of getting rained on while commuting is zero, because if it's raining he will have an umbrella handy.

Now, say it rains one day and he does NOT return his umbrella to work after taking it home with him to stay dry. From there, if it is raining and he is commuting home<->work, his chance is 50%, as one place has an umbrella and one doesn't, at a ratio of 1:1.

The same situation goes for commuting home<->[non-work]. Unless he borrows an umbrella.

So, I guess the logical answer would be 0+50+50/3 = 33% chance of getting rained on during a commute, AFTER his umbrella is moved from one place to another. If it's returned, or not yet moved, read on:


Say he does return the umbrella, or it hasn't been moved yet. He always has a 0% chance of getting wet while commuting home<->work. If he is traveling home<->[non-work], this remains at 50%. So, then it's 0+50/2, so 25% chance.

EDIT -
(4:23:24 AM) [x86] Ender: btw I don't really have time to read through the problem/solution that much, but just because of your conditions "if he does this, probability is this" and "if he does that, prob. is this"
(4:23:34 AM) [x86] Ender: i think it's wrong b/c of that, though i think you're thinking along the right lines
(4:24:04 AM) [x86] Joe: Yeah, that problem isn't all that great cause there's external factors.
(4:24:18 AM) [x86] Joe: For example, him getting wet is dependant on the probability it's raining when he's outside.
(4:24:36 AM) [x86] Joe: I just tried to figure out if he'll have an umbrella, should it be raining when he's outside.
« Last Edit: April 15, 2008, 05:26:04 AM by Joe »
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline topaz~

  • Full Member
  • ***
  • Posts: 292
    • View Profile
Re: Umbrellas
« Reply #12 on: April 15, 2008, 05:48:03 AM »
Do we make the assumption that, if I should have an umbrella, and it is raining, that I would use it?

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17928
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Umbrellas
« Reply #13 on: April 15, 2008, 08:08:51 AM »
Do we make the assumption that, if I should have an umbrella, and it is raining, that I would use it?
No, you don't make that assumption, it's specifically stated in the problem.

Offline Nate

  • Full Member
  • ***
  • Posts: 425
  • You all suck
    • View Profile
Re: Umbrellas
« Reply #14 on: April 15, 2008, 12:35:30 PM »