Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

|
Options

bobbym
2013-12-08 13:03:25

No, that is a PDF. The random variate command constructs an array of random numbers that obey that PDF.

Agnishom
2013-12-08 12:55:39

myPDF[]=ProbabilityDistribution[2(1-1/x^2),{x,1,2}];

Is that an array construct?

gAr
2013-09-02 01:58:56

Anyway, i'll try..
See you later.

bobbym
2013-09-02 01:56:31

I prefer it too but I am afraid that it will always be like a second language to me. When you begin with procedural you are poisoned for life. See you later, got to get off.

gAr
2013-09-02 01:52:25

No problem, i'll explore more into the functional stuff..

bobbym
2013-09-02 01:47:44

Oh sorry, I did not understand. I thought you meant program size.

gAr
2013-09-02 01:44:15

Hi,

I meant the size of the whole package..

bobbym
2013-09-02 01:17:14

Hi;

It is light in m too.

gAr
2013-09-02 00:56:08

Okay, it's very lightweight when compared to other functional programming languages, so I'm fascinated!

bobbym
2013-09-02 00:46:38

Hi gAr;

You can post it and thanks for doing so.

gAr
2013-09-02 00:33:58

Hi,

Hope you don't mind replying to old ones, I'll post code whichever I'll be able to come up with!

J:

#### Code:

samp=:1000000
f=:1+?samp\$0
fx=:2*(1-%f^2)
(+/%#)f*fx

≈1.61407

bobbym
2013-03-09 01:03:03

Solve the equation

for x. You get 2 solutions:

I used the second one.

anonimnystefy
2013-03-09 00:57:12

Well, since the PDF is 0 for x<0, the integral from 0 to x is exactly the CDF.

Yes, it is. But what range should I have for y?

bobbym
2013-03-09 00:53:06

The integral from 0 to x, repeat post #33

The inverse is in terms of y.

anonimnystefy
2013-03-09 00:50:11

What do we need?

Oh, and I get

for the inverse.