> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> تحسب تباين المجتمع.

# varPop

<h2 id="varPop">
  varPop
</h2>

Introduced in: v1.1.0

Calculates the تباين المجتمع.

The تباين المجتمع is calculated using the formula:

$$
\frac{\Sigma{(x - \bar{x})^2}}{n}
$$

<br />

Where:

* $x$ is each value in the population
* $\bar{x}$ is the population mean
* $n$ is the population size

<Note>
  تستخدم هذه الدالة خوارزمية غير مستقرة عدديًا. إذا كنت بحاجة إلى [الاستقرار العددي](https://en.wikipedia.org/wiki/Numerical_stability) في الحسابات، فاستخدم الدالة [`varPopStable`](/docs/reference/functions/aggregate-functions/varPopStable)، إذ تعمل بشكل أبطأ لكنها تُقلّل من الخطأ الحسابي.
</Note>

**Syntax**

```sql theme={null}
varPop(x)
```

**Aliases**: `VAR_POP`

**Arguments**

* `x` — Population of values to find the تباين المجتمع of. [`(U)Int*`](/docs/reference/data-types/int-uint) or [`Float*`](/docs/reference/data-types/float) or [`Decimal*`](/docs/reference/data-types/decimal)

**Returned value**

Returns the تباين المجتمع of `x`. [`Float64`](/docs/reference/data-types/float)

**Examples**

**Computing تباين المجتمع**

```sql title=Query theme={null}
DROP TABLE IF EXISTS test_data;
CREATE TABLE test_data
(
    x UInt8,
)
ENGINE = Memory;

INSERT INTO test_data VALUES (3), (3), (3), (4), (4), (5), (5), (7), (11), (15);

SELECT
    varPop(x) AS var_pop
FROM test_data;
```

```response title=Response theme={null}
┌─var_pop─┐
│    14.4 │
└─────────┘
```
