Re: simplifying quotient of piecewise functions
- To: mathgroup at smc.vnet.net
- Subject: [mg97003] Re: simplifying quotient of piecewise functions
- From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
- Date: Sun, 1 Mar 2009 04:58:38 -0500 (EST)
- References: <gob808$g96$1@smc.vnet.net>
Tom,
As far as I can see you have not built your Piecewise construction
correctly. Look in the basic example sextion of the Piecewise doc page
for information how to do this as either a 2D displayed function (with
esc pw esc and ctrl-, and ctrl-enter) or a 1D InputForm function,
using the formal Piecewise syntax.
One thing that is missing is a default value in case the conditions
are false. You can do without (and then you get the default of 0), but
is often safer to state your assumptions explicitely.
The main problem is the combination of the two conditions for chi and
psi. You used a comma, whereas you should have used the logical AND
(&& or esc-&&- esc).
After correcting these errors Simplify or PiecewiseExpand work just
fine. I get:
Piecewise[{{Indeterminate, \[Psi] > 1 || \[Psi] <
0}, {(2*\[Chi] + \[Psi])/(4 + 2*\[Psi]),
0 <= \[Psi] <= 1 && 0 <= \[Chi] <= 2}}, 0]
Cheers -- Sjoerd
On Feb 28, 1:43 pm, Tom Roche <tlro... at gmail.com> wrote:
> I'm solving some conditional probability density functions. One
> solution involves a division such that the numerator is
>
> (1) \[Piecewise]1/5 (2 \[Chi]+\[Psi]) {0<=\[Chi]<=2,0<=\[Psi]<=
=1}
>
> and the denominator is
>
> (2) \[Piecewise]((2 (2+\[Psi]))/5) 0<=\[Psi]<=1
>
> For the quotient, Mathematica 7 is just giving me (1) over (2), rather
> than
>
> (3) \[Piecewise]((2 \[Chi]+\[Psi])/(2 (2+\[Psi])))
> {0<=\[Chi]<=2,0<=\[Psi]<=1}
>
> even when I append
>
> // Simplify
>
> and re-evaluate. Am I using the wrong syntax to get the simplified
> quotient? or am I wrong to expect (3)?