0

I have a problem with computing the value of constant $C$ and quartile Q2.

The task is that feature X has a density $f(x)$, $f(x) = -\infty < x < \infty$ , defined as:

$$f(x) = \left\{ \begin{array}{ccc} x^3-x & \mbox{if} & x \in [-1,0] \\ C\cos(2x) & \mbox{if} & x \in [0,\pi/4] \\ 0 & & \mbox{otherwise} \end{array}\right.$$

How should I do this?

Thank you in advance.

Bill Cook
  • 29,244
Ganjira
  • 115
  • Probability sums to unity. Then you need to find the value of $x$ the yeilds the quartile you desire. – Chinny84 Oct 16 '15 at 15:33

1 Answers1

1

You need that $f(x) \geq 0$ for all $x$ (which is true as long as $C \geq 0$). Next, you need $\int_{-\infty}^{\infty} f(x)\,dx=1$.

Clearly, $$\int_{-\infty}^{\infty} f(x)\,dx= \int_{-1}^0 (x^3-x)\,dx + \int_0^{\pi/4} C\cos(2x)\,dx$$

Compute the integral from $-1$ to $0$ and then the integral from $0$ to $\pi/4$. Add them together, set equal to $1$, and solve for $C$.

Bill Cook
  • 29,244