Wikipedia:Reference desk/Archives/Mathematics/2008 August 25

= August 25 =

Mathematical notation equivalent
What is the equivalent mathematical notation for the "countif" function in Excel? The function gives a count of the occurrences of a specified criteria. For instance, in the list of "1,1,3,4,3,5,4,5,3" "countif" function with a criteria of "1" would provide result of "2". How would I indicate the list contained 9 integers, etc.? —Preceding unsigned comment added by 71.100.13.184 (talk) 09:23, 25 August 2008 (UTC)

I don't know how to get the right symbols, but you could do something like that with a bit of logical notation, and maybe a multiset. Let P(x) be the condition you're placing on the count, which evaluates to True when it finds something it's looking for and False otherwise. For instance, P(x) = "x is an integer." Let S be the set, and let m(x) equal the multiplicity of x in S. Then what you're looking for is the sum over all x (in S, such that P(x)) of m(x). Black Carrot (talk) 10:43, 25 August 2008 (UTC)


 * What I have done is to use vx for P(x) with the expression looking like this:...  $$ n = \sum_{x=0}^S v_{x} V^{x} $$ where $$ V^{x} $$ is a multiplier of $$ v_{x} $$ with an additional subscript, l, to denote summation of all multiplicities for all possible values for x in S, with the expression looking like this:... $$ n_l = \sum_{x=0}^S v_{l,x} V^{(S-x)} $$ but I'm not sure if mathematical notation can be used in this way in place of logical notation to express the idea so that it is comprehendable for the reader.  —Preceding unsigned comment added by 71.100.13.184 (talk) 13:09, 25 August 2008 (UTC)


 * For whatever reason, lists aren't usually treated as mathematical objects. You can say "S is a set" and talk about properties of S like its cardinality |S|, but you don't normally say "L is a list" or talk about properties of L. Instead you always write out the list by its elements—e.g. $$a_1, \ldots, a_n$$ is a list of length n. You might write the number of list elements satisfying a predicate P as $$\left| \{ i : P(a_i) \} \right|$$. -- BenRG (talk) 13:31, 25 August 2008 (UTC)


 * What do you thing about this? —Preceding unsigned comment added by 71.100.13.184 (talk) 15:06, 25 August 2008 (UTC)


 * I don't think it would help you with what you're doing. It's using generating function techniques to shortcut some computations, but not the ones you're looking for. Black Carrot (talk) 15:26, 25 August 2008 (UTC)


 * Cardinality is probably what you want $$\left|\left\{x:x \in A \land x=1\right\}\right |$$ Dmcq (talk) 20:56, 25 August 2008 (UTC)
 * That notation would usually be interpreted as a set rather than a multiset, though, so it would just tell you if the number appears in the list, not how many times. --Tango (talk) 23:53, 25 August 2008 (UTC)
 * Thanks. Um yeah I'd only get 0 or 1! I do seem to do a lot of cut twice measure once Dmcq (talk) 18:59, 26 August 2008 (UTC)


 * I'd write the list as a function over the natural numbers (or subset thereof), and then write the "countif" as a sum of indicator functions, like $$\sum{I(f(i) = 1)}$$ where I(S) = 1 if S is true, 0 otherwise. Confusing Manifestation (Say hi!) 00:00, 26 August 2008 (UTC)

Thanks for all of this help! After looking at every suggestion I decided to see if I could develop a function using Mathcad. Once over the hurdle of using indexes in a way which Mathcad would accept I was able to do every step with equalities, which are easily reproduced in LaTeX. I'll post what I've found here tomorrow. Thanks very much again for the help! —Preceding unsigned comment added by 71.100.13.184 (talk) 04:14, 26 August 2008 (UTC)
 * $$ i = 0..V^K $$


 * $$ t_i = \sum_{j=0}^K v_{i,j} V^{(K-j)}$$


 * $$ n_{t_i} = n_{t_i} + 1 $$

-

The J (programming language) uses Iverson bracket for the indicator function of a condition, and summation of the result, like this +/ ((1, 1, 3, 4, 3, 5, 4, 5, 3) = 1) and the result reported is 2. Bo Jacoby (talk) 08:26, 26 August 2008 (UTC).


 * Any programming language normally provides user function capability but the problem is not in getting the results or even displaying them in even pseudo code but rather in using conventional mathematical notation to do both which Mathcad has allowed to be done by means of the close similarity between its symbolics and that of LaTeX.

northest point
Can someone please tell me which is the northest point "country" on earth.

T.Cauchi80.254.93.170 (talk) 13:46, 25 August 2008 (UTC)


 * Santa's toy shop. Black Carrot (talk) 15:29, 25 August 2008 (UTC)


 * The northernmost point on land is Kaffeklubben Island outside Greenland, so unless you consider Greenland a country, that's Denmark. See Extreme points of Earth for more of this stuff. -- Jao (talk) 15:33, 25 August 2008 (UTC)