de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Distribution functions for occurrences of specific events
PostPosted: Wed Apr 18, 2018 12:20 pm 
Offline
Regular
For example when playing a game with condition that one gets to cum after a maximum of x days. On possibility to solve this is to get x random numbers [0,1,..,x-1] and if it is 0 one gets to cum on the first day, it is 1 one gets to cum on the second day and so on. Per day there is a 1/x*100 % chance to cum with an mathematical expectation of (x+1)/2.
When one gets to cum after a maximum of 10 days there would be a cum chance of 10% per day-1 with a mathematical expectation of 5,5.

But this is pretty boring and not very realistic. I think it would be more convincing when the chances get higher every day. For example for a maximum of 5 days it could look like this: chances=[5,10,15,30,40]
(Index of chances[] represents the day-1 and the value represents the chance of cumming on that day in %. Sum of chances[] should be 100)

Furthermore I could imagine that is even more interesting if the user could not just be able to configure the maximum of days but also the expected value (EV)/ mathematical expectation at what day are the highest chance, and the chance gets more and more lower the more the actual value gets away from the EV (I hope you can understand what I mean, if not please ask)
Here is an example what I mean with that, max days= 5, EV = 3:
chances=[10,20,40,20,10]

This means it is most likely that on gets to cum on the 3. day (user defined EV=3): 40%.
Less likely on the 2. and 4 day: 20% (EV +/- 1)
and least likely on day 1 and 5: 10% (EV +/- 2)

Any suggestions or opinions and how to generate such probabilities lists automatically?


Top
 Profile Send private message 
 
 Re: Distribution functions for occurrences of specific event
PostPosted: Wed Apr 25, 2018 10:41 pm 
Offline
Addict
Hi vladl,

as a general approach I'd suggest you use one of the "well known" distribution-functions, generate a random value between zero and one and find the point, where the cumulative distribution function is above your random value.

There are several discrete distribution functions which could be used for this. The binomial distribution may be what you want or at least it could be a good starting point as it has two parameters that let you tune the center and width easily. The poisson distribution may be another candidate. It has only one parameter but the cdf is quite easy to calculate.

There are library-functions available in the math3-Package. Unfortunately this is not included with sexscripts.

Implementing distribution functions yourself will be quite cumbersome in most cases. Because of that it may be better to locate a table in the internet and copy it to a data-stucture. An alternative may be to feed one of the online-calculators available at a lot of maths/physics websites and use its result.

Alternatively you could ask doti to include the parts of math3 needed with sexscripts.


Top
 Profile Send private message 
 
 Re: Distribution functions for occurrences of specific event
PostPosted: Thu Apr 26, 2018 9:32 am 
Offline
Site Admin
User avatar
Well, the licence is compatible, but its 1.9Mb only for this (desktop and Android packages are currently only 9Mb), so I'm not very fond of the idea of including it as a standard package. Some other writers want it ?

Edit: anyway, a one-liner, because groovy is easy :
Code:

def day = 2 //first is 0
def chances = [10,20,40,20,10]
if(getRandom(chances.sum()) < chances[0,day].sum()) {
   show("Cum today")
}



Top
 Profile Send private message 
 
 Re: Distribution functions for occurrences of specific event
PostPosted: Thu Apr 26, 2018 5:46 pm 
Offline
Addict
doti wrote:
Well, the licence is compatible, but its 1.9Mb only for this (desktop and Android packages are currently only 9Mb), so I'm not very fond of the idea of including it as a standard package.


True, this is too big. Especially as there won't be many other uses for this library in the context of sexscripts.


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010 - 2020
This website uses session cookies only.