| 
February 23rd, 2009, 05:06 PM
| | Junior Member | | Join Date: Jun 2008
Posts: 27
Country: Thanks: 23
Thanked 0 Times in 0 Posts
| | [SOLVED] Simple Probability Question (Programming) Hi guys. So I have a simple probability question that involves a little pseudo-code. Just need some advice, not answers so I am not posting my whole question from my homework, just the part that is giving me confusion. You have a procedure that returns either 0 or 1. It returns 0 with some probability p and returns 1 with probability 1 - p, where 0 < p < 1. You do not know what p is.
What does it mean when it says it returns 0 with some probability p, and 1 with probability 1-p?
Since p is between 0 and 1, say p is for example, .75. Then when I run that subroutine, does it return 0 or 1? 1-0.75 is 0.25, but what, does it round down? | 
February 23rd, 2009, 07:27 PM
|  | Flow Master | | Join Date: Dec 2007 Location: Zeitgeist
Posts: 12,237
Country: Thanks: 2,574
Thanked 4,761 Times in 4,193 Posts
| | Quote:
Originally Posted by mander Hi guys. So I have a simple probability question that involves a little pseudo-code. Just need some advice, not answers so I am not posting my whole question from my homework, just the part that is giving me confusion. You have a procedure that returns either 0 or 1. It returns 0 with some probability p and returns 1 with probability 1 - p, where 0 < p < 1. You do not know what p is.
What does it mean when it says it returns 0 with some probability p, and 1 with probability 1-p?
Since p is between 0 and 1, say p is for example, .75. Then when I run that subroutine, does it return 0 or 1? 1-0.75 is 0.25, but what, does it round down? | Well, if I said: You have a coin that returns either H or T when tossed. It returns H with probability 1/3 and returns T with probability 2/3
what do you think this means? If I toss the coin, what happens?
Now read this: Binomial distribution - Wikipedia, the free encyclopedia
__________________ There are two things you should never try to prove: the impossible and the obvious. The greater danger for most of us lies not in setting our aim too high and falling short; but in setting our aim too low and achieving our mark. (Michelangelo Buonarroti) To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | The following users thank mr fantastic for this useful post: | |  | 
February 23rd, 2009, 07:55 PM
| | Junior Member | | Join Date: Jun 2008
Posts: 27
Country: Thanks: 23
Thanked 0 Times in 0 Posts
| | OH! I get it now.  Thank you. I should be able to finish this assignment then. I just didn't understand the way they worded it... I'm not very used to probability terminology, I guess. And Thanks for the link! My prof never referred to our topic as binomial distribution or Bernoulli distribution so I didn't know how to research it further. That helps a lot.
Thanks again Mr. Fantastic | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -7. The time now is 07:03 PM. | | |
 | |  |