[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 205 KB, 1524x1524, 0864200.jpg [View same] [iqdb] [saucenao] [google]
7521369 No.7521369 [Reply] [Original]

I am automating a task for work that requires an action to be performed by a computer N times per day. I want most of the total of N actions, say, 70%, to happen between 01:00 AM and 03:00 AM and the rest to spread over the remaining 22 hours with a gradual change in density. What is a good way to generate those N points in time automatically? It there a name for this kind of problem?

>> No.7521377

Well I'm not math person at all, but I would define 2 functions. a function that distributes 70% of your N actions between 1am and 3am, and another that distributes 30% of N functions from 3am to 1am. I don't understand what you mean by a gradual change in density, but account for that in the second function somehow.

>> No.7521384

>>7521377
I'm guessing he wants like 5% done at one minute, and 6% at another, etc.

>> No.7521386

>>7521384
Yes, that's what I mean by "a gradual change in density".

>> No.7521391 [DELETED] 

>>7521369
let's say -10 is 2pm (the day before) and +14 is 2pm for that same day.
Let's also say that your function is symetrical around 2am. (so 2).

You can use the normal distribution to attribute density of tasks :
<span class="math"> f(t) = \frac{1}{sqrt{2 \pi \sigma^2}} e^{-\frac{(t-2)^2}{2*\sigma^2}}[/spoiler].

you set sigma such as <span class="math">\frac{\int_{1}^{3} f(x)dx}{\int_{-10}^{14} f(x)dx} = 0.7[/spoiler].
Lucky for you, sigma is easy to find since 68% of the "mass" is contained within one sigma of the average (which we took as 2).

so you want sigma = 1, and ~68% of the action will take place between 1 and 3am.

I'll let you distribute the N tasks using this, you already have the density distribution : <span class="math"> f(t) = \frac{1}{sqrt{2 \pi }} e^{-\frac{(t-2)^2}{2}}[/spoiler]

>> No.7521395

>>7521391
>>7521369
>>7521391
sorry, here is the same message with the correct square roots :


let's say -10 is 2pm (the day before) and +14 is 2pm for that same day.
Let's also say that your function is symetrical around 2am. (so 2).

You can use the normal distribution to attribute density of tasks :
<span class="math"> f(t) = \frac{1}{\sqrt{2 \pi \sigma^2}} e^{-\frac{(t-2)^2}{2*\sigma^2}}[/spoiler].

you set sigma such as <span class="math">\frac{\int_{1}^{3} f(x)dx}{\int_{-10}^{14} f(x)dx} = 0.7[/spoiler].
Lucky for you, sigma is easy to find since 68% of the "mass" is contained within one sigma of the average (which we took as 2).

so you want sigma = 1, and ~68% of the action will take place between 1 and 3am.

I'll let you distribute the N tasks using this, you already have the density distribution : <span class="math"> f(t) = \frac{1}{\sqrt{2 \pi }} e^{-\frac{(t-2)^2}{2}}[/spoiler]

>> No.7521401

>>7521395
Wow, I actually understand that. Brilliant! Thanks!

Any hints on where I can pick up enough probability to solve these types of problems on my own?

>> No.7521406

>>7521401
My pleasure anon !

I would say any course or book that treats of probability distributions is enough.

At first I wanted to use a simple law like f(t) = A(x+10)(x-14) (no activity at 2pm, maximum activity at 2am), but as expected one parameter is not enough.
You need one parameter to make the function a density (total integral equal to 1), and another to control the spread.
So the next most simple (and smooth) distribution I could think of was the normal distribution.