Functions
REDUCE
REDUCE function applies a lambda value expression to each element in a list, perform cumulative calculations, and return a single value.
Note that we first mutiply Ownership percentages along each path and then the sum up the percentages for the 2 paths.
Note that we first use the COLLECT_LIST to get all the people who live in the same city as Fatima in a LIST. Next we use the REDUCE to calculate the Geometric Mean.
An alternate way to calculate Geometric Mean would be: