Fill two dimensional list by meeting given conditions
$begingroup$
Suppose you have a 2D array - a list that exits in both x and y axis - which is 4 x 4, and you need to fill the table by putting numbers in it obeying following restrictions.
Each cell is able to store a number that can be calculated according to its index. (Indexes start from [0,0])
If a cell's index is [i, j] it can store a number calculated as one of the following ways.
i x j + i - j
i x j + j - i
i ^ j
j ^ i
Each cell can carry at most multiplication of its adjacent cells. (horizonal and vertical)
Each cell should be colored in a way all odds are of same color and all evens are of same color and two same colored cell cannot stand side by side vertically or horizontally.
calculation-puzzle
New contributor
$endgroup$
add a comment |
$begingroup$
Suppose you have a 2D array - a list that exits in both x and y axis - which is 4 x 4, and you need to fill the table by putting numbers in it obeying following restrictions.
Each cell is able to store a number that can be calculated according to its index. (Indexes start from [0,0])
If a cell's index is [i, j] it can store a number calculated as one of the following ways.
i x j + i - j
i x j + j - i
i ^ j
j ^ i
Each cell can carry at most multiplication of its adjacent cells. (horizonal and vertical)
Each cell should be colored in a way all odds are of same color and all evens are of same color and two same colored cell cannot stand side by side vertically or horizontally.
calculation-puzzle
New contributor
$endgroup$
2
$begingroup$
How do you define $0^0$?
$endgroup$
– hexomino
Mar 29 at 9:59
$begingroup$
Has a correct answer been given? If so, please don't forget to $color{green}{checkmark smalltext{Accept}}$ it. If not, some responses to the answerers to help steer them in the right direction would be helpful.
$endgroup$
– Rubio♦
yesterday
add a comment |
$begingroup$
Suppose you have a 2D array - a list that exits in both x and y axis - which is 4 x 4, and you need to fill the table by putting numbers in it obeying following restrictions.
Each cell is able to store a number that can be calculated according to its index. (Indexes start from [0,0])
If a cell's index is [i, j] it can store a number calculated as one of the following ways.
i x j + i - j
i x j + j - i
i ^ j
j ^ i
Each cell can carry at most multiplication of its adjacent cells. (horizonal and vertical)
Each cell should be colored in a way all odds are of same color and all evens are of same color and two same colored cell cannot stand side by side vertically or horizontally.
calculation-puzzle
New contributor
$endgroup$
Suppose you have a 2D array - a list that exits in both x and y axis - which is 4 x 4, and you need to fill the table by putting numbers in it obeying following restrictions.
Each cell is able to store a number that can be calculated according to its index. (Indexes start from [0,0])
If a cell's index is [i, j] it can store a number calculated as one of the following ways.
i x j + i - j
i x j + j - i
i ^ j
j ^ i
Each cell can carry at most multiplication of its adjacent cells. (horizonal and vertical)
Each cell should be colored in a way all odds are of same color and all evens are of same color and two same colored cell cannot stand side by side vertically or horizontally.
calculation-puzzle
calculation-puzzle
New contributor
New contributor
New contributor
asked Mar 29 at 9:54
DavisDavis
61
61
New contributor
New contributor
2
$begingroup$
How do you define $0^0$?
$endgroup$
– hexomino
Mar 29 at 9:59
$begingroup$
Has a correct answer been given? If so, please don't forget to $color{green}{checkmark smalltext{Accept}}$ it. If not, some responses to the answerers to help steer them in the right direction would be helpful.
$endgroup$
– Rubio♦
yesterday
add a comment |
2
$begingroup$
How do you define $0^0$?
$endgroup$
– hexomino
Mar 29 at 9:59
$begingroup$
Has a correct answer been given? If so, please don't forget to $color{green}{checkmark smalltext{Accept}}$ it. If not, some responses to the answerers to help steer them in the right direction would be helpful.
$endgroup$
– Rubio♦
yesterday
2
2
$begingroup$
How do you define $0^0$?
$endgroup$
– hexomino
Mar 29 at 9:59
$begingroup$
How do you define $0^0$?
$endgroup$
– hexomino
Mar 29 at 9:59
$begingroup$
Has a correct answer been given? If so, please don't forget to $color{green}{checkmark smalltext{Accept}}$ it. If not, some responses to the answerers to help steer them in the right direction would be helpful.
$endgroup$
– Rubio♦
yesterday
$begingroup$
Has a correct answer been given? If so, please don't forget to $color{green}{checkmark smalltext{Accept}}$ it. If not, some responses to the answerers to help steer them in the right direction would be helpful.
$endgroup$
– Rubio♦
yesterday
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
It turns out that this is
Impossible
Reasoning
The cell with index $[1,1]$ must contain the entry $ 1times 1 + 1 - 1 = 1^1 = 1$.
Now consider the cell with index $[0,1]$ which is adjacent to $[1,1]$. This must contain either
(i) $0 times 1 + 0 - 1 = -1$,
(ii) $0 times 1 + 1 - 0 = 1$
(iii) $0^1 = 0$
(iv) $1^0 = 1$
Now, (i), (ii) and (iv) are odd which would break rule 3.
However if we are in case (iii) then we break rule 2, since the cell with index $[1,1]$ can carry, at most, multiplication of its adjacent cells, which would be $0$ in this case.
$endgroup$
$begingroup$
Actually it may be possible due to the fact that (according to the rules) rot13(rnpu pryy VF NOYR (be PNA) pbagnva n ahzore, ohg abg arprffnevyl FUBHYQ gb qb fb. Fbzr pryyf znl pbagnva ab ahzoref ng nyy (naq fb, abg orvat terngre guna nal bgure ahzoref, yvxr AnA va cebtenzzvat))
$endgroup$
– trolley813
Mar 29 at 10:20
$begingroup$
@trolley813 That's quite an interesting take. Wouldn't it contravene the sentence "...you need to fill the table by putting numbers in it obeying following restrictions." in the opening paragraph?
$endgroup$
– hexomino
Mar 29 at 10:26
$begingroup$
maybe, but you can fill the table partially. I'm now writing my "solution".
$endgroup$
– trolley813
Mar 29 at 10:31
add a comment |
$begingroup$
My "solution" (a lateral thinking answer)
__0 NaN 1 NaN
NaN 1 NaN 1
__1 NaN 4 NaN
NaN 1 NaN 9
Explanation
NaN
meaning not-a-number (according to the rules, a cell does not has to contain a number, but rather can do so). All other rules are obviously complied (if a cell contains a number, it is of the 4 permitted ones; NaNs (and their products) are never greater than any number; you should color all "odd" cells blue, "evens" green and NaNs grey, since the latter are neither even nor odd).
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "559"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Davis is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f81129%2ffill-two-dimensional-list-by-meeting-given-conditions%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
It turns out that this is
Impossible
Reasoning
The cell with index $[1,1]$ must contain the entry $ 1times 1 + 1 - 1 = 1^1 = 1$.
Now consider the cell with index $[0,1]$ which is adjacent to $[1,1]$. This must contain either
(i) $0 times 1 + 0 - 1 = -1$,
(ii) $0 times 1 + 1 - 0 = 1$
(iii) $0^1 = 0$
(iv) $1^0 = 1$
Now, (i), (ii) and (iv) are odd which would break rule 3.
However if we are in case (iii) then we break rule 2, since the cell with index $[1,1]$ can carry, at most, multiplication of its adjacent cells, which would be $0$ in this case.
$endgroup$
$begingroup$
Actually it may be possible due to the fact that (according to the rules) rot13(rnpu pryy VF NOYR (be PNA) pbagnva n ahzore, ohg abg arprffnevyl FUBHYQ gb qb fb. Fbzr pryyf znl pbagnva ab ahzoref ng nyy (naq fb, abg orvat terngre guna nal bgure ahzoref, yvxr AnA va cebtenzzvat))
$endgroup$
– trolley813
Mar 29 at 10:20
$begingroup$
@trolley813 That's quite an interesting take. Wouldn't it contravene the sentence "...you need to fill the table by putting numbers in it obeying following restrictions." in the opening paragraph?
$endgroup$
– hexomino
Mar 29 at 10:26
$begingroup$
maybe, but you can fill the table partially. I'm now writing my "solution".
$endgroup$
– trolley813
Mar 29 at 10:31
add a comment |
$begingroup$
It turns out that this is
Impossible
Reasoning
The cell with index $[1,1]$ must contain the entry $ 1times 1 + 1 - 1 = 1^1 = 1$.
Now consider the cell with index $[0,1]$ which is adjacent to $[1,1]$. This must contain either
(i) $0 times 1 + 0 - 1 = -1$,
(ii) $0 times 1 + 1 - 0 = 1$
(iii) $0^1 = 0$
(iv) $1^0 = 1$
Now, (i), (ii) and (iv) are odd which would break rule 3.
However if we are in case (iii) then we break rule 2, since the cell with index $[1,1]$ can carry, at most, multiplication of its adjacent cells, which would be $0$ in this case.
$endgroup$
$begingroup$
Actually it may be possible due to the fact that (according to the rules) rot13(rnpu pryy VF NOYR (be PNA) pbagnva n ahzore, ohg abg arprffnevyl FUBHYQ gb qb fb. Fbzr pryyf znl pbagnva ab ahzoref ng nyy (naq fb, abg orvat terngre guna nal bgure ahzoref, yvxr AnA va cebtenzzvat))
$endgroup$
– trolley813
Mar 29 at 10:20
$begingroup$
@trolley813 That's quite an interesting take. Wouldn't it contravene the sentence "...you need to fill the table by putting numbers in it obeying following restrictions." in the opening paragraph?
$endgroup$
– hexomino
Mar 29 at 10:26
$begingroup$
maybe, but you can fill the table partially. I'm now writing my "solution".
$endgroup$
– trolley813
Mar 29 at 10:31
add a comment |
$begingroup$
It turns out that this is
Impossible
Reasoning
The cell with index $[1,1]$ must contain the entry $ 1times 1 + 1 - 1 = 1^1 = 1$.
Now consider the cell with index $[0,1]$ which is adjacent to $[1,1]$. This must contain either
(i) $0 times 1 + 0 - 1 = -1$,
(ii) $0 times 1 + 1 - 0 = 1$
(iii) $0^1 = 0$
(iv) $1^0 = 1$
Now, (i), (ii) and (iv) are odd which would break rule 3.
However if we are in case (iii) then we break rule 2, since the cell with index $[1,1]$ can carry, at most, multiplication of its adjacent cells, which would be $0$ in this case.
$endgroup$
It turns out that this is
Impossible
Reasoning
The cell with index $[1,1]$ must contain the entry $ 1times 1 + 1 - 1 = 1^1 = 1$.
Now consider the cell with index $[0,1]$ which is adjacent to $[1,1]$. This must contain either
(i) $0 times 1 + 0 - 1 = -1$,
(ii) $0 times 1 + 1 - 0 = 1$
(iii) $0^1 = 0$
(iv) $1^0 = 1$
Now, (i), (ii) and (iv) are odd which would break rule 3.
However if we are in case (iii) then we break rule 2, since the cell with index $[1,1]$ can carry, at most, multiplication of its adjacent cells, which would be $0$ in this case.
answered Mar 29 at 10:11
hexominohexomino
45.4k4139219
45.4k4139219
$begingroup$
Actually it may be possible due to the fact that (according to the rules) rot13(rnpu pryy VF NOYR (be PNA) pbagnva n ahzore, ohg abg arprffnevyl FUBHYQ gb qb fb. Fbzr pryyf znl pbagnva ab ahzoref ng nyy (naq fb, abg orvat terngre guna nal bgure ahzoref, yvxr AnA va cebtenzzvat))
$endgroup$
– trolley813
Mar 29 at 10:20
$begingroup$
@trolley813 That's quite an interesting take. Wouldn't it contravene the sentence "...you need to fill the table by putting numbers in it obeying following restrictions." in the opening paragraph?
$endgroup$
– hexomino
Mar 29 at 10:26
$begingroup$
maybe, but you can fill the table partially. I'm now writing my "solution".
$endgroup$
– trolley813
Mar 29 at 10:31
add a comment |
$begingroup$
Actually it may be possible due to the fact that (according to the rules) rot13(rnpu pryy VF NOYR (be PNA) pbagnva n ahzore, ohg abg arprffnevyl FUBHYQ gb qb fb. Fbzr pryyf znl pbagnva ab ahzoref ng nyy (naq fb, abg orvat terngre guna nal bgure ahzoref, yvxr AnA va cebtenzzvat))
$endgroup$
– trolley813
Mar 29 at 10:20
$begingroup$
@trolley813 That's quite an interesting take. Wouldn't it contravene the sentence "...you need to fill the table by putting numbers in it obeying following restrictions." in the opening paragraph?
$endgroup$
– hexomino
Mar 29 at 10:26
$begingroup$
maybe, but you can fill the table partially. I'm now writing my "solution".
$endgroup$
– trolley813
Mar 29 at 10:31
$begingroup$
Actually it may be possible due to the fact that (according to the rules) rot13(rnpu pryy VF NOYR (be PNA) pbagnva n ahzore, ohg abg arprffnevyl FUBHYQ gb qb fb. Fbzr pryyf znl pbagnva ab ahzoref ng nyy (naq fb, abg orvat terngre guna nal bgure ahzoref, yvxr AnA va cebtenzzvat))
$endgroup$
– trolley813
Mar 29 at 10:20
$begingroup$
Actually it may be possible due to the fact that (according to the rules) rot13(rnpu pryy VF NOYR (be PNA) pbagnva n ahzore, ohg abg arprffnevyl FUBHYQ gb qb fb. Fbzr pryyf znl pbagnva ab ahzoref ng nyy (naq fb, abg orvat terngre guna nal bgure ahzoref, yvxr AnA va cebtenzzvat))
$endgroup$
– trolley813
Mar 29 at 10:20
$begingroup$
@trolley813 That's quite an interesting take. Wouldn't it contravene the sentence "...you need to fill the table by putting numbers in it obeying following restrictions." in the opening paragraph?
$endgroup$
– hexomino
Mar 29 at 10:26
$begingroup$
@trolley813 That's quite an interesting take. Wouldn't it contravene the sentence "...you need to fill the table by putting numbers in it obeying following restrictions." in the opening paragraph?
$endgroup$
– hexomino
Mar 29 at 10:26
$begingroup$
maybe, but you can fill the table partially. I'm now writing my "solution".
$endgroup$
– trolley813
Mar 29 at 10:31
$begingroup$
maybe, but you can fill the table partially. I'm now writing my "solution".
$endgroup$
– trolley813
Mar 29 at 10:31
add a comment |
$begingroup$
My "solution" (a lateral thinking answer)
__0 NaN 1 NaN
NaN 1 NaN 1
__1 NaN 4 NaN
NaN 1 NaN 9
Explanation
NaN
meaning not-a-number (according to the rules, a cell does not has to contain a number, but rather can do so). All other rules are obviously complied (if a cell contains a number, it is of the 4 permitted ones; NaNs (and their products) are never greater than any number; you should color all "odd" cells blue, "evens" green and NaNs grey, since the latter are neither even nor odd).
$endgroup$
add a comment |
$begingroup$
My "solution" (a lateral thinking answer)
__0 NaN 1 NaN
NaN 1 NaN 1
__1 NaN 4 NaN
NaN 1 NaN 9
Explanation
NaN
meaning not-a-number (according to the rules, a cell does not has to contain a number, but rather can do so). All other rules are obviously complied (if a cell contains a number, it is of the 4 permitted ones; NaNs (and their products) are never greater than any number; you should color all "odd" cells blue, "evens" green and NaNs grey, since the latter are neither even nor odd).
$endgroup$
add a comment |
$begingroup$
My "solution" (a lateral thinking answer)
__0 NaN 1 NaN
NaN 1 NaN 1
__1 NaN 4 NaN
NaN 1 NaN 9
Explanation
NaN
meaning not-a-number (according to the rules, a cell does not has to contain a number, but rather can do so). All other rules are obviously complied (if a cell contains a number, it is of the 4 permitted ones; NaNs (and their products) are never greater than any number; you should color all "odd" cells blue, "evens" green and NaNs grey, since the latter are neither even nor odd).
$endgroup$
My "solution" (a lateral thinking answer)
__0 NaN 1 NaN
NaN 1 NaN 1
__1 NaN 4 NaN
NaN 1 NaN 9
Explanation
NaN
meaning not-a-number (according to the rules, a cell does not has to contain a number, but rather can do so). All other rules are obviously complied (if a cell contains a number, it is of the 4 permitted ones; NaNs (and their products) are never greater than any number; you should color all "odd" cells blue, "evens" green and NaNs grey, since the latter are neither even nor odd).
answered Mar 29 at 10:40
trolley813trolley813
1,14638
1,14638
add a comment |
add a comment |
Davis is a new contributor. Be nice, and check out our Code of Conduct.
Davis is a new contributor. Be nice, and check out our Code of Conduct.
Davis is a new contributor. Be nice, and check out our Code of Conduct.
Davis is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Puzzling Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f81129%2ffill-two-dimensional-list-by-meeting-given-conditions%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
$begingroup$
How do you define $0^0$?
$endgroup$
– hexomino
Mar 29 at 9:59
$begingroup$
Has a correct answer been given? If so, please don't forget to $color{green}{checkmark smalltext{Accept}}$ it. If not, some responses to the answerers to help steer them in the right direction would be helpful.
$endgroup$
– Rubio♦
yesterday