operators η2 = the number of distinct operands N1 = the total number of operators N2 = the total number of operands Program vocabulary: η=η1+η2 Program length: N=N1+N2 Volume: V=Nlog2η 34
Set<String> let operands: [String] let distinctOperands: Set<String> let vocabulary= Float(distinctOperators.count + distinctOperands.count) let length = Float(operators.count + operands.count) let halsteadVolume = length * log2(vocabulary) 36