Math Help Forum

Math Help Forum Feed Site Feed

Go Back   Math Help Forum > University Math Help > Advanced Probability and Statistics
Reply
 
Thread Tools Display Modes
  #1  
Old February 23rd, 2009, 05:06 PM
Junior Member
 
Join Date: Jun 2008
Posts: 27
Country:
Thanks: 23
Thanked 0 Times in 0 Posts
mander is on a distinguished road
Question [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?
Reply With Quote
Advertisement
 
  #2  
Old February 23rd, 2009, 07:27 PM
mr fantastic's Avatar
Flow Master

 
Join Date: Dec 2007
Location: Zeitgeist
Posts: 12,237
Country:
Thanks: 2,574
Thanked 4,761 Times in 4,193 Posts
mr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond repute
Default

Quote:
Originally Posted by mander View Post
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.
Reply With Quote
The following users thank mr fantastic for this useful post:
Donate to MHF
  #3  
Old February 23rd, 2009, 07:55 PM
Junior Member
 
Join Date: Jun 2008
Posts: 27
Country:
Thanks: 23
Thanked 0 Times in 0 Posts
mander is on a distinguished road
Default

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
Reply With Quote
Reply

Tags
probabilities, probability, program, programming, pseudocode

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -7. The time now is 07:03 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
©2005 - 2009 Math Help Forum


Math Help Forum is a community of maths forums with an emphasis on maths help in all levels of mathematics.
Register to post your math questions or just hang out and try some of our math games or visit the arcade.