Can we compute a probability by distance? In this tutorial, we will discuss the relationship of duclidean distance and gaussian distribution, which will help us to convert a distance to a probability.

## Euclidean Distance

Euclidean distance can be defined as:

In tensorflow, we can compute it easily.

Calculate Euclidean Distance in TensorFlow: A Step Guide – TensorFlow Tutoria

## Gaussian Distribution

Gaussian distribution is defined as:

Here is a tutorial on it.

An Introduction to Gaussian Distribution or Normal Distribution – Machine Learning Tutorial

## The Relationship of Euclidean Distance and Gaussian Distribution

We can find the euclidean distance is a scalar value. As to gaussian distribution, \((x-\mu)^2\) measures the distance from \(x\) to the center \(\mu\).

If we replace \((x-\mu)^2\) using euclidean distance,we can build a bridge between euclidean distance and gaussian distribution. Here is an example:

Here we will compute \(p(c|w)\) based on the euclidean distance.