$\sum_{i=1}^{n}\sum_{j=1}^{n}(a_ib_j-a_jb_i)^2 = \sum_{i=1}^{n}a_i^2\sum_{j=1}^{n}b_j^2 +
\sum_{i=1}^{n}b_i^2 \sum_{j=1}^{n}a_j^2 - 2\sum_{i=1}^{n}a_ib_i \sum_{j=1}^{n}b_ja_j$

Can someone walk me through this. The different summation indices is throwing me off. 
The cauchy-schwarz inequality is generally written as

$\sum_{i=1}^{n} a_1b_1 \le (\sum_{i=1}^{n}a_i^2)^{1/2}(\sum_{i=1}^{n}b_i^2)^{1/2}$

So I'm not 100% sure what the elements $b_j$ and $a_j$ are.


Question: In Android, how do I position an image on top of another to look like a badge?
Answer: RelativeLayout is a great option. 

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" &gt;

&lt;ImageView
    android:id="@+id/icon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="5dp"
    android:scaleType="centerCrop"
    android:src="@drawable/iconImage" /&gt;

&lt;ImageView
    android:id="@+id/badge"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignRight="@+id/icon"
    android:layout_alignTop="@+id/icon"
    android:src="@drawable/badge" /&gt;




If you actually want a badge with a dynamic number/text, then you can make the second ImageView a TextView (or a ViewGroup such as LinearLayout or RelativeLayout) and give it a background drawable and set the text to what you want.