## 3 Product Gene Theory
### Similarity Calculation Rule
(2) _Numerical similarity_  
The similarity between two continuous values can be calculated in different ways for a different type of attributes. If the attribute is not in information set \(C\), then the similarity can be calculated as follows:  
\[\delta(NumA,NumB)=\left\{ \begin{array}{ll}\frac{min[NumA][NumB]}{max[NumA][NumB] }&NumA\times NumB>0\\ 0&max[NumA],[NumB]]>0,NumA\times NumB\leq 0\\ 1&NumA=NumB=0\end{array} \right. \tag{5}\]  
where \(NumA\) and \(NumB\) are values of attributes which are both continuous in target gene and reference gene. In information set \(C\), an element can be expressed by \(EL\_C=SC\#(NV1\), \(NV2\), \(NV3\), \(NV4)\#C\), where \(NV1\) represents the actual value, \(NV2\) represents the design value, \(NV3\) represents the lower deviation, \(NV4\) represents the upper deviation. Their types of values are all continuity. Considering their different roles, the calculation methods of them are defined as follows:  
The similarity between an \(NV2\) or \(NV3\) or \(NV4\) in target gene (\(NVA2\) or \(NVA3\) or \(NVA4\)) and the corresponding \(NV2\) or \(NV3\) or \(NV4\) in reference gene (\(NVB2\) or \(NVB3\) or \(NVB4\)) is calculated by Equation (5). If the values of \(NVA3\), \(NVA4\), \(NVB3\), and \(NVB4\) are all null, then the similarity between an \(NV1\) in target gene (\(NVA1\)) and the corresponding \(NV1\) in reference gene (\(NVB1\)) is expressed as follows:  
\[\delta(NVA1,NVB1)=\left\{ \begin{array}{ll}\frac{min[NVA1-NVA2],NVB1-NVB2]}{ max[NVA1-NVA2][NVB1-NVB2]}&(NVA1-NVA2)\times(NVB1-NVB2)>0\\ 0&(NVA1-NVA2)\times(NVB1-NVB2)\leq 0,\\ 0&max[NVA1-NVA2],[NVB1-NVB2]]>0\\ 1&NVA1-NVA2=NVB1-NVB2=0\end{array} \right. \tag{6}\]  
In this equation, the value of similarity is determined by the difference between the actual value and the design value. Considering the design accuracy, it can more accurately reflect the difference between the target value and the reference value than Equation (5). For example, the design value of hardness of a part is 40; it means that the actual hardness of the product should not be less than 40 to qualify. If the actual hardness (target value) is 36 and a reference value is 42, the similarity is 36/42 = 0.86 according to Equation (5), while the similarity is 0 according to Equation (6). Here, the target value does not meet the requirements, while the reference value meets the requirements. Obviously, 0 is better than 0.86 in reflecting their similarity. Therefore, Equation (6) is applied under the conditions above. If the values of \(NVA3\), \(NVA4\), \(NVB\), and \(NVB4\) are not null, then the similarity between an \(NV1\) in target gene (\(NVA1\)) and the corresponding \(NV1\) in reference gene (\(NVB1\)) is expressed as follows:  
\[\delta(NVA1,NVB1)=\left\{ \begin{array}{ll}\frac{min[|DA|,|DB|]}{max[|DA|,|DB| ]}&DA\times DB>0,(DA<1,DB<1)\text{ or }(\text{DA}>1,\text{DB}>1)\\ 0&(DA\times DB\leq 0,max\{|DA|,|DB|]\
eq 0)\\ 0&\text{ or }(DA>1,0<DB<1)\text{ or }(0<\text{DA}<1,\text{DB}>1)\\ 1&DA=DB=0\end{array} \right. \tag{7}\]  
\[DA=\frac{NVA1-(NVA2+NVA3)}{NVA4-NVA3} \tag{8}\]  
\[DB=\frac{NVB1-(NVB2+NVB3)}{NVB4-NVB3} \tag{9}\]where \(DA\) is the deviation degree of value in target gene and \(DB\) is the deviation degree of value in the reference gene. \(NVA3\) and \(NVB3\) are reference values. Similar to Equation (6), the calculation method as shown in Equations (7)-(9) can obtain a more accurate value of similarity than Equation (5). (3) _Option similarity_  
The option similarity is measured by the matching state between two values which are optional or Boolean. The calculation method is expressed as follows:  
\[\delta(OptA,OptB)= \begin{cases}0&OptA\
eq OptB\\ 1&OptA=OptB\end{cases}  \tag{10}\]  
\[\delta(BIA,BIB)= \begin{cases}0&BIA\
eq BIB\\ 1&BIA=BIB\end{cases}  \tag{11}\]  
where \(OptA\) is an optional value of an attribute in the target gene and \(OptB\) is an optional value of an attribute in the reference gene. \(BIA\) is a Boolean value of the attribute and \(BIB\) is a Boolean value of an attribute in the reference gene.