Is this a good algorithm for calculating profit with certain random events?












1












$begingroup$


I'm working on a game, and am trying to solve the problem of simulating offline play. Below I've simplified the game and provided the solution I'm considering.



Propose a game where you have a number of uniquely identified machines, and you generate $1/minute for each machine you have running. Assume money is awarded at one minute intervals, and that before the allocation for each machine, we check to see if a number of failures have occurred. We use failure A's probability to see if that occurred, B's to see if that occurred, etc. (the order of evaluation is randomised so no failure is biased). If any of these random calculations end up succeeding, the machine is put into a failed state, and generates nothing indefinitely.



Now assume we want to simulate five minutes of this game at once. For each machine:




  • Randomise the order of the failures

  • Use a random number and distribution to see if each failure occurred. The probability would be five times more likely.

  • If we find a failure that occurred, randomly generate the time it occurred. The distribution makes it equally likely to occur on any minute.

  • Calculate the profit from that machine using the number of minutes before the failure minute


Does the "live" per minute calculation get simulated perfectly by the retrospective one?










share|cite|improve this question









$endgroup$












  • $begingroup$
    It's unclear what you want, and the rules for the whole thing.
    $endgroup$
    – lightxbulb
    Jan 22 at 22:43










  • $begingroup$
    Could you give a few examples of what's missing? I tried really hard to give as much detail as I could.
    $endgroup$
    – Oliver Dunk
    Jan 22 at 22:57










  • $begingroup$
    Here are a few of the unclear parts: "before the allocation for each machine, we check to see if a number of failures have occurred." - by allocation I assume sending the money (does this take time or does it happen instantaneously at the end of every minute). How long before that do you check? How many ('a number') of failures do you check for? It is not clear how often these failures may occur. Is it a set of failure states each having its own probability? What do you mean by 'order' of failures. What do you mean by 'use a random number and distribution to see if each failure occurred', etc.
    $endgroup$
    – lightxbulb
    Jan 22 at 23:29
















1












$begingroup$


I'm working on a game, and am trying to solve the problem of simulating offline play. Below I've simplified the game and provided the solution I'm considering.



Propose a game where you have a number of uniquely identified machines, and you generate $1/minute for each machine you have running. Assume money is awarded at one minute intervals, and that before the allocation for each machine, we check to see if a number of failures have occurred. We use failure A's probability to see if that occurred, B's to see if that occurred, etc. (the order of evaluation is randomised so no failure is biased). If any of these random calculations end up succeeding, the machine is put into a failed state, and generates nothing indefinitely.



Now assume we want to simulate five minutes of this game at once. For each machine:




  • Randomise the order of the failures

  • Use a random number and distribution to see if each failure occurred. The probability would be five times more likely.

  • If we find a failure that occurred, randomly generate the time it occurred. The distribution makes it equally likely to occur on any minute.

  • Calculate the profit from that machine using the number of minutes before the failure minute


Does the "live" per minute calculation get simulated perfectly by the retrospective one?










share|cite|improve this question









$endgroup$












  • $begingroup$
    It's unclear what you want, and the rules for the whole thing.
    $endgroup$
    – lightxbulb
    Jan 22 at 22:43










  • $begingroup$
    Could you give a few examples of what's missing? I tried really hard to give as much detail as I could.
    $endgroup$
    – Oliver Dunk
    Jan 22 at 22:57










  • $begingroup$
    Here are a few of the unclear parts: "before the allocation for each machine, we check to see if a number of failures have occurred." - by allocation I assume sending the money (does this take time or does it happen instantaneously at the end of every minute). How long before that do you check? How many ('a number') of failures do you check for? It is not clear how often these failures may occur. Is it a set of failure states each having its own probability? What do you mean by 'order' of failures. What do you mean by 'use a random number and distribution to see if each failure occurred', etc.
    $endgroup$
    – lightxbulb
    Jan 22 at 23:29














1












1








1





$begingroup$


I'm working on a game, and am trying to solve the problem of simulating offline play. Below I've simplified the game and provided the solution I'm considering.



Propose a game where you have a number of uniquely identified machines, and you generate $1/minute for each machine you have running. Assume money is awarded at one minute intervals, and that before the allocation for each machine, we check to see if a number of failures have occurred. We use failure A's probability to see if that occurred, B's to see if that occurred, etc. (the order of evaluation is randomised so no failure is biased). If any of these random calculations end up succeeding, the machine is put into a failed state, and generates nothing indefinitely.



Now assume we want to simulate five minutes of this game at once. For each machine:




  • Randomise the order of the failures

  • Use a random number and distribution to see if each failure occurred. The probability would be five times more likely.

  • If we find a failure that occurred, randomly generate the time it occurred. The distribution makes it equally likely to occur on any minute.

  • Calculate the profit from that machine using the number of minutes before the failure minute


Does the "live" per minute calculation get simulated perfectly by the retrospective one?










share|cite|improve this question









$endgroup$




I'm working on a game, and am trying to solve the problem of simulating offline play. Below I've simplified the game and provided the solution I'm considering.



Propose a game where you have a number of uniquely identified machines, and you generate $1/minute for each machine you have running. Assume money is awarded at one minute intervals, and that before the allocation for each machine, we check to see if a number of failures have occurred. We use failure A's probability to see if that occurred, B's to see if that occurred, etc. (the order of evaluation is randomised so no failure is biased). If any of these random calculations end up succeeding, the machine is put into a failed state, and generates nothing indefinitely.



Now assume we want to simulate five minutes of this game at once. For each machine:




  • Randomise the order of the failures

  • Use a random number and distribution to see if each failure occurred. The probability would be five times more likely.

  • If we find a failure that occurred, randomly generate the time it occurred. The distribution makes it equally likely to occur on any minute.

  • Calculate the profit from that machine using the number of minutes before the failure minute


Does the "live" per minute calculation get simulated perfectly by the retrospective one?







statistics






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Jan 22 at 22:06









Oliver DunkOliver Dunk

213




213












  • $begingroup$
    It's unclear what you want, and the rules for the whole thing.
    $endgroup$
    – lightxbulb
    Jan 22 at 22:43










  • $begingroup$
    Could you give a few examples of what's missing? I tried really hard to give as much detail as I could.
    $endgroup$
    – Oliver Dunk
    Jan 22 at 22:57










  • $begingroup$
    Here are a few of the unclear parts: "before the allocation for each machine, we check to see if a number of failures have occurred." - by allocation I assume sending the money (does this take time or does it happen instantaneously at the end of every minute). How long before that do you check? How many ('a number') of failures do you check for? It is not clear how often these failures may occur. Is it a set of failure states each having its own probability? What do you mean by 'order' of failures. What do you mean by 'use a random number and distribution to see if each failure occurred', etc.
    $endgroup$
    – lightxbulb
    Jan 22 at 23:29


















  • $begingroup$
    It's unclear what you want, and the rules for the whole thing.
    $endgroup$
    – lightxbulb
    Jan 22 at 22:43










  • $begingroup$
    Could you give a few examples of what's missing? I tried really hard to give as much detail as I could.
    $endgroup$
    – Oliver Dunk
    Jan 22 at 22:57










  • $begingroup$
    Here are a few of the unclear parts: "before the allocation for each machine, we check to see if a number of failures have occurred." - by allocation I assume sending the money (does this take time or does it happen instantaneously at the end of every minute). How long before that do you check? How many ('a number') of failures do you check for? It is not clear how often these failures may occur. Is it a set of failure states each having its own probability? What do you mean by 'order' of failures. What do you mean by 'use a random number and distribution to see if each failure occurred', etc.
    $endgroup$
    – lightxbulb
    Jan 22 at 23:29
















$begingroup$
It's unclear what you want, and the rules for the whole thing.
$endgroup$
– lightxbulb
Jan 22 at 22:43




$begingroup$
It's unclear what you want, and the rules for the whole thing.
$endgroup$
– lightxbulb
Jan 22 at 22:43












$begingroup$
Could you give a few examples of what's missing? I tried really hard to give as much detail as I could.
$endgroup$
– Oliver Dunk
Jan 22 at 22:57




$begingroup$
Could you give a few examples of what's missing? I tried really hard to give as much detail as I could.
$endgroup$
– Oliver Dunk
Jan 22 at 22:57












$begingroup$
Here are a few of the unclear parts: "before the allocation for each machine, we check to see if a number of failures have occurred." - by allocation I assume sending the money (does this take time or does it happen instantaneously at the end of every minute). How long before that do you check? How many ('a number') of failures do you check for? It is not clear how often these failures may occur. Is it a set of failure states each having its own probability? What do you mean by 'order' of failures. What do you mean by 'use a random number and distribution to see if each failure occurred', etc.
$endgroup$
– lightxbulb
Jan 22 at 23:29




$begingroup$
Here are a few of the unclear parts: "before the allocation for each machine, we check to see if a number of failures have occurred." - by allocation I assume sending the money (does this take time or does it happen instantaneously at the end of every minute). How long before that do you check? How many ('a number') of failures do you check for? It is not clear how often these failures may occur. Is it a set of failure states each having its own probability? What do you mean by 'order' of failures. What do you mean by 'use a random number and distribution to see if each failure occurred', etc.
$endgroup$
– lightxbulb
Jan 22 at 23:29










0






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',
autoActivateHeartbeat: false,
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%2f3083783%2fis-this-a-good-algorithm-for-calculating-profit-with-certain-random-events%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics 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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3083783%2fis-this-a-good-algorithm-for-calculating-profit-with-certain-random-events%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

Npm cannot find a required file even through it is in the searched directory