Trying to find out the transformation/algorithm

MarkSpencer

New member
Joined
Aug 10, 2019
Messages
1
Hello ,

I am i am trying to resolve a problem, can you please take a look :
There is a lot of hype around machine learning those days.But we have to find a way to teach machine from a dataset of only 3 examples.
Here are a few pairs of input/output.Figure out what the corresponding algorithm is.


I assume (not sure) that the first line of inputs is Matrix size

Thank you

Example1:

Input
1
-1

Output
-1

Example 2 :

Input
5
1 2 3 4 5
6 7 8 9 0
1 2 3 4 5
6 7 8 9 0
1 2 3 4 5

Output
47


Example 3 :

Input
6
10 2 3 4 5 10
1 20 3 4 20 6
1 2 30 30 5 6
1 2 40 40 5 6
1 50 3 4 50 6
60 2 3 4 5 60

Output
420
 

Attachments

  • Capture d’écran 2019-08-11 à 02.10.56.png
    Capture d’écran 2019-08-11 à 02.10.56.png
    113.6 KB · Views: 11
They are asking you to guess what this program is doing. I agree that the first input appears to be the dimension of a square matrix, which is the second part of the input.

But there is no mathematical way to know what the output means; so this is a silly exercise to give future programmers, whose first job would be, not to write a program to do what they think this means, but to write a clear specification by discussing needs with the "customer".

I am not inclined to put any effort at all into this. But if it were an assignment, I would be playing the role by asking the professor for more information about his requirements. If it's just a puzzle, maybe for a contest, you can decide how much time it is worth to you.

(By the way, you missed a word. It says, "But we have yet to find a way ..." In other words, it's impossible.)
 
… They are asking you to guess what this program is doing … It says, "But we have yet to find a way…" In other words, it's impossible.)
I'm thinking that statement refers to the impossibility (to date) of teaching a machine to answer the op (because, with a small data set, more than one answer is possible, perhaps). I found two algorithms that work -- I'm sure there are others. Here's the simplistic one, and the OP can look for others.

Assuming an n×n matrix M is the second input and n is first input:

IF n < 4 THEN output -1 ELSE output M(1,4) & M(2,2) concatenated

?
 
Well, yeah, there are "creative" answers that give the right outputs for the three example inputs; unfortunately, it said, "Figure out what the corresponding algorithm is." There is no one such algorithm.

It's impossible (a) for a machine to do this, because the problem isn't fully defined; and (b) for anyone who takes it seriously as asking you to find the very algorithm they used.

But if it is intended as a riddle rather than a serious programming assignment, then you're right. And it probably is. I'm taking it too seriously.

@MarkSpencer, can you tell us the context of the question?
 
the corresponding algorithm …
I didn't take their definite article too seriously; I didn't even notice it, ha.

If only one answer is acceptable, then the OP will need casino luck!

;)
 
I didn't take their definite article too seriously; I didn't even notice it, ha.

If only one answer is acceptable, then the OP will need casino luck!

;)
It isn't just the definite article; the verb is the unconditional singular "is," and the adjective "corresponding" modifies the singular noun "algorithm."

If what was intended was to identify one of the infinite number of possible suitable algorithms, the whole question would need to be recast into something like

figure out what may be one of the possible algorithms underlying the input and associated output.

Just because natural languages do not have the precision of artificial ones does not mean that natural languages do not have the capacity to express things carefully. It is just that people are indulged in using natural languages without care.

It is possible to avoid being ambiguous in English. Except for lawyers and politicians, avoiding ambiguity is a virtue. Unfortunately, virtue is hard to find.

Notice that if the exercise had been well rather than sloppily worded, the student might have learned something useful about inductive discovery.
 
Top