recently there was a question to make program by solving the sequence-pattern given in input and output... please try to find it ,and help me if you can .... for every two integer input ,an output was given:
input
(1 4)
(2 3)
(4 10)
(7 10)
(8 100)
(200 300 )
(255 275)
output 5 5 12 7 1043 4048 1060
respectively how can input and output be related here, to each other????
edit : i would like to thank about_30_ninjas for his message ,thanks for solving it .
Ain't nobody got time for that.
but you definitely got time to comment ... LOL .
Here's simple program which solves given task:
So what did you sacrifice to become master?
5 stacks of yellow dye in Minecraft.
bro ,your solution is wrong , i got the correct answer from about_30_ninjas ... here output is the sum of prime numbers between input range [a b] ... thanks for trying it and giving your time for my question ...
Did you even like, read the code?
You have to be more specific on what type of relationship you're looking for. Any set of input and output values can be fitted perfectly by some polynomial. For example, I could say that the output is
(197121089224141 x^5)/14824459483725929637600 - (9060603386308189 x^4)/570171518604843447600 + (26660326915496837687 x^3)/4941486494575309879200 - (1422560370026178478451 x^2)/3706114870931482409400 + (4867386451591739811563 x)/741222974186296481880 - 3706498869439340167/196090733911718646
wherex
is the sum of the two inputs.How did you find this polynomial?
It's evident BessieTheCow has spent a lot of time on AOPS.
Wolfram Alpha: https://www.wolframalpha.com/input/?i=interpolating+polynomial+(5,+5),+(14,+12),+(17,+7),+(108,+1043),+(500,+4048),+(530,+1060)
your link is not working
The markup parser seems to have trouble with parenthesis in links.
so ,you mean ,you are trying to fit all given sample test in a polynomial equation , but then it will fail at system test .... if we do it without any logic ...
That isn't supposed to be a solution to the problem. The point is that "find a relationship between a given set of inputs and outputs" isn't really a good question because there will always be many possible relationships that match any set of input and outputs if we don't restrict the type of relationship we're looking for.