update of centroids in $k$ means clustering I have been reading the lecture notes of Andrew Ng about Clustering techniques available in:
http://cs229.stanford.edu/notes/cs229-notes7a.pdf
but I have a problem in the second for of step $2$ which is the following:

For what I know, the previous step or for each section what it does is to set a value of $c$ considering the minimum value of each x minus the value of the centroid ($\mu$). According to what I read the second for each should update the values of the centroid by computing the new mean of the $x$ values assigned to this centroid, but how does this part do that? any numerical example would be great.
Why there is a value of $1\{\}$ before each set of brackets? and for what I see the value of the numerator by being multiplied with $x^{(i)}$ their summation would be greater than the sum of the value of the denominator. Should not be the other way around?
Thanks

The formula means if the $i$-th data point is considered to be group $j$, we should consider that data point in updating our mean. 
For example, if we think $x_1, x_2, x_3$ belongs to cluster $1$.
Then $\mu_1 = \frac{x_1+x_2+x_3}{3}.$
The notation $1\{c^{(i)}=j\}$ is an indicator function. 
$\sum_{i=1}^m1\{c^{(i)}=j\}$ count the number of data point in cluster $j$.
$\sum_{i=1}^m1\{c^{(i)}=j\}x_i$ sums up the data points in cluster $j$.
The formula is the average of data points in the $j$-th cluster.
