Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
random methods
#13
(Sep-04-2022, 05:15 PM)Skaperen Wrote: i don't understand lines 19 and up to know how to confine the curve to where i need it to be.
lines 17 and up are only additional code that allow scipy to deduce graphically a density curve from a set of experimental data. You don't need these lines.

The sleeping_time() function is the useful function that generates the data. It simply uses a bell curve (mathematically called a gaussian function) to generate the points, and it confines the curve where it need to be simply by rejecting the values that are below the min or above the max. It amounts to simply truncating the bell curve.

To describe the rejection method, the average height of american males is about 175.3 cm according to Wikipedia. We take a random US citizen, if his height is between 160 and 190 cm we accept the value, otherwise we take another citizen until we find one in that range. It is a very simple idea.
Reply


Messages In This Thread
random methods - by Skaperen - Sep-02-2022, 12:23 AM
RE: random methods - by ndc85430 - Sep-02-2022, 05:49 AM
RE: random methods - by Gribouillis - Sep-02-2022, 06:28 AM
RE: random methods - by Skaperen - Sep-02-2022, 05:32 PM
RE: random methods - by Skaperen - Sep-02-2022, 05:39 PM
RE: random methods - by Gribouillis - Sep-02-2022, 07:38 PM
RE: random methods - by Skaperen - Sep-02-2022, 10:27 PM
RE: random methods - by Gribouillis - Sep-03-2022, 06:45 AM
RE: random methods - by Skaperen - Sep-04-2022, 12:23 AM
RE: random methods - by Skaperen - Sep-04-2022, 12:29 AM
RE: random methods - by Gribouillis - Sep-04-2022, 07:48 AM
RE: random methods - by Skaperen - Sep-04-2022, 05:15 PM
RE: random methods - by Gribouillis - Sep-04-2022, 05:45 PM
RE: random methods - by Skaperen - Sep-26-2022, 05:42 AM
RE: random methods - by Gribouillis - Sep-26-2022, 12:08 PM
RE: random methods - by Skaperen - Sep-26-2022, 06:18 PM
RE: random methods - by Skaperen - Sep-28-2022, 10:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  help on random methods jip31 2 2,071 Apr-29-2021, 12:15 PM
Last Post: jip31

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020