# How do I calculate the mass density, given the mass?

1. Jul 29, 2012

### silmaril89

Let's say you have the mass of an object as a function of position, how would I go about finding the mass density as a function of position? I want a general answer, one that doesn't assume the mass has uniform density (that would be trivial).

As an example, can you solve this?

Say you have a ring of radius 1 with its center at the origin of a cartesian coordinate system. You are given that the mass $M(x,y) = \frac{4}{\pi} x y$. Find the mass density of the ring.

The reason I want to do this, is to find the total mass of some object given the mass as a function of position, but in order to do the necessary integral it seems I need the mass density.

Any help would be greatly appreciated

2. Jul 29, 2012

### Staff: Mentor

Mass as a function of position doesn't make much sense. (At least not for a continuous distribution.) Given the mass density as a function of position, you can integrate to find the total mass. Are you sure that's not what you are thinking of?

3. Jul 29, 2012

### silmaril89

I'm sure. I understand how it doesn't make much sense to think of mass as a function of position. I have another question that led me to this one. The real question is about probability density. I have that the probability of some thing occurring to be $P(x,y) = \frac{4}{\pi} x y$, but I want the total probability of this thing occurring if I don't know x or y. I figured I need the probability density, how would I get this?

4. Jul 29, 2012

### mikeph

Your analogy is correct- it would only make sense if P is the probability density. In the same way that a point can't have a (finite) mass, one single event out of an infinite number of possibilities cannot have a (finite) probability. You can, however, specify the amount of mass in an infinitesimal volume, dm = density*dV, and you can specify the probability of an event occurring in the infinitesimal range of a continuous space of possible outcomes.

eg. if P is the actual probability then the outcome (1,1) has a probability of 4/pi of happening, which is greater than 1 and completely nonsensical.

Last edited: Jul 29, 2012
5. Jul 29, 2012

### silmaril89

Yes, but the specification is that P(x,y) is only valid on a ring of radius 1 (i.e. (1,1) is not a valid point).

Basically, I have the probability of an event occurring being equal to $P(x,y) = \frac{4}{\pi} x y$, but the issue is that I don't know what the probability for the event to occur if the position (x,y) is random and only on a ring of radius 1. What can I do?

Last edited: Jul 29, 2012
6. Jul 29, 2012

### mikeph

That's a fair point, but here's another reason P cannot be a probability- consider two arbitrarily close points in this space- (x,y) and (x+dx, dy). The probabilities of each of these two events occurring are P(x,y) and P(x+dx,dy), and so the probability of either occurring is P(x,y) + P(x+dx,y). Now let's add a third probability- P(x+2*dx, dy). The probability of any of these three occurring is the sum of each of the probabilities.

This becomes problematic very quickly because we are adding together finite (nonzero) quantities, but we haven't specified how small dx is- it can be so arbitrarily small that this sum contains infinitely many nonzero terms - leading to an infinte probability - within a finite space, or region of possible outcomes. To deal with this you need to multiply P by the area element dxdy to keep the probability within an infinitely small possibility space infinitely small.

One more reason might help explain this- the units don't make sense. If x spans some range of possibilities, then it could have a dimension, but the probability must be dimensionless. For example, if x and y are lengths, say, distance from the bullseye of an archery board, then P has units of m^2. But expressing a probability in units of area doesn't make sense.

7. Jul 29, 2012

### Staff: Mentor

The easiest thing to do will be to re-write the PDF as a function of one variable, e.g. P(θ). Btw, your function cannot be a valid PDF over the whole unit circle because it has negative values.

8. Jul 29, 2012

### silmaril89

$$P(\theta) = \frac{4}{\pi} \mid \sin \theta \cos \theta \mid$$

9. Jul 29, 2012

### mikeph

In this case the probability that the event will occur in the range (θ1,θ2) is

∫P(θ)dθ from θ1 to θ2

P(θ) is the PDF, not the probability.

There is one more issue, P(θ) is not normalised.

10. Jul 29, 2012

### silmaril89

Normalization is tough, but I just divided by ($\theta_2 - \theta_1$), but something tells me that isn't right.

11. Jul 29, 2012

### mikeph

Wolfram alpha is a great tool for this stuff

http://www3.wolframalpha.com/Calculate/MSP/MSP10821a2c28b265g1d9a800005305h834i2614295?MSPStoreType=image/gif&s=26&w=167&h=35 [Broken]

P(θ) = (1/2)*|sin(θ)cos(θ)| should be correct

Last edited by a moderator: May 6, 2017
12. Jul 29, 2012

### Staff: Mentor

Yes, that is non-negative everywhere and integrates to 1 over -π < θ < π.