Can random(5) output the number 5?

Yes, @monkstone, that would work.

In your opinion, what would be the relative merits between using Processing functions versus using imported Java functions?