I have a mathematical formula to apply: I wrote a non recursive code (sadly due to my lack of advanced coding skills), but a math.stackexchange user suggested me a recursive way to do the same:
Unfortuantely I have no experience both in recursive calls coding and in matrices implementation in PHP.
Would you please give me an help on translating what he wrote in PHP?
I know SO policy is: do your homework & researches before posting, I did what I could but this really seems out of my capabilities.
two things:
1. there are better tools for matrix calculations than php (MATLAB for example)
2. your code looks fine, and you can generalize it (make it work for any n >=3 winners) by modifying your code from:
to:
needless to explain what init_array() does 😉