1. sum(rand(1,100) < 0.2); 2. nums = rand(1, 100)*100; sum( (nums >= 50) .* nums );