I haven't done any statistical surveys, in my undergrad years, I find math students are much smarter than the cs majors.
The phenomenon of the Computer Science graduate who can't write a FizzBuzz program, or even the post-graduate who can't write a simple recursive function, is well attested. But a Math student who can't handle a recursive definition is unlikely to make it through the first term.