Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6649231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:44:58+00:00 2026-05-26T00:44:58+00:00

What does it mean to say do this with probability p? Does it mean

  • 0

What does it mean to say “do this with probability p”? Does it mean that if p > 0.5, we will do “this”?

How would you write the code or algorithm for doing something with the probability p?

Thank you,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:44:58+00:00Added an answer on May 26, 2026 at 12:44 am

    No, it’s more or less: choose a random number between 0 and 1 then, if that’s is less than or equal to p, do something.

    For example, say p is equal to 0.75 (do something with a probability of 75%). When selecting random numbers in the range 0 through 1, about 75% of them will be 0.75 or less.

    In terms of programming, you could code this up as (pseudo-code, obviously):

    def do (action, probability):
        if rand() <= probability:
            action
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What does this mean exactly? I'm doing something like this: File.Copy(@\\foo\bar\baz.txt, @c:\test\baz.txt); MSDN doesn't
when they say static classes should not have state/side effects does that mean: static
Does that mean that I can't share a Form between delphi 2007 and 2009?
What does it mean that a Transaction Log is Full? I have it the
What does it mean to call a class like this: class Example { public:
What does it mean to say - Engineering scalability into applications. Are there design
User.should_receive(:update_attributes).with({'these' => 'params'}) What does that statement mean? these isn't instantiated anywhere as meaning
All source code hosting services have size limits. I am wondering that does that
I'm sure MongoDB doesn't officially support joins. What does this mean? Does this mean
What does it mean to create an instance variable, say @foo in a file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.