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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:53:51+00:00 2026-05-24T13:53:51+00:00

Say I’m pseudo-randomly picking a number from 1 to 50 every second for 100

  • 0

Say I’m pseudo-randomly picking a number from 1 to 50 every second for 100 seconds, and as time goes on the number picked is more likely to be greater. How could I structure such an algorithm?

For example: after 99 seconds the probability of choosing a number closer to 50 is much more likely than choosing a number closer to 1.

Or: the number picked after 10 seconds is more likely to be greater than the number picked after 9 seconds

  • 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-24T13:53:53+00:00Added an answer on May 24, 2026 at 1:53 pm

    I have a simple solution for you. Instead of rand(1, 50) (say this function generates uniformly random numbers 1..50) use this expression:

    power(rand(1, power(50, exp)), 1/exp)
    

    this will still give you all the numbers 1..50. For exp = 1, the distribution will be uniform. As you slightly increase exp (e.g. like 1.1 or so), the probability of getting larger numbers will increase. The higher the exp, the more it will increase towards 50.

    So you can do e.g.:

    factor = 1 /* finetune this for your needs */
    for second = 0..100
        exp = 1 + (second / 100) * factor
        rand_num = power(rand(1, power(50, exp)), 1/exp)
    endfor
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a SqlAlchemy model something like this: from sqlalchemy.ext.declarative import declarative_base from
Say I have a byte array with 100,000 bytes in it. I want to
Say some programmer gives me an executable jar (from Java code) along with the
Say I have the following code: private Integer number; private final Object numberLock =
Say my web app has two spring cron jobs scheduled to run every minute/hour.
Say I have an HTML form like this to collect an email from a
say if I wanted to give every user that registered on my site a
Say, if I don't call super.onPause in a override method from superclass Activity ,
Say you have a page callback from Module #1 using hook_menu(). You want to
Say we have the following method: private MyObject foo = new MyObject(); // and

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.