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

  • Home
  • SEARCH
  • 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 64257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:45:41+00:00 2026-05-10T18:45:41+00:00

How can I set points on a 24h period spreaded by the Gaussian distributions?

  • 0

How can I set points on a 24h period spreaded by the Gaussian distributions? For example to have the peak at 10 o’clock?

  • 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. 2026-05-10T18:45:42+00:00Added an answer on May 10, 2026 at 6:45 pm

    The following code generates a gaussian distributed random time (in hours, plus fractions of an hour) centered at a given time, and with a given standard deviation. The random times may ‘wrap around’ the clock, especially if the standard deviation is several hours: this is handled correctly. A different ‘wrapping’ algorithm may be more efficient if your standard deviations are very large (many days), but the distribution will be almost uniform in this case, anyway.

    $peak=10; // Peak at 10-o-clock $stdev=2; // Standard deviation of two hours $hoursOnClock=24; // 24-hour clock  do // Generate gaussian variable using Box-Muller {     $u=2.0*mt_rand()/mt_getrandmax()-1.0;     $v=2.0*mt_rand()/mt_getrandmax()-1.0;     $s = $u*$u+$v*$v; } while ($s > 1); $gauss=$u*sqrt(-2.0*log($s)/$s);  $gauss = $gauss*$stdev + $peak; // Transform to correct peak and standard deviation  while ($gauss < 0) $gauss+=$hoursOnClock; // Wrap around hours to keep the random time  $result = fmod($gauss,$hoursOnClock);     // on the clock  echo $result; 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 74k
  • Answers 74k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer ybo's answer would have been my first response too. The… May 11, 2026 at 2:17 pm
  • added an answer As far as dynamic typing is concerned, boost::variant is a… May 11, 2026 at 2:17 pm
  • added an answer Maybe you should respond with a 406 Not Acceptable. That's… May 11, 2026 at 2:17 pm

Related Questions

How can I set up my crontab to execute X script at 11:59PM every
How can I set the background color of an HTML element using css in
How can I set the cookies in my PHP apps as HttpOnly cookies ?
How can I set, clear, and toggle a bit?
I have a View Controller I'm reusing to edit individual objects (NSString, NSNumber, NSDate)
In Python, I've seen the recommendation to use holding or wrapping to extend the
We have an external .js file that we want to include in a number
I'm struggling to understand something about GIT. We've got a repository with a number

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.