Doubt around Covariance definition Given the general definition of Covariance between two random variables $x$ and $y$:
\begin{equation*}
\text{Cov}(x,y)=\frac{1}{n}\sum_{i=1}^n(x_i-\bar{x})(y_i-\bar{y})
\end{equation*}
Does the above definition implicitly assume that every bivariate observation $(x_i,y_i)$ has the same relative frequency, namely equal to $\frac{1}{n}$?
I would expect that for bivariate observations with different relative frequency, the above definition (given that the value set of component random variable $x$ has $r$ values while that of $y$ has $s$ values) would become equal to:
\begin{equation}
\text{Cov}(x,y)=\sum_{i=1}^r\sum_{j=1}^sf_{x,y}(x_i,y_i)(x_i-\bar{x})(y_i-\bar{y})
\end{equation}
with $f_{x,y}(x_i,y_i)$ denotes the relative frequency of the pair $(x_i, y_i)$.
Is my reasoning correct or am I wrong? Why?
 A: You are confusing the estimator for covariance with covariance itself. Covariance is defined as
$$
\operatorname{cov}(X, Y) = \operatorname{E}{\big[(X - \operatorname{E}[X])(Y - \operatorname{E}[Y])\big]}
$$
Where $X$ and $Y$ are random variables and by calculating expected values we do consider their distributions and relative probabilities when calculating the integrals to obtain expected values
$$
\operatorname{E}[X] = \int x f(x)\, dx
$$
As noticed by @BigBendRegion in the comment, it's easier to show for mean as an estimator for expected value. For discrete data, the expected value is defined as
$$
E[X] = \sum_i x_i p_i
$$
If you want to estimate it from the sample, the problem is that you don't know the $P(X = x_i) = p_i$ probabilities. You can estimate them from the sample by looking at the relative frequencies $\tfrac{n_i}{n}$ where $n_i$ is the count of how many times did you observe $x_i$'th value (notice: this is not $i$-th sample, but $i$-th distinct value) in your sample, with $n = \sum_i n_i$. In such a case,
$$
\sum_i x_i \tfrac{n_i}{n}  = \sum_i \,x_i n_i \tfrac{1}{n} 
$$
it is the same as if you repeated the $\tfrac{1}{n} x_i$ operation $n_i$ times in the summation. So using arithmetic mean is the same as if you calculated the relative frequencies $\hat p_i = \tfrac{n_i}{n}$ and used them to calculate $\sum_i  x_i \hat p_i$. Exactly the same thing happens for sample covariance, but the math is just a little bit more cluttered.
A: I interpret this to mean that you are unhappy if you have a data set like this.
$$
X, Y\\
1,1\\
2,3\\
1,1\\
0, -1
$$
In this case, the $(1,1)$ is repeated, so you want to weight it double. However, that is covered by the formula.
$$
cov(X, Y) = \frac{1}{4}\sum_{i = 1}^4 (X_i - \bar X)(Y_i-\bar Y)\\
=\dfrac{(1-1)(1-1) + (2 - 1)(3 - 1) + (1 - 1)(1 - 1) + (0 - 1)(\text{-}1 - 1)
}{4}
$$
The values get repeated in the sum, so there is no need to weight observations according to how many times they appear.
A: Use of the Roman alphabet rather than Greek implies that we are talking about sample observations rather than the population. In a sample, each observation does in fact have the same relative frequency (if the same pair of values appears more than once, they will still be different observations, and each of those observations appears once). However, if the mean is being estimated by $\bar x$ rather than being known, then $\frac 1{N-1}$ rather than $\frac 1 N$ is used.
For the population covariance, the formula is $\int \int p(x,y)(x-\mu_x)(y-\mu_y)dxdy$, which for a discrete distribution reduces to $\sum \sum p(x,y)(x-\mu_x)(y-\mu_y)$
