Express function counting number of elements in subsets

1.8k Views Asked by At

I wish to express a function $freq(x)$ as an equation but I have no clue how to properly do this. Basically I have the following:

Let $a_i \subset A$ be one of many subsets of A. Each subset $a_i$ contains an unknown number of elements $e \in a_i$. Now I wish to find an equation that properly expresses a function that counts the number of elements in each subset.

What I have until now is:$$freq(e_i)=\sum_{j=1}^{n}e_j$$where $e_j=1$ iff $e_i \in a_j$ and $0$ otherwise.

So I think of it that I iterate over all $n$ subsets and when $e_i$ is an element of subset $a_j$ I add 1 and otherwise $0$.

Is this somewhat close or way off?

1

There are 1 best solutions below

1
On BEST ANSWER

Your definition is perfectly valid. Another way of expressing it using standard set theory notation would be:

$$ f(e) = \sum_{j=1}^n |\{e\}\cap a_j| $$

Where $\{e\}$ is a single-element set consisting of the element $e$ only. $\{e\}\cap a_j$ is the intersection of $\{e\}$ with the subset $a_j$. So if $e\in a_j$ then $\{e\}\cap a_j=\{e\}$ otherwise $\{e\}\cap a_j=\emptyset$. And then $|\cdot|$ denotes the set cardinality (the size).