Minkowski distance formula: D = (Σ |x_i - y_i|^p)^(1/p)
Minkowski distance formula: D = (Σ |x_i - y_i|^p)^(1/p)
The Minkowski distance formula is a generalization of various distance measures, including Euclidean distance (when p=2) and Manhattan distance (when p=1).
Minkowski distance combines the differences between corresponding coordinates raised to the power of p, summed together, and then takes the p-th root of the total sum. This formula is versatile and can represent different types of distances depending on the value of p.
When p=2, Minkowski distance simplifies to the Euclidean distance, which is commonly used in geometry and physics. As p approaches 1, it becomes the Manhattan distance, often used in urban planning and computer science for grid-like structures.
Example
Consider two points in a 2D space: A(1, 2) and B(4, 6). For Euclidean distance (p=2), D = ((1-4)^2 + (2-6)^2)^(1/2) = (9 + 16)^(1/2) = 5. For Manhattan distance (p=1), D = |1-4| + |2-6| = 3 + 4 = 7.
Understanding Minkowski distance helps in choosing the appropriate distance measure for various applications, such as clustering, classification, and spatial analysis.
Euclidean distance
Euclidean distance formula: √((x2 - x1)² + (y2 - y1)²)
Mahalanobis distance
Mahalanobis distance formula: D^2 = (x - μ)'Σ^(-1)(x - μ)
Distance transform
Manhattan distance formula: |x1 - x2| + |y1 - y2|
Bayes' theorem
Bayes' theorem formula: P(A|B) = [P(B|A) * P(A)] / P(B)
Expected value
Expected value formula: E[X] = Σ [x * P(x)]
Kullback–Leibler divergence
Kullback–Leibler divergence formula: D_KL(P||Q) = ∑_x∈X P(x) log(P(x)/Q(x))
One email a day: 5 concepts + the 5 stories that matter →
Swipe through 100 ML concepts daily
Open TickerNews