[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Ok guys, bare with me, this has potential to be REALLY stupid.

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 14
Thread images: 2

File: Python Pseudo Random.png (3KB, 194x22px) Image search: [Google]
Python Pseudo Random.png
3KB, 194x22px
Ok guys, bare with me, this has potential to be REALLY stupid.

From my understanding the function in pic related generates random variables based on the Normal Distribution. So a lot of the "random" numbers from this function will be close to the mean. The further the number is from the mean, the less likely the function will generate it.

Is there some kind of way to randomly generate things with a focus on it being outside of the mean? Like, is there a way to put a Normal distribution upside down and model numbers based on that?

Thanks.
>>
>>8661897
f my life i thought i was posting in the stupid questions thread

please forgive
>>
File: IMG_1138.gif (1MB, 320x240px) Image search: [Google]
IMG_1138.gif
1MB, 320x240px
>>8661899
>>
>>8661897
Well the equation that function is using can be found here:
https://en.wikipedia.org/wiki/Normal_distribution
If you want the values to be "swapped" (low near the mean and high near the edges) I would just take the complement. So your probability distribution should be 1-f(x). This will of course change the total probability to be much greater than 1 (since the normal distribution approaches zero near the edges, this new distribution will approach 1 near the edges). I don't think it's possible to normalize this curve because it involves dividing by infinity, so it wouldn't be a true probability distribution. But if your goal is to randomly generate things it should still work. If not try 1/f(x) instead of 1-f(x).
>>
You probably want a multimodal distribution.
>>
So, what can't happen no matter how hard you try is to have a distribution (on R) with a probability density function that doesn't go to 0 at +inf and -inf. And it should go to 0 pretty fast, because the whole thing needs to integrate to 1.

So whatever you do, you can't hope to get rid of the fact that the PDF of your distribution is going to be as close to 0 as you want, almost everywhere. If you fix an epsilon>0, only on a negligible fraction of R will your PDF be larger than this epsilon.

Assuming nice things like continuity, what it implies is that you're going to have a finite amount of segments of R where your PDF is greater than epsilon (the exact number of those segments may depend on epsilon of course). In the case of the normal Gaussian, for any 0<epsilon<=1, you'll have exactly 1 segment of R for which your PDF is above epsilon, which will be centered at 0.

The simplest way to play on these segments to make it so that the mean isn't in one of them is to have two of these. For instance, have your distribution make a dome centered at -10 and a dome centered at +10, symmetrically, and drop back down to very small values in between (potentially even 0 if you want).

That way, the random numbers you get are far from the mean (you can control how far by choosing where to place your domes).

What you can't do, however, is make a distribution so that the further a number is from the mean, the more likely you are that this number will be drawn. That would make your PDF too large at +inf and -inf to satisfy the condition that it has to integrate to 1.
>>
>>8661908
But you can't generate a random number that follows the probability density function 1-f you are talking about, as it's not a probability density function. How would you do it?

1/f doesn't work either.

Defining a normal Gaussian and taking the inverse of the result "works", and it defines a valid bimodal distribution, but unfortunately that distribution doesn't have a mean, so it doesn't work for OP.
>>
>>8662207
I think the mean would still be the same, as you're averaging an approximately equal amount of positive infinite values and negative infinite values (at least in the limit).
>>
>>8662233
Yeah, but the thing is, it's not enough to have a symmetric pdf for the mean to be zero. You also need x*pdf(x) to be integrable. Here, it isn't. It's like considering the sum from n=-inf to n=+inf of n: sure you can pair each term with its opposite and argue that the result must be zero, but in fact you can pair them up in other ways and get a different result.

The first answer to http://math.stackexchange.com/questions/646428/mean-and-variance-of-reciprocal-normal-distribution shows exactly why there is no mean in this case.
>>
>>8662201
>So, what can't happen no matter how hard you try is to have a distribution (on R) with a probability density function that doesn't go to 0 at +inf and -inf.

note that [math]\sum_{k=1}^{\infty} k/2^k=1[/math]. now consider placing a rectangle of height k and width 2^{-k} at each positive integer k.
>>
>>8662837
You're right. I guess it's not a "going to 0" thing, more of a "the integral that remains after a certain point goes to 0". I had the discrete version of your example in mind, but for some reason it didn't occur to me that you could make it in a continuous setting, or even with a smooth pdf if you wanted to.
>>
>>8662159
This is what you want to look at OP. Something who's highest frequency outcomes are such that they will average out to something else. In the event of something with two peaks, the average will be somewhere in the valley.
>>
>>8661897
Since the distribution is usually just

f: R -> R

You can shift every element in the domain to form some subset of R.

otherwise, you can change the function itself provided you can normalize it.

This way, you can shift the mean to a new value from what it would have been otherwise.
>>
How about a function of the form [math]x^2e^{-x^2}[/math]?

The values you pick will largely come from two "mounds" either side of the mean and the probability density at the mean will be zero.
Thread posts: 14
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.