An object will float if it can displace the amount of water that would equal its weight. The amount of water a needle displaces is very little and thus is not greater than the weight of the needle. The ship, because it is not solid displaces enough water to equal it's weight, so it floats.
1 3 1
This is because the surface area of the boat is more than that of the needle. Also, the density of the boat is less than that of the water while the density of the needle is more than water's density.
1 5 1