Problem 61006. Shapiro Polynomials
%Example
P1(x) = x + 1 => Output = [1 1];
P3(x) = x^7 - x^6 + x^5 + x^4 - x^3 + x^2 + x + 1 => Output = [1 -1 1 1 -1 1 1 1];
Solution Stats
Problem Comments
-
4 Comments
Show
1 older comment
Christian Schröder
on 19 Sep 2025 at 18:50
Are you sure the test suite's expected results for for n=4 and n=5 are correct? I'm getting different values. Furthermore, the test suite's expected result for n=3 (correct) appears to contradict the problem description (incorrect).
Matthew
on 19 Sep 2025 at 20:12
I agree with Christian, test cases 4 and 5 seem to be incorrect.
Dyuman Joshi
on 20 Sep 2025 at 3:28
Yes, the test suite was incorrect - I seem to have used the coefficients starting from the (2^n)th power.
The error has been rectified (including the typo in description) and both of your solutions have been rescored and accepted. Do rate the problem!
Christian Schröder
on 20 Sep 2025 at 7:13
Excellent, thanks for the quick fix, Dyuman!
Solution Comments
Show commentsProblem Recent Solvers5
Suggested Problems
-
5 Solvers
More from this Author40
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!