We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.
Unless you are studying recursion, I recommend to not use it for this kind of function. Because recursion do not make the writing simpler, the compiler is likely to rewrite as a loop, and if not, it is a kind of system abuse.
Quote:but how can I make it count the numbers larger than the average and keep it tail-recursive?
Short answer, you can't. Simply because you need the average before
starting to count.