Correct answer of Family of Recurrences

Here is the problem.

If the input is

1

2 2

2 1

2 1

Ans should be f0 * sigma2 + f1 * sigma1 i.e. 2 * 1+2 * 1=4.
But all accepted solution like this are giving 5 please explain.

Please Help .

Please Help !!!

Thanks for the reply, in the question it is given

si = fi - 1 * sigma1 + … + fi - m * sigmam

so shouldn`t s2 be equal to f1 * sigma1+f0 * sigma2.

Please help where I am going wrong

I just realized, the input itself is wrong, as sigma variable can take only 2 values. But I still could not figure out how their answer is coming 5…:frowning:

Even Considering only 2 values of sigma

If the input is

1

2 2

0 1

0 1

Ans should be f0 * sigma2 + f1 * sigma1 i.e. 0 * 1 + 0 * 1 = 0. But all accepted solution like this are giving 1 please explain.

Please Help .

Please Help !!!

Still stuck !!!