I need to compute the Hamming Distance for the set of four taxa, L1, L2, L3, AND L4.
我需要为四个分类群L1,L2,L3和L4计算汉明距离。
L1 = (0,1,0,1,0)
L2 = (0,0,0,0,0)
L3 = (1,0,0,0,0)
L4 = (1,0,1,0,1)
How can I do this to compute the hamming distance of all four together?
我怎么能这样做来计算所有四个汉明距离?
1 个解决方案
#1
0
Just calculate the distance for each pair:
只需计算每对的距离:
L1 L2 L3 L4
L1 0 3 2 0
L2 3 0 4 2
L3 2 4 0 3
L4 0 2 3 0
How to represent the matrix depends on the programming language you use. Some kind of two-dimensional array (or at least array-of-arrays) should be supported anywhere.
如何表示矩阵取决于您使用的编程语言。任何地方都应该支持某种二维数组(或至少是数组的数组)。
#1
0
Just calculate the distance for each pair:
只需计算每对的距离:
L1 L2 L3 L4
L1 0 3 2 0
L2 3 0 4 2
L3 2 4 0 3
L4 0 2 3 0
How to represent the matrix depends on the programming language you use. Some kind of two-dimensional array (or at least array-of-arrays) should be supported anywhere.
如何表示矩阵取决于您使用的编程语言。任何地方都应该支持某种二维数组(或至少是数组的数组)。