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 7957931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:20:26+00:00 2026-06-04T04:20:26+00:00

In nearly any programming language, if I do $number = rand(1,100) then I have

  • 0

In nearly any programming language, if I do $number = rand(1,100) then I have created a flat probability, in which each number has a 1% chance of coming up.

What if I’m trying to abstract something weird, like launching rockets into space, so I want a curved (or angled) probability chart. But I don’t want a “stepped” chart. (important: I’m not a math nerd, so there are probably terms or concepts that I’m completely skipping or ignorant of!) An angled chart is fine though.

So, if I wanted a probability that gave results of 1 through 100… 1 would be the most common result. 2 the next most common. In a straight line until a certain point – lets say 50, then the chart angles, and the probability of rolling 51 is less than that of rolling 49. Then it angles again at 75, so the probability of getting a result above 75 is not simply 25%, but instead is some incredibly smaller number, depending on the chart, perhaps only 10% or 5% or so.

Does this question make any sense? I’d specifically like to see how this can be done in PHP, but I wager the required logic will be rather portable.

  • 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-06-04T04:20:27+00:00Added an answer on June 4, 2026 at 4:20 am

    The short answers to your questions are, yes this makes sense, and yes it is possible.

    The technical term for what you’re talking about is a probability density function. Intuitively, it’s just what it sounds like: It is a function that tells you, if you draw random samples, how densely those samples will cluster (and what those clusters look like.) What you identify as a “flat” function is also called a uniform density; another very common one often built into standard libraries is a “normal” or Gaussian distribution. You’ve seen it, it’s also called a bell curve distribution.

    But subject to some limitations, you can have any distribution you like, and it’s relatively straightforward to build one from the other.

    That’s the good news. The bad news is that it’s math nerd territory. The ideas behind probability density functions are pretty intuitive and easy to understand, but the full power of working with them is only unlocked with a little bit of calculus. For instance, one of the limitations on your function is that the total probability has to be unity, which is the same as saying that the area under your curve needs to be exactly one. In the exact case you describe, the function is all straight lines, so you don’t strictly need calculus to help you with that constraint… but in the general case, you really do.

    Two good terms to look for are “Transformation methods” (there are several) and “rejection sampling.” The basic idea behind rejection sampling is that you have a function you can use (in this case, your uniform distribution) and a function you want. You use the uniform distribution to make a bunch of points (x,y), and then use your desired function as a test vs the y coordinate to accept or reject the x coordinates.

    That makes almost no sense without pictures, though, and unfortunately, all the best ways to talk about this are calculus based. The link below has a pretty good description and pretty good illustrations.

    http://www.stats.bris.ac.uk/~manpw/teaching/folien2.pdf

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since python has way to do nearly everything I was wondering is there any
Does anyone have any good references for equations which can be implemented relatively easily
I have a nearly ready project in Cocoa, for which I want to add
I have searched google up and down but I can not find nearly any
Our SQL Server 2005 database has nearly 100 different tables. We are going to
I'm nearly done with a trackback system for my website, but have one last
I have nearly finished a free spellchecker library for Windows Mobile, and there are
I hate seeing nearly every directory in my repository list each file twice, once
I want to accomplish nearly the same thing as this question , which is
I have read nearly every single post about the activity not found to handle

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.