You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mathics/builtin/intfns/combinatorial.py
+93-37Lines changed: 93 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,20 @@
2
2
"""
3
3
Combinatorial Functions
4
4
5
-
<url>:Combinatorics: https://en.wikipedia.org/wiki/Combinatorics</url> is an area of mathematics primarily concerned with counting, both as a means and an end in obtaining results, and certain properties of finite structures.
5
+
<url>:Combinatorics: https://en.wikipedia.org/wiki/Combinatorics</url> is an \
6
+
area of mathematics primarily concerned with counting, both as a means and an \
7
+
end in obtaining results, and certain properties of finite structures.
6
8
7
-
It is closely related to many other areas of Mathematics and has many applications ranging from logic to statistical physics, from evolutionary biology to computer science, etc.
9
+
It is closely related to many other areas of Mathematics and has many \
10
+
applications ranging from logic to statistical physics, from evolutionary \
<dd>returns the Jaccard-Needham dissimilarity between the two boolean 1-D lists $u$ and $v$, which is defined as (c_tf + c_ft) / (c_tt + c_ft + c_tf), where $n$ is len($u$) and c_ij is the number of occurrences of $u$[k]=i and $v$[k]=j for $k$ < $n$.
203
+
<dd>returns the Jaccard-Needham dissimilarity between the two boolean \
204
+
1-D lists $u$ and $v$, which is defined as \
205
+
($c_tf$ + $c_ft$) / ($c_tt$ + $c_ft$ + $c_tf$), where $n$ is \
206
+
len($u$) and $c_ij$ is the number of occurrences of \
@@ -193,7 +226,10 @@ class MatchingDissimilarity(_BooleanDissimilarity):
193
226
194
227
<dl>
195
228
<dt>'MatchingDissimilarity[$u$, $v$]'
196
-
<dd>returns the Matching dissimilarity between the two boolean 1-D lists $u$ and $v$, which is defined as (c_tf + c_ft) / $n$, where $n$ is len($u$) and c_ij is the number of occurrences of $u$[$k$]=$i$ and $v$[k]=$j$ for $k$ < $n$.
229
+
<dd>returns the Matching dissimilarity between the two boolean \
230
+
1-D lists $u$ and $v$, which is defined as ($c_tf$ + $c_ft$) / $n$, \
231
+
where $n$ is len($u$) and $c_ij$ is the number of occurrences of \
<dd>returns the Sokal-Sneath dissimilarity between the two boolean 1-D lists $u$ and $v$,
296
-
which is defined as $R$ / (c_tt + $R$) where $n$ is len($u$), c_ij is the number of occurrences of $u$[$k$]=$i$ and $v$[k]=$j$ for $k$ < $n$, and R = 2 * (c_tf + c_ft).
343
+
<dd>returns the Sokal-Sneath dissimilarity between the two boolean \
344
+
1-D lists $u$ and $v$, which is defined as $R$ / (c_tt + $R$) where \
345
+
$n$ is len($u$), $c_ij$ is the number of occurrences of \
@@ -571,7 +623,11 @@ class YuleDissimilarity(_BooleanDissimilarity):
571
623
572
624
<dl>
573
625
<dt>'YuleDissimilarity[$u$, $v$]'
574
-
<dd>returns the Yule dissimilarity between the two boolean 1-D lists $u$ and $v$, which is defined as R / (c_tt * c_ff + R / 2) where n is len($u$), c_ij is the number of occurrences of $u$[k]=i and $v$[k]=j for $k$<$n$, and $R$ = 2 * c_tf * c_ft.
626
+
<dd>returns the Yule dissimilarity between the two boolean 1-D lists $u$ \
627
+
and $v$, which is defined as $R$ / ($c_tt$ * $c_ff$ + $R$ / 2) \
628
+
where $n$ is len($u$), $c_ij$ is the number of occurrences of \
0 commit comments