they are. For example, the words "dog" and "dot", which differ by just one letter, are closer than "dog" and "cat", which have no letters in common. This idea is used in spell checkers and in coding theory, and is mathematically formalized in a number of different ways, including Levenshtein distance, Hamming distance, Lee distance, and Jaro–Winkler distance. Distance in graph theory In a graph, the distance between two vertices is measured by the length of the shortest edge path between them. For example, if the graph represents a social network, then the idea of six degrees of separation can be interpreted mathematically as saying that the distance between any two vertices is at most six. Similarly, the Erdős number and the Bacon number—the number of collaborative relationships away a person is from prolific mathematician Paul Erdős and actor Kevin Bacon, respectively—are distances in the graphs whose edges represent mathematical or artistic collaborations. In the social sciences In psychology, human geography, and the social sciences, distance is often theorized not as an objective numerical measurement, but as a qualitative description of a subjective experience. For example, psychological distance is "the different ways in which an object might be removed from" the self along dimensions such as "time, space, social distance, and hypotheticality". In sociology, social distance describes the separation between individuals or social groups in society along dimensions such as social class, race/ethnicity, gender or sexuality. Mathematical formalization Most of the notions of distance between two points or objects described above are examples of the mathematical idea of a metric. A metric or distance function is a function which takes pairs of points or objects to real numbers and satisfies the following rules: The distance between an object and itself is always zero. The distance between distinct objects is always positive. Distance is symmetric: the distance from to is always the same as the distance from to . Distance satisfies the triangle inequality: if , , and are three objects, then This condition can be described informally as "intermediate stops can't speed you up." As an exception, many of the divergences used in statistics are not metrics. Distance between sets There are multiple ways of measuring the physical distance between objects that consist of more than one point: One may measure the distance between representative points such as the center of mass; this is used for astronomical distances such as