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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:01:57+00:00 2026-05-18T21:01:57+00:00

How can I generate a pseudo-random number (preferably in Lua), where the generator has

  • 0

How can I generate a pseudo-random number (preferably in Lua), where the generator has a higher probability of giving small numbers?

In my case, I want to give a random score in a game, where it’s common to obtain the lower scores, but higher ones appear rarely.
I’ve seen weighted random number generators that use a table, but it doesn’t fit my plan. I just want to specify the minimum (0) the maximum (variable) and ensure most numbers stay low.

I am sure this is possible with a simple mathematical operation, but I cannot remember which one it was. Like to filter the regular output of math.random, no need for a really random generator.

  • 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-18T21:01:58+00:00Added an answer on May 18, 2026 at 9:01 pm

    This may not be what you’re looking for, since it’s not a smoothly biased bell curve, but why not create two steps? Define a probability of getting a lower-range score and if you match it, your range is the lower range. Otherwise, your range is from the top of the low range to the end of the high range.

    The net effect is that you’d usually get a low score, but sometimes you’d get high scores. I bet it would look pretty good, and is very simple.

    What do you think?

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

Sidebar

Related Questions

Duplicate: Unique random numbers in O(1)? I want an pseudo random number generator that
How can I generate a (pseudo)random alpha-numeric string, something like: 'd79jd8c' in PHP?
I'm in need of a C++ (pseudo, i don't care) random number generator that
I'm working on a small app where I can generate a list of barcodes.
In F#, you can generate a set of numbers, just by saying [1..100]. I
I know how to generate a random number between 0 and 1 using the
I need to be able to generate a single random number and then use
Possible Duplicate: True random number generator I have worked with random functions in python,ruby,
Is there a way to generate random number on Windows by reading from a
I am developing a program in which I need to generate a random number

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.