[ 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: 44 KB, 360x364, Retard-Horse-HERP-DERP.jpg [View same] [iqdb] [saucenao] [google]
1346474 No.1346474 [Reply] [Original]

if i have random number generator that generates any number from [0, 1, 2, ...] with equal probability, what would be the expectation value?

>> No.1346483

-∏

>> No.1346482

infinity

>> No.1346499

sex.

Cause that's what we're all up to.

>> No.1346504

>>1346482
ok, and for ... -3, -2, -1, 0, 1, 2, 3 it would be 0?

>> No.1346507

>>1346504
i mean ... -3, -2, -1, 0, 1, 2, 3, ...

>> No.1346525

>>1346482
i think its 0, because the probability of each number is zero. and an infinite sum over 0 is still 0...

>> No.1346531

i would agree 0>>1346474

>> No.1346540

a uniform unbounded distribution?
That would be maximum uncertainty!

>> No.1346553

1/∞

>> No.1346587

>sort of related

I use Math.random in javascript. Anyone has a quick way to make randomer(truer) numbers?

i have an algorithm that makes divides the upper limit then adds the random numbers. so if I wanted a random number between 0 - 100. i would add Math,random(25) + Math,random(25) + Math,random(25) + Math,random(25). It kinda works but as you can see its extremely rare to get upper and lower bounds.. so...

>> No.1346771

>>1346587
i am not great at java but from what i understand math.random is only psuedo-random so use the largest divisor possible? i don't think dividing the upper limit is actually making the distribution less true. i think the opposite might be happening where the more trials (the blocks created by using the divisors instead of the upper limits) are showing the true nature of the distribution. or i could be completely wrong.

>> No.1346790

There is no expected outcome in cases where the probability of all outcomes is equal.

>> No.1346806
File: 8 KB, 251x217, 1273803025610.jpg [View same] [iqdb] [saucenao] [google]
1346806

>>1346587
Try
(Math.random()+Math.random())/2
Averaging two random numbers together makes it twice as random.

>> No.1346812

>>1346790
There is in finite cases. For example, the expected value of choosing at random {1,2,3} is 2... similarly E({1,2,3,4})=2.5

>> No.1346838

>>1346474
Impossible anyway. If it generated every number with equal probability p, then the total probability would be

P(1)+P(2)+P(3)+P(4)+P(5)+...= p+p+p+p+p...

which is either 0 or infinity depending on whether p is or isn't zero. In any case, it can't be 1 like it has to be.

>> No.1346853
File: 44 KB, 477x358, Hmm....jpg [View same] [iqdb] [saucenao] [google]
1346853

>>1346806

>> No.1346857

>>1346812
I don't know the actual meaning of expectation in this context, but I'd disagree with you. You're assuming that the usage of the number produced reflects the numerical value of that number.

Consider instead selecting at random from the set {yellow, crawdad, Thursday}. Would the expectation value be crawdad?

>> No.1346875

>>1346790
http://en.wikipedia.org/wiki/Expected_value

>> No.1346878

there is no random number generator that generates any number from [0,1,2,..] with equal probability.

>> No.1346896

>>1346587
Sawtooth(x)=arctan(tan(x))/pi+1/2
Sawtooth(x) has period pi

Rand(x)=Sawtooth(Math.random()*1000*new Date().getTime())
True random arguably doesn't exist on deterministic computers. This function will give you a uniform distribution (just like Math.random()).

>>1346857
http://en.wikipedia.org/wiki/Expected_value

>> No.1346913

but you could multiply a random number generator [0;1] with random sign - or + and multiply by a random constant

>> No.1346922

>>1346896
>http://en.wikipedia.org/wiki/Expected_value

Gotcha, thanks.

>> No.1346940

1, -1, 2, -2, 3, -3... <span class="math">\pm\infty[/spoiler]

>> No.1346968
File: 12 KB, 241x230, 1275021524423.jpg [View same] [iqdb] [saucenao] [google]
1346968

>>1346857
> S={yellow, crawdad, Thursday}
<div class="math">E(\mathbf{S})=\sum_i \mathbf{S}_i P(\mathbf{S}_i)</div>
E(S)=(yellow+crawdad+Thursday)/3

>> No.1346973

Lmfao, enjoy your shitty 'random' numbers that aren't really random

>> No.1346991

>>1346973
except "random" is just a concept

enjoy your theories.