random_element(l):= part(l, 1+random(length(l))); /* (%i1) random_element(['a, 'b, 'c]); (%o1) c */