# Meaning of | In Mathematical Equation

**URL:** <https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337>\
**Category:** Factual Questions\
**Created:** [May 27, 2004, 2:09pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337 "2004-05-27T14:09:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon\_the\_Geek](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@Jon\_the\_Geek](https://boards.straightdope.com/u/Jon_the_Geek)\
**Post date:** [May 27, 2004, 2:09pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/1 "2004-05-27T14:09:01Z")

</div>

What does the | in a mathematical equation mean? For example, in this equation:  
f(theta|u) \<is proportional to\> f(u|theta)f(theta)  
what do the |'s mean?

I believe it’s something from linear algebra and/or statistics, but it isn’t ringing a bell from either. Granted, I took those classes about 10 years ago…

---

<div class="post-metadata">

**Author:** ![Shalmanese](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Shalmanese](https://boards.straightdope.com/u/Shalmanese)\
**Post date:** [May 27, 2004, 2:32pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/2 "2004-05-27T14:32:06Z")

</div>

Thats Conditional probability.

It means the probability of theta given u is the prob of u given theta times prob of theta

---

<div class="post-metadata">

**Author:** ![Jon\_the\_Geek](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@Jon\_the\_Geek](https://boards.straightdope.com/u/Jon_the_Geek)\
**Post date:** [May 27, 2004, 2:39pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/3 "2004-05-27T14:39:38Z")

</div>

> [@Shalmanese](#):
>
> Thats Conditional probability.
> 
> It means the probability of theta given u is the prob of u given theta times prob of theta

Hmm. Ok. MAYBE I can make sense of these equations (or, well, proportions) now, then. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [May 27, 2004, 4:14pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/4 "2004-05-27T16:14:33Z")

</div>

Another vote for conditional probability. You might also see | used as a NAND or a bitwise-or operator, but those are a little less common.

---

<div class="post-metadata">

**Author:** ![Sunspace](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sunspace/32/1250_2.png) [@Sunspace](https://boards.straightdope.com/u/Sunspace)\
**Post date:** [May 27, 2004, 4:36pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/5 "2004-05-27T16:36:46Z")

</div>

And if there’s 2 |'s with some stuff in between, it means ‘absolute value’ of the stuff. |2-5| = |-3| = 3.

But that’s probably way too basic.

---

<div class="post-metadata">

**Author:** ![tubbytreats](https://avatars.discourse-cdn.com/v4/letter/t/a87d85/32.png) [@tubbytreats](https://boards.straightdope.com/u/tubbytreats)\
**Post date:** [May 27, 2004, 4:44pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/6 "2004-05-27T16:44:03Z")

</div>

In most forms of C-based programming languages (C, C++, C#, PHP, JavaScript, Perl) the “|” pipe character is used to dentote OR in an if() statement.

```auto

if ( (I am cool) && (I am sweet) ) // AND
{
     I'm probably ice cream.
}

if ( (I am big) || (I am sweaty) ) // OR
{
     I'm probably a football player.
}

```

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [May 27, 2004, 4:48pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/7 "2004-05-27T16:48:16Z")

</div>

> [@Sunspace](#):
>
> And if there’s 2 |'s with some stuff in between, it means ‘absolute value’ of the stuff. |2-5| = |-3| = 3.
> 
> But that’s probably way too basic.

In general, |A| is used to denote the “size” of the object A, in whatever sense is appropriate.

For a set A, |A| is the number of elements. For a sequence of characters A, |A| is the length.

---

<div class="post-metadata">

**Author:** ![Pasta](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pasta](https://boards.straightdope.com/u/Pasta)\
**Post date:** [May 27, 2004, 5:20pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/8 "2004-05-27T17:20:19Z")

</div>

> [@Jon the Geek](#):
>
> f(theta|u) \<is proportional to\> f(u|theta)f(theta)

I’ll add that when | is used in this way, one could read your equation as:

“f of theta _given_ u is proportional to f of u _given_ theta times f of theta.”

---

<div class="post-metadata">

**Author:** ![js\_africanus](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@js\_africanus](https://boards.straightdope.com/u/js_africanus)\
**Post date:** [May 27, 2004, 5:35pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/9 "2004-05-27T17:35:35Z")

</div>

IIRC, | can also mean “such that.” For example, it might be an arguement in a function, “f of x, such that x is greater than seven” would be f(x|x\>7), or defining a thingie as in “B is defined to be the set of objects K, such that K is an even number” would be B:={K|K=2x} where x is a real number.

I think. IIRC, that is. Here is Mathworld’s result for the words “such that”:

[http://mathworld.wolfram.com/SuchThat.html](http://mathworld.wolfram.com/SuchThat.html)

Also:

> **[Mathematical Symbols](https://searchdatacenter.techtarget.com/definition/Mathematical-Symbols)**
>
> This table contains mathematical symbols and describes what each symbol is and how it is used.

> **[Glossary of mathematical symbols](https://en.wikipedia.org/wiki/Table_of_mathematical_symbols)**
>
> A mathematical symbol is a figure or a combination of figures that is used to represent a mathematical object, an action on mathematical objects, a relation between mathematical objects, or for structuring the other symbols that occur in a formula. As formulas are entirely constituted with symbols of various types, many symbols are needed for expressing all mathematics.
> The most basic symbols are the decimal digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9), and the letters of the Latin alphabet. The decima...

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [May 27, 2004, 5:41pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/10 "2004-05-27T17:41:08Z")

</div>

> [@js\_africanus](#):
>
> For example, it might be an arguement in a function, “f of x, such that x is greater than seven” would be f(x|x\>7)…

I’ve never seen this notation, and I’m not really sure exactly what it’s supposed to mean. Does it restrict x to be greater than 7?

---

<div class="post-metadata">

**Author:** ![chrisk](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@chrisk](https://boards.straightdope.com/u/chrisk)\
**Post date:** [May 27, 2004, 5:49pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/11 "2004-05-27T17:49:42Z")

</div>

> [@ultrafilter](#):
>
> I’ve never seen this notation, and I’m not really sure exactly what it’s supposed to mean. Does it restrict x to be greater than 7?

I don’t remember all of this stuff, but I think notation like this is used to describe a function whose behavior is different in different cases. For example:

f(x|x\>3) = 3x  
f(x|0 \< x \<= 3) = x^2 (that’s x raised to the power of two.)  
f(x| x \<= 0) = x

These three lines together describe a continuous function on the full range of integers that behaves differently in three different sections, and can most easily be described with three seperate functions. The slope of the function is a good way of demonstrating how it behaves differently. (Below zero, the slope is 1, above 3, the slope is 3. Between zero and three, the slope is variable as the graph of the function describes part of a parabola.)

I hope this helps, and that I’m not wrong LOL.

---

<div class="post-metadata">

**Author:** ![Tyrrell\_McAllister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tyrrell_mcallister/32/16772_2.png) [@Tyrrell\_McAllister](https://boards.straightdope.com/u/Tyrrell_McAllister)\
**Post date:** [May 27, 2004, 8:25pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/12 "2004-05-27T20:25:53Z")

</div>

**Jon the Geek** , can you provide more context for the expression you’re asking about?

You mention that it might have something to do with linear algebra. Some people use the | to denote the inner product of two vectors. More precisely, physicists sometimes write the inner product of two vectors **x** and **y** as ( **x** | **y** ) (but more commonly as \< **x** | **y** \> . That’s probably not what’s happening in your case though, because the inner product of two vectors is a scalar, so you would have _f_ being a function of both vectors and scalars.

---

<div class="post-metadata">

**Author:** ![Shade](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Shade](https://boards.straightdope.com/u/Shade)\
**Post date:** [May 27, 2004, 8:35pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/13 "2004-05-27T20:35:07Z")

</div>

FTR: | is also used to mean ‘divides’ as in 2|6 means six is even. Though not in this case.

---

<div class="post-metadata">

**Author:** ![ZenBeam](https://avatars.discourse-cdn.com/v4/letter/z/3ab097/32.png) [@ZenBeam](https://boards.straightdope.com/u/ZenBeam)\
**Post date:** [May 27, 2004, 9:49pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/14 "2004-05-27T21:49:01Z")

</div>

In Electromagnetics, we use it in Green’s functions, for example:

G(x,y,z | x’,y’,z’)

where G gives the field strength at x,y,z due to a point excitation at x’,y’,z’. It doesn’t really mean anything more than a comma, but makes reading it easier.

---

<div class="post-metadata">

**Author:** ![Capt.Ridley\_s\_Shooting\_Party](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Capt.Ridley\_s\_Shooting\_Party](https://boards.straightdope.com/u/Capt.Ridley_s_Shooting_Party)\
**Post date:** [May 27, 2004, 9:53pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/15 "2004-05-27T21:53:15Z")

</div>

> [@](#):
>
> or defining a thingie as in “B is defined to be the set of objects K, such that K is an even number” would be B:={K|K=2x} where x is a real number.

The proper name for this type of notation is “set builder notation”.

---

<div class="post-metadata">

**Author:** ![Shade](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Shade](https://boards.straightdope.com/u/Shade)\
**Post date:** [May 27, 2004, 10:06pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/16 "2004-05-27T22:06:46Z")

</div>

Oh, and another FTR. If f:C-\>C (f is a function taking a complex no. to a complex no.) then f|[sub]R[/sub] is the function on real numbers that’s the same as f on R.

---

<div class="post-metadata">

**Author:** ![Tyrrell\_McAllister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tyrrell_mcallister/32/16772_2.png) [@Tyrrell\_McAllister](https://boards.straightdope.com/u/Tyrrell_McAllister)\
**Post date:** [May 27, 2004, 11:10pm UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/17 "2004-05-27T23:10:09Z")

</div>

> [@Shade](#):
>
> Oh, and another FTR. If f:C-\>C (f is a function taking a complex no. to a complex no.) then f|[sub]R[/sub] is the function on real numbers that’s the same as f on R.

Boy, the poor | symbol is almost as overworked as the parantheses.

Another use that I can think of (and clearly not what **Jon the Geek** is looking for) is for evaluating an antiderivative at the bounds of integration:

Integral[sub]a[/sub][sup]b[/sup] _f_(_x_) d_x_ = F(x) | [sub]a[/sub][sup]b[/sup].

---

<div class="post-metadata">

**Author:** ![carterba](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@carterba](https://boards.straightdope.com/u/carterba)\
**Post date:** [May 28, 2004, 12:33am UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/18 "2004-05-28T00:33:23Z")

</div>

> [@Jon the Geek](#):
>
> What does the | in a mathematical equation mean? For example, in this equation:  
> f(theta|u) \<is proportional to\> f(u|theta)f(theta)  
> what do the |'s mean?
> 
> I believe it’s something from linear algebra and/or statistics, but it isn’t ringing a bell from either. Granted, I took those classes about 10 years ago…

Looks like Bayes’ Rule to me. Those that have said “conditional probability” and “theta given u” are correct.

f(theta | u) is defined as f(theta, u) / f(u) i.e. the number of times theta and u occur together divided by the total number of times u occurs. Bayes says f(theta | u) is equal to f(u | theta)f(theta) / f(u) and thus proportional to f(u | theta)f(theta) when comparing over a single u.

Some more info:  
[http://www.ai.mit.edu/~murphyk/Bayes/bayesrule.html](http://www.ai.mit.edu/~murphyk/Bayes/bayesrule.html)

---

<div class="post-metadata">

**Author:** ![TJdude825](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@TJdude825](https://boards.straightdope.com/u/TJdude825)\
**Post date:** [May 28, 2004, 3:22am UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/19 "2004-05-28T03:22:47Z")

</div>

Also not what you’re looking for but, if you take a [matrix](http://mathworld.wolfram.com/Matrix.html), which is usually surrounded by [square brackets], and instead surround it with |pipes|, it means the [determinant](http://mathworld.wolfram.com/Determinant.html) of the matrix.

---

<div class="post-metadata">

**Author:** ![Mathochist](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@Mathochist](https://boards.straightdope.com/u/Mathochist)\
**Post date:** [May 28, 2004, 7:55am UTC](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337/20 "2004-05-28T07:55:40Z")

</div>

> [@Tyrrell McAllister](#):
>
> Boy, the poor | symbol is almost as overworked as the parantheses.
> 
> Another use that I can think of (and clearly not what **Jon the Geek** is looking for) is for evaluating an antiderivative at the bounds of integration:
> 
> Integral[sub]a[/sub][sup]b[/sup] _f_(_x_) d_x_ = F(x) | [sub]a[/sub][sup]b[/sup].

Actually, this is an adaptation of the more general “restricted to” notation. Given a presheaf on a directed system, an object “at” one site “restricts to” any “lower” site. Often the system is that of measurable subsets of some topological space and the objects are functions. If U is a subset of V and f is a function on V, then f|[sub]U[/sub] is the restriction of the function to U. Now if the subset in question is a singleton {a}, then this is usually cut to f|[sub]a[/sub] rather than f|[sub]{a}[/sub]. adding more scripts extends to the notion of restriction to chains, and superscripts are taken with the opposite orientation. Thus f|[sub]a[/sub][sup]b[/sup] = f(b)-f(a).

As a side note, the bar is not usually used inside the argument to a function in the sense of “such that”, but rather in a propositional calculus of some sort. {x in **R** | x[sup]2[/sup] in **Z** } to denote the set of real numbers x _such that_ x is a square root of an integer, for instance.

[Next page](https://boards.straightdope.com/t/meaning-of-in-mathematical-equation/247337.md?page=2)
