Mathematical idea regarding solving “Not So Random” question asked in Google APAC Test 2015 Round E











up vote
2
down vote

favorite
3












I am trying to solve the Problem C titled "Not So Random" asked in Round E of Google APAC 2015 test (Link: https://code.google.com/codejam/contest/8264486/dashboard#s=p2). Following is the question:



enter image description here



My initial idea was to try to formulate a recursive equation for calculating the Expectation of a bit $i$ produced by an $n^{th}$ machine (denoted by $E[f^{n}(i)]$) given $f^{n-1}(i)$ and $k(i)$ ($i^{th}$ bit of $k$). The following is an equation I came up with (I am not completely sure about the correctness):



$E[f^{n}(i)] = frac{(B+C)}{100}*(f^{n-1}(i)oplus k(i)) + frac{(A+B)}{100}*(neg (f^{n-1}(i) oplus k(i)) ominus k(i))$



, where $oplus$ denotes the bitwise $XOR$ operation and $ominus$ denotes the bitwise $AND$ operation.



The thing is I do not how to proceed from there. Some solutions to this are available online: http://massivealgorithms.blogspot.com/2016/07/not-so-random-round-e-apac-test-of.html and https://stackoverflow.com/questions/39430741/logic-behind-codejam-apac-practice-round-not-so-random, but they do not give a properly explained mathematical answer.



(I do not need the code -- I can type it down on my own. Some proper mathematical idea and pointers in the right direction will help)










share|cite|improve this question















This question has an open bounty worth +50
reputation from Python_user ending in 6 days.


This question has not received enough attention.


Hi! I need a really good explanation for this solution. I have been working on this for quite some time, but unable to get some proper answer.
















  • It's premature to try to find the expectation right away before understanding the structure of the problem. Consider: in the beginning you have one possible value, $X$. After going through one machine, you have three possible values: $Xwedge K$, $Xvee K$, $Xoplus K$. After two machines, you have nine possible values... or do you? Do some of those turn out to be the same as each other, or to values you've seen before? Try drawing out the possibilities as though it's the transition graph of a state machine.
    – Rahul
    yesterday















up vote
2
down vote

favorite
3












I am trying to solve the Problem C titled "Not So Random" asked in Round E of Google APAC 2015 test (Link: https://code.google.com/codejam/contest/8264486/dashboard#s=p2). Following is the question:



enter image description here



My initial idea was to try to formulate a recursive equation for calculating the Expectation of a bit $i$ produced by an $n^{th}$ machine (denoted by $E[f^{n}(i)]$) given $f^{n-1}(i)$ and $k(i)$ ($i^{th}$ bit of $k$). The following is an equation I came up with (I am not completely sure about the correctness):



$E[f^{n}(i)] = frac{(B+C)}{100}*(f^{n-1}(i)oplus k(i)) + frac{(A+B)}{100}*(neg (f^{n-1}(i) oplus k(i)) ominus k(i))$



, where $oplus$ denotes the bitwise $XOR$ operation and $ominus$ denotes the bitwise $AND$ operation.



The thing is I do not how to proceed from there. Some solutions to this are available online: http://massivealgorithms.blogspot.com/2016/07/not-so-random-round-e-apac-test-of.html and https://stackoverflow.com/questions/39430741/logic-behind-codejam-apac-practice-round-not-so-random, but they do not give a properly explained mathematical answer.



(I do not need the code -- I can type it down on my own. Some proper mathematical idea and pointers in the right direction will help)










share|cite|improve this question















This question has an open bounty worth +50
reputation from Python_user ending in 6 days.


This question has not received enough attention.


Hi! I need a really good explanation for this solution. I have been working on this for quite some time, but unable to get some proper answer.
















  • It's premature to try to find the expectation right away before understanding the structure of the problem. Consider: in the beginning you have one possible value, $X$. After going through one machine, you have three possible values: $Xwedge K$, $Xvee K$, $Xoplus K$. After two machines, you have nine possible values... or do you? Do some of those turn out to be the same as each other, or to values you've seen before? Try drawing out the possibilities as though it's the transition graph of a state machine.
    – Rahul
    yesterday













up vote
2
down vote

favorite
3









up vote
2
down vote

favorite
3






3





I am trying to solve the Problem C titled "Not So Random" asked in Round E of Google APAC 2015 test (Link: https://code.google.com/codejam/contest/8264486/dashboard#s=p2). Following is the question:



enter image description here



My initial idea was to try to formulate a recursive equation for calculating the Expectation of a bit $i$ produced by an $n^{th}$ machine (denoted by $E[f^{n}(i)]$) given $f^{n-1}(i)$ and $k(i)$ ($i^{th}$ bit of $k$). The following is an equation I came up with (I am not completely sure about the correctness):



$E[f^{n}(i)] = frac{(B+C)}{100}*(f^{n-1}(i)oplus k(i)) + frac{(A+B)}{100}*(neg (f^{n-1}(i) oplus k(i)) ominus k(i))$



, where $oplus$ denotes the bitwise $XOR$ operation and $ominus$ denotes the bitwise $AND$ operation.



The thing is I do not how to proceed from there. Some solutions to this are available online: http://massivealgorithms.blogspot.com/2016/07/not-so-random-round-e-apac-test-of.html and https://stackoverflow.com/questions/39430741/logic-behind-codejam-apac-practice-round-not-so-random, but they do not give a properly explained mathematical answer.



(I do not need the code -- I can type it down on my own. Some proper mathematical idea and pointers in the right direction will help)










share|cite|improve this question













I am trying to solve the Problem C titled "Not So Random" asked in Round E of Google APAC 2015 test (Link: https://code.google.com/codejam/contest/8264486/dashboard#s=p2). Following is the question:



enter image description here



My initial idea was to try to formulate a recursive equation for calculating the Expectation of a bit $i$ produced by an $n^{th}$ machine (denoted by $E[f^{n}(i)]$) given $f^{n-1}(i)$ and $k(i)$ ($i^{th}$ bit of $k$). The following is an equation I came up with (I am not completely sure about the correctness):



$E[f^{n}(i)] = frac{(B+C)}{100}*(f^{n-1}(i)oplus k(i)) + frac{(A+B)}{100}*(neg (f^{n-1}(i) oplus k(i)) ominus k(i))$



, where $oplus$ denotes the bitwise $XOR$ operation and $ominus$ denotes the bitwise $AND$ operation.



The thing is I do not how to proceed from there. Some solutions to this are available online: http://massivealgorithms.blogspot.com/2016/07/not-so-random-round-e-apac-test-of.html and https://stackoverflow.com/questions/39430741/logic-behind-codejam-apac-practice-round-not-so-random, but they do not give a properly explained mathematical answer.



(I do not need the code -- I can type it down on my own. Some proper mathematical idea and pointers in the right direction will help)







algorithms random-variables






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Nov 8 at 9:12









Python_user

936




936






This question has an open bounty worth +50
reputation from Python_user ending in 6 days.


This question has not received enough attention.


Hi! I need a really good explanation for this solution. I have been working on this for quite some time, but unable to get some proper answer.








This question has an open bounty worth +50
reputation from Python_user ending in 6 days.


This question has not received enough attention.


Hi! I need a really good explanation for this solution. I have been working on this for quite some time, but unable to get some proper answer.














  • It's premature to try to find the expectation right away before understanding the structure of the problem. Consider: in the beginning you have one possible value, $X$. After going through one machine, you have three possible values: $Xwedge K$, $Xvee K$, $Xoplus K$. After two machines, you have nine possible values... or do you? Do some of those turn out to be the same as each other, or to values you've seen before? Try drawing out the possibilities as though it's the transition graph of a state machine.
    – Rahul
    yesterday


















  • It's premature to try to find the expectation right away before understanding the structure of the problem. Consider: in the beginning you have one possible value, $X$. After going through one machine, you have three possible values: $Xwedge K$, $Xvee K$, $Xoplus K$. After two machines, you have nine possible values... or do you? Do some of those turn out to be the same as each other, or to values you've seen before? Try drawing out the possibilities as though it's the transition graph of a state machine.
    – Rahul
    yesterday
















It's premature to try to find the expectation right away before understanding the structure of the problem. Consider: in the beginning you have one possible value, $X$. After going through one machine, you have three possible values: $Xwedge K$, $Xvee K$, $Xoplus K$. After two machines, you have nine possible values... or do you? Do some of those turn out to be the same as each other, or to values you've seen before? Try drawing out the possibilities as though it's the transition graph of a state machine.
– Rahul
yesterday




It's premature to try to find the expectation right away before understanding the structure of the problem. Consider: in the beginning you have one possible value, $X$. After going through one machine, you have three possible values: $Xwedge K$, $Xvee K$, $Xoplus K$. After two machines, you have nine possible values... or do you? Do some of those turn out to be the same as each other, or to values you've seen before? Try drawing out the possibilities as though it's the transition graph of a state machine.
– Rahul
yesterday















active

oldest

votes











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: "69"
};
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',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2989719%2fmathematical-idea-regarding-solving-not-so-random-question-asked-in-google-apa%23new-answer', 'question_page');
}
);

Post as a guest





































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2989719%2fmathematical-idea-regarding-solving-not-so-random-question-asked-in-google-apa%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?