A very simple and direct question, I know. But there are, in my view, surprisingly few simple and direct answers on the net.

My question is, suppose I have the following equation $Y = 1/(C-(A-B))$ and $B$ is a random variable that follows the Normal distribution, say. How do I:

1: Use Mathematica to obtain the equation for $Y$?

2: Find the mean of the equation found in 1.

  • $\begingroup$ I don't understand the question. It seems $Y=1/B$. Perhaps show how'd you work it out by hand to clarify. $\endgroup$ – Szabolcs Jul 16 '18 at 13:16
  • $\begingroup$ @Szabolcs The equation simplifies, to 1/B. I will change it slightly to make it a little more useful. $\endgroup$ – user120911 Jul 16 '18 at 13:21
  • 1
    $\begingroup$ Maybe you want TransformedDistribution and Mean. $\endgroup$ – Szabolcs Jul 16 '18 at 13:21
  • $\begingroup$ Note that Mean won't work here as this particular $Y$ has no mean (doesn't converge). $\endgroup$ – Szabolcs Jul 16 '18 at 13:22
  • $\begingroup$ Perhaps in your item 1, you mean you wish to "obtain the distribution of $Y$", where you could be more specific: do you want an PDF? CDF? other means of representing the distribution of $Y$? For your item 2, since a mean need not exist, what sort of answer do you expect when the mean does not exist? $\endgroup$ – Eric Towers Jul 16 '18 at 18:52

Look up TransformedDistribution.

dist = TransformedDistribution[1/(b + 1), b \[Distributed] NormalDistribution[]]

enter image description here

PDF[dist, x]

enter image description here

You can use RandomVariate to sample or Mean to compute the mean. Note that this particular distribution has no mean though (so the calculation will fail).

  • $\begingroup$ While the Mean cannot be evaluated, the Median can and evaluates to 1/(1 - Sqrt[2]*InverseErf[ -1 + Erf[1/Sqrt[2]]]) or approximately 0.709826. You can also evaluate the modes with the primary mode at 1/2 and the secondary mode at -1 $\endgroup$ – Bob Hanlon Jul 16 '18 at 16:20

I'm not clear what you are after. You have given an equation for Y and you are asking to use Mathematica how to obtain the equation for Y. Why would you need to get as output what you have just specified using input?

If you mean that you want to simplify the equation, isn't this simply Y=1/B?

I think when you ask to find the mean of the equation, you mean that you want it expressed in terms of B. This isn't specifically a Mathematica problem.

There seems to be some interesting material elsewhere on StackExchange - look here:



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.