3
$\begingroup$

I have a function like this

$f(x,y)=c\,y\,(y-x),\ \text{for}\ 0<x<2,\;-x<y<x$

and I need to find the value of $c$ such that $f(x,y)$ is a PDF.

How can I do that?

I know that the condition is double integral $f(x,y)=1$, but how can I impose that condition with Mathematica?

$\endgroup$
1
  • $\begingroup$ Hello xmpirate! It is not clear that your question is about using the Mathematica software. Please indicate what you have tried, including any code that is not working for you. Belisarius has given an example in his answer, but perhaps your question is about something else. It is not very clear. $\endgroup$
    – Verbeia
    Oct 3 '13 at 2:27
3
$\begingroup$

You forgot the prior condition that the density must not be negative.
There are two solutions, depending on the sign of c.

If c is positive then Reduce[y(y-x) >= 0 && 0 < x < 2 && -x < y < x, {x,y}]

0 < x < 2 && -x < y < 0

gives the region over which f is non-negative, and c = 1/Integrate[y(y-x), {x,0,2}, {y,-x,0}]

3/10

If c is negative then Reduce[y(y-x) <= 0 && 0 < x < 2 && -x < y < x, {x,y}]

0 < x < 2 && 0 < y < x

gives the region over which f is non-negative, and c = 1/Integrate[y(y-x), {x,0,2}, {y,0,x}]

-3/2

$\endgroup$
5
$\begingroup$
s = Solve[Integrate[c y (y - x), {x, 0, 2}, {y, -x, x}] == 1]

Plot3D[c y (y - x) /. s[[1]], {x, 0, 2}, {y, -x, x}, PlotRange -> All, Mesh -> None, 
       PlotStyle -> Directive[Orange, Specularity[White, 40]], Filling -> Bottom]

(* {{c -> 3/8}} *)

Mathematica graphics

$\endgroup$
1
  • $\begingroup$ what is the range of y. $\endgroup$
    – xmpirate
    Oct 3 '13 at 1:44
3
$\begingroup$

The double integral gives a very simple value in terms of $c$

Integrate[c y (y - x), {x, 0, 2}, {y, -x, x}]
8 c/3

so the equation to be solved is a trivial one

8 c/3 == 1

that we can solve in our heads to get $c=\frac{3}{8}$.

$\endgroup$
0
$\begingroup$

Or just:

1/Integrate[y (y - x), {x, 0, 2}, {y, -x, x}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.