English, asked by munirajmuni069, 5 months ago

कुंती के शेर आपदा धर्माराया दरिद्रता भीम सेना अर्जुन​

Answers

Answered by vk8091624
1

The answer whoever set the homework was looking for is obviously 57. Let’s stipulate that.

The more interesting, and accurate answer is: the next number is whatever you want it to be. It can be any number between -infinity and +infinity.

In this case, set up a polynomial of the form:

f(n)=57+a.(n−8)+b.(n−8)2+c.(n−8)3+d.(n−8)4+e.(n−8)5+f.(n−8)6+g.(n−8)7

where n is the position of f(n) in the sequence provided. i.e. n=3 => f(n)=7 etc.

Solve for a through g. Clearly when n-8 = 0, i.e. when n=8, the 8th item in the sequence, the number we are being asked to predict, f(n) = 57.

Practically speaking you will have computational difficulties (rounding, overflow) etc., but in principle, that first element in the polynomial can be anything you want.

Here’s an R script that figures it all out - you just enter the “sequence” and the “naiveAnswer”, and it will figure out the polynomial for you:

# You can change naiveAnswer to anything you want (though you might run into rounding / overflow issues)</p><p></p><p>sequence &lt;- c(1, 3, 7, 13, 21, 31, 43)</p><p></p><p>naiveAnswer &lt;- 57</p><p></p><p>sequence &lt;- sequence - naiveAnswer # ensures polynomial begins with naiveAnswer</p><p></p><p>coeffs &lt;- t(sapply((1:length(sequence) - (length(sequence) + 1)), "^", 1:length(sequence))) # matrix of simultaneous equations</p><p></p><p>polynomial &lt;- as.vector(solve(coeffs) %*% sequence) # solve simulataneous equations by matrix inversion</p><p></p><p># check</p><p></p><p>for (i in 1:length(sequence)){</p><p></p><p>print(naiveAnswer + sum(polynomial * (i - (length(sequence) + 1))^(1:length(sequence))))</p><p></p><p>}</p><p></p><p># report results</p><p></p><p>print(naiveAnswer)</p><p></p><p>print(polynomial)

Similar questions