Prime numbers are whole numbers that has factors of 1 and itself.
Example: 2 is a prime because there is no way you could factor it except 1 and 2.
Composite numbers have more factors which also include 1 and itself.
Example: 50 is composite because it has factors more than 1 and itself.
5 is a factor of 50; 10 is a factor of 50.
So let's begin sorting.
Prime: 7, 11, 31.
Composite: 4, 8, 10, 27.
Hope this helps! :)