# Find the CDF and use it to find all the medians

Show that for every $$p$$, $$0\leq p\leq 1$$, the function $$f(x)$$ = $$p*sin(x) +(1-p)*cos(x)$$, $$0\leq x \leq \pi/2$$, and $$f(x)=0$$ otherwise, is a density function. Find its CDF and use it to find all the medians.

I was able to prove it a density function and also was able to get the CDF which is $$(p +\sin(x) -p(\sin(x) + \cos(x))$$ ; $$0\leq x \leq \pi/2$$ and $$1$$ for $$x\geq \pi/2$$ and $$zero$$ elsewhere. (I hope I am correct)

I don't understand the last part. What do they mean by finding all the medians?

• It means to derive a formula that is valid for any $p$, like a median$(p)$ function. You know that the median of Uniform$(a,b)$ is $(b-a)/2$. Do the same for your situation. – Dave Jan 11 at 23:56
• You probably should add the self study tag. – Michael R. Chernick Jan 12 at 0:04
• I still can't figure it out. If I put it equal to 0.5, I have an equation with two variable p and x. How can I solve this? – Leaderboard281923 Jan 12 at 0:10
• Solve for $x$ to get the value that is the median. Write $x$ as a function of $p$. And, yes, self-study rag, please. – Dave Jan 12 at 0:24
• Cross-posted at math.stackexchange.com/questions/3505774/…. – JimB Jan 12 at 3:27

First median is defined where $$F(x)=0.5$$. Right now you have a CDF that is defined in terms of $$p$$ and $$x$$ and it is possible to define the median in terms of $$p$$(I did not check if your CDF is correct or not since it is your task). You can think of $$p$$ as a parameter and thus no need to worry if you have a definition that have $$p$$ in it
• I can't solve the equation when I am equating it to 0.5 I tried substitution $sin$$x=t$ but still nothing. – Leaderboard281923 Jan 12 at 19:36