Mathematical word co-occurrence definition

I am trying to formally formulate the definition of the co-occurrence of two concepts in a document. Is the next mathematical equation correct?

Mathematically a word co-occurrence is defined as:

$$Co-occurrence(c_i,c_j )= \sum_{c_i,c_j∈d}d_{c_i∩c_j}$$

where $$c_i$$ and $$c_j$$ represent concepts mentioned in the collection of a documents $$D$$, and D is defined as

$$D=\{d_1,d_2....d_n\}$$ where $$d$$ represent each document of the collection.

In ordinary language what i am trying to formulate is the following: a $$Co-occurrence$$ of two cocepts, $$c_i$$ and $$c_j$$, (words) for a set of documents $$D$$ is equal to the number of documents that contains $$c_i$$ and also contains $$c_j$$. Note that $$c_i$$ and $$c_j$$ not could be the same word.

If there is one or more documents that contain the two concepts $$c_i$$ and $$c_j$$, at same time, this means that there is a relation between them $$R{c_i c_j}$$:

$$R{c_i c_j} = \begin{cases} ∃, & \text{if Co-occurrence(c_i,c_j )>0} \\ ∄, & \text{otherwise} \end{cases}$$

• Do you define words as equivalent to concepts? Is your end goal to measure the word/concept similarity of two documents? this has a name: cosine similarity Oct 24, 2019 at 8:36
• Also, a bit of pedantry: you probably don't want to zero index your corpus $D$. If you insist on starting with document $d_0$, then maybe you want to stop at document $d_{n-1}$. Oct 24, 2019 at 8:38
• @DavidDiaz Many thanks for your help!! do not worry, all help are welcome :). I update the reponse. No im not try to define words as equivalent to concepts, I try to define mathematically the existence of two concepts ci and cj at same document. That is,define the co-existence of the concept ci with the concept cj at same time in the same document. Oct 24, 2019 at 8:45

There appear to be some mismatches and unexplained notations. For example, what is lowercase d with no subscript? Why is it written as though it is a function applied to an intersection? What is the meaning of the intersection of two words?

We could try the following: $$Co-occurrence(c_1,c_2 )= \sum_{k=0}^n f(k, D)$$

where f is defined as follows:

$$f(k, D) = \begin{cases} 1, & \text{if [c_1 \in d_k \land c_2 \in d_k ]} \\ 0, & \text{otherwise} \end{cases}$$

To write formulas like the above one for f, use "Find ..." in your browser to look for the title "Definitions by cases (piecewise functions)" at the following link: MathJax basic tutorial and quick reference

• Thanks for your help! I update the equation. dci and dcj means documents that contains word ci and documents that contain word cj. Could you formulate your equation in your answer to understand it better? Oct 24, 2019 at 8:11
• Ideally, you should explain the idea in words, with examples using simple data that allow people to compare the value that Co-occurrence is supposed to have with the value that they compute. Otherwise there is some guessing involved. If you want your audience to understand, then it doesn't hurt to go through a train of thought and arrive at what many people might themselves arrive at before giving an example to show why the initial idea doesn't work. Diagnosing the problem and revising the formula would be more interesting than jumping directly to something they may not understand. Oct 24, 2019 at 8:38
• Many thanks for your help. I promise do it better for next time. Oct 24, 2019 at 9:26
• There was no problem this time, except for the possibility that my formula isn't going to give the results that you intended the formula to give. To translate an idea from ordinary language to mathematical symbols, it's a good idea to actually write something in ordinary language. Given the difficulty of formulating mathematical concepts clearly in ordinary language, some extra clarity can be obtained via examples. That could produce a lot of complications, so it's best if one can choose examples that don't require computing. For example, one may simply count items or organize them. Oct 24, 2019 at 9:27
• In fact, I think that there's a problem with my formula, and it may be entirely my fault. You're trying to find $Co-occurrence(c_i,c_j )$, but that seems to imply that you are provided with constants i and j. So how can the right-hand side of the equation allow all combinations of distinct values for i and j? Maybe we want two names for concepts without using the letter i or the letter j on the left-hand side of the equation. Oct 24, 2019 at 9:34