## 3 MrCloud: Our Data Analytic Algorithm
### Querying Uncertain Big Data  
Once our MrCloud algorithm managed uncertain big data, it allows users to query the data. Users can express their interests by selecting one of SQL-style constraints in the form of (i) \"_X.attribute \(\theta\) constant_\"; (ii) \"_agg(X.attribute) \(\theta\) constant_\"; and (iii) their logical combinations via the conjunction operator \"AND\" (\(\wedge\)) or the disjunction operator \"OR\" (\(\vee\)), where (i) _agg_ is an aggregate function including max, min, sum, and (ii) \(\theta\) is a comparison operator including \(>,\geq,=,\leq,<\). Examples are not confined to the aforementioned (i) frequency constraints \(C_{1}\) & \(C_{2}\) or (ii) non-frequency AM constraints \(C_{3}\)-\(C_{7}\), users can also specify AM constraints involving more than one aggregate function. The following is an example:  
* \(C_{8}\equiv\) difference(_X.Temperature_) = max(_X.Temperature_) \(-\) min(_X.Temperature_) \(\leq\) 10 \({}^{\circ}\)C says that the difference between the maximum and minimum temperatures in \(X\) is at most 10 \({}^{\circ}\)C (which involves the difference between two aggregate functions maximum and minimum).  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**TID** & \multicolumn{2}{c}{**Content**} \\ \hline \(t_{1}\) & \{AMS: 0.9, BCN: 1.0, CPH: 0.5, DEL: 0.9, EDI: 1.0, FRA: 0.2\} \\ \(t_{2}\) & \{AMS: 0.8, BCN: 0.8, CPH: 1.0, EDI: 0.2, FRA: 0.2, IST: 0.6\} \\ \(t_{3}\) & \{AMS: 0.4, FRA: 0.2, GUM: 1.0, HEL: 0.5\} \\ \hline \hline \end{tabular}
\end{table}
Table 1: An illustrative sample set of uncertain big data.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**IATA Code** & **Airport** & **Reward Points** \\ \hline AMS & Amsterdam & 2400 \\ BCN & Barcelona & 3000 \\ CPH & Copenhagen & 2600 \\ DEL & Delhi & 3200 \\ EDI & Edinburgh & 2000 \\ FRA & Frankfurt & 2200 \\ GUM & Guam & 1800 \\ HEL & Helsinki & 2800 \\ IST & Istanbul & 1600 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Auxiliary information for the uncertain big data in Table 1.  
Moreover, users can also specify constraints involving more than one AM constraint. Examples include the following:  
* \(C_{9}\equiv\) [min(_X.Temperature_) \(\geq\) 20 \({}^{\circ}\)C] \(\wedge\) [max(_X.Temperature_) \(\leq\) 30 \({}^{\circ}\)C] expresses the user interest in finding every pattern \(X\) with temperature between 20 \({}^{\circ}\)C to 30 \({}^{\circ}\)C inclusive (which involves a logical conjunction \"AND\" of two AM constraints);
* \(C_{10}\equiv\) [min(_X.RewardPoints_) \(\geq\) 2000] \(\wedge\) [_X.Location_ = Europe] expresses the user interest in finding every pattern \(X\) such that the minimum reward points earned by travellers among all European airports visited are at least 2000 (which again involves a logical conjunction \"AND\" of two AM constraints); and
* \(C_{11}\equiv\) [min(_X.Temperature_) \(\geq\) 20 \({}^{\circ}\)C] \(\vee\) [max(_X.Rainfall_) \(\leq\) 10 mm] expresses the user interest in finding all meteorological records matching \"warm\" or \"relatively dry\" patterns (which involves a logical conjunction \"OR\" of two AM constraints).  
Last but not least, users can also specify constraints that are not AM (e.g., \(C_{12}\equiv\) avg(_X.Temperature_) \(\geq\) 25 \({}^{\circ}\)C expressing the user interest in finding every pattern \(X\) with average temperature at least 25 \({}^{\circ}\)C). Since the users specify their constraints by selecting one of the SQL-style constraints, MrCloud can easily determine whether the user-specified constraints are AM or not. Table 3 shows examples of the classification.