flat assembler
Message board for the users of flat assembler.

Index > Heap > could a computer solve this one?

Goto page 1, 2, 3  Next
Author
Thread Post new topic Reply to topic
whakamaru



Joined: 03 Oct 2012
Posts: 20
Location: New Zealand
whakamaru
The BBC magazine "Focus", has a "brainteaser" each month. The one for January 2012 was, "Work out what mathematical function is being applied, then complete the final line".
6061--->4152
8016--->-1092
9608--->1512 and then
1698---> ????
I guess that it is not hard for an bio-organic (human) PC? But on Intel? Big Blue?
Two clues,
1. 'mathematical function"? Not really, "logical process" would be better.
2. BBC is in UK, I am in NZ
And if that clue is too cryptic, then get the answer from <sciencefocus.com/winners> and then clue 2 will be solved too!
I put this on the PE forum and got not many responses.

_________________
watch this space
Post 08 Jan 2014, 22:43
View user's profile Send private message Reply with quote
matefkr



Joined: 02 Sep 2007
Posts: 1291
Location: Ukraine, Beregovo
matefkr
who gives a fuck? and why for? no need to resolve unresolved problems for free, epsecially not for some bastard sick-rat po-lice.
Post 08 Jan 2014, 23:59
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 724
tthsqe
the answer is "clearly" 49413. Seriously, though, obviously restraints need be places on the function in order that this puzzle has a unique solution. As it currently is stated it is meaningless.
Post 09 Jan 2014, 03:43
View user's profile Send private message Reply with quote
nop



Joined: 01 Sep 2008
Posts: 165
Location: right here left there
nop
the correct answer is 1698 - 8691 = -6993 which would be dificult for a procesor without neurons Wink
Post 09 Jan 2014, 23:20
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
Yeah, this brainteaser is slightly misleading since we have here rather a play with graphical forms of the numbers that have to be transformed by rotation of 180 degrees (or composition of horizontal and vertical reflection) and then we have to subtract the transformed number from the original one. Such a play with mirrors. Wink Note that not every number on the left side of the equations can be an object of the aforementioned transformation. We assume that 1 is represented by I character and the number has to be composed of 0, 1, 6, 8 and 9 digits only (otherwise it would be hard to keep the proper notation of those numbers).

Image
Post 09 Jan 2014, 23:26
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
nop wrote:
the correct answer is 1698 - 8691 = -6993 which would be dificult for a procesor without neurons Wink

Since a computer can solve palindromes, yes it's possible.
The last step is just vertical palindrome or whichever orientation comes last.
Post 10 Jan 2014, 04:39
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
The post asked for a mathematical formula and then tthsqe had given a right answer.
The given numbers form the points in a parabola in the form of y=ax2+bx+c

So, the post should have asken for an ingenious solution, not a mathematical function. Wink


Description: The parabola
Filesize: 5.47 KB
Viewed: 4531 Time(s)

parabola.png


Post 10 Jan 2014, 12:59
View user's profile Send private message Yahoo Messenger Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
Accordingly to your formula in the attached image

Image

0.0012*(1698^2)-19.798*1698+79474 = 49316.8408

http://www.wolframalpha.com/input/?i=0.0012%2A%281698%5E2%29-19.798%2A1698%2B79474

The result is not an integer and differs from the tthsqe solution (49413).
Post 10 Jan 2014, 13:12
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
Quote:

The result is not an integer and differs from the tthsqe solution (49413).

You are right. There is no integer solution for this point.
Post 10 Jan 2014, 18:00
View user's profile Send private message Yahoo Messenger Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 724
tthsqe
Your coefficients are not accurate enough - if you calculate the coefficients more accurately and apply round at the end, you have the function:
Code:
f(x) = round( 3*(48693*x^2-792741017*x+3182103935224)/119995010 )    


http://www.wolframalpha.com/input/?i=Round%5BInterpolatingPolynomial%5B%7B%7B6061%2C4152%7D%2C%7B8016%2C-1092%7D%2C%7B9608%2C1512%7D%7D%2C1698%5D%5D
Post 10 Jan 2014, 20:19
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
Well, I wouldn't call it a "simple" function. It's not a continuous also since you use the ceiling function to round up its value to the integer.

What I expected at the first moment when I started to think about this puzzle, was a strict Diophantine equation, defined by a continuous polynomial function that for those integer arguments will give us exactly integer values but unfortunately it seems that it wasn't the main idea of the authors. Wink
Post 10 Jan 2014, 20:58
View user's profile Send private message Visit poster's website Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 724
tthsqe
OK - well lets try to find a polynomial of minimal degree that interpolates the given three points and takes only integer values on the integers, This is a perfectly reasonable problem. It might not have a solution, though.
EDIT: of course there is such a polynomial, but the degree bound I got is fairly high. Maybe bitrake can crack this one with his project Euler training.
Post 10 Jan 2014, 21:03
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
I have a following idea but be aware that it isn't fully tested yet. Wink

Let be given a function

f(x) = k1*(x-a)(x-b)(x-c) + k2*(x-a)(x-b)(x-d) + k3*(x-a)(x-c)(x-d) + k4*(x-b)(x-c)(x-d)

where a, b, c, d are our integer arguments:

a = 6061
b = 8016
c = 9608
d = 1698

For any of the arguments listed above three of the four addends will be equal to zero and only one will be non zero (we assume that coefficients k1, k2, k3 and k4 are non zero). We want to know what values should have those coefficients to make this whole thing working.

Let's see

f(a) = k4*(a-b)(a-c)(a-d)

so

k4 = f(a) /[(a-b)(a-c)(a-d)]

Analogously we obtain that

k1 = f(d)/[(d-a)(d-b)(d-c)]
k2 = f(c)/[(c-a)(c-b)(c-d)]

and

k3 = f(b)/[(b-a)(b-c)(b-d)]

All differences between numbers a, b, c, d are non zero, so coefficients should be non zero rational numbers.

Smile
Post 10 Jan 2014, 21:38
View user's profile Send private message Visit poster's website Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 724
tthsqe
yesyes, but there is no guarantee that the resulting polynomial function is integer-valued on the integers.
Post 10 Jan 2014, 21:43
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
tthsqe wrote:
yesyes, but there is no guarantee that the resulting polynomial function is integer-valued on the integers.
Sure, we cannot guarantee integer values for the entire integer set, but I took the simplest case (and the most important for our puzzle) that gives exact integer values (without extra rounding) for all expected integer arguments used in the brainteaser (you can take any f(d) = f(1698) you want and it should work). Wink
Post 10 Jan 2014, 21:46
View user's profile Send private message Visit poster's website Reply with quote
alessandro95



Joined: 24 Mar 2013
Posts: 62
alessandro95
Since you can costruct a lagrange polynomial (http://en.wikipedia.org/wiki/Lagrange_polynomial) passing throught any set of given points you can just pick whatever number you like as solution and then build an adeguate polynomial, so there need to be constraints on what "a function" is for this problem because is meaningless stated like that

Edit: this is the least degree polynomial passing throught all of the 4 points

(8057606818 x^3)/31147645143227535-(101950689058369 x^2)/20765096762151690+(345583408377147071 x)/12459058057291014-427782522336379659964/10382548381075845


Last edited by alessandro95 on 10 Jan 2014, 22:14; edited 2 times in total
Post 10 Jan 2014, 21:54
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 724
tthsqe
MHajduk, But that is too easy, and f(1698) can be whatever you want. I tried to make it interesting by saying that f(x) should be an integer for any integer x, and the degree should be as small as possible. This should eliminate several possibilities for f(1698).

There are lots of integer-valued polynomials that satisfy
f(6061) = 4152
f(8016) = -1092
f(9608) = 1512
but I have no idea what the minimum degree such polynomials is.


Last edited by tthsqe on 10 Jan 2014, 22:00; edited 1 time in total
Post 10 Jan 2014, 21:56
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
alessandro95 wrote:
Since you can costruct a lagrange polynomial (http://en.wikipedia.org/wiki/Lagrange_polynomial) passing throught any set of given points you can just pick whatever number you like as solution and then build an adeguate polynomial, so there need to be constraints on what "a function" is for this problem because is meaningless stated like that
It's not meaningless, it rather bears too much of meanings here (I'd say infinitely meaningful). Laughing
Post 10 Jan 2014, 21:57
View user's profile Send private message Visit poster's website Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6034
Location: Poland
MHajduk
tthsqe wrote:
MHajduk, But that is too easy, and f(1698) can be whatever you want. I tried to make it interesting by saying that f(x) should be an integer for any integer x, and the degree should be as small as possible. This should eliminate several possibilities for f(1698).
Let f(1698) be zero, it makes the whole thing a bit simpler.
Post 10 Jan 2014, 21:58
View user's profile Send private message Visit poster's website Reply with quote
alessandro95



Joined: 24 Mar 2013
Posts: 62
alessandro95
Edit: isn't there a way to delete a post?


Last edited by alessandro95 on 10 Jan 2014, 22:16; edited 1 time in total
Post 10 Jan 2014, 22:01
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2, 3  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.