last day (15 days later) » 

13:34
17
Q: The Double Slit Experiment

TheLethalCoderA lazy physicist has the job to perform the double slit experiment. However, they are lazy and can't be bothered to set up all the equipment themselves and so are going to simulate the effects. They can't program though so are going to need some help. As they are lazy your program should be as sh...

Shouldn't the probabilities sum to 1?
@LeakyNun No, There's only a a chance of it falling there at once.
@LeakyNun For example for n=5 we check the middle box, there's a 50% chance of falling in it. If it falls end of frame, if not move to the next two, there's a 25% chance of falling in those. If it falls end of frame, if not move to the next two, there's a 12.5% chance of falling in those. If it doesn't fall it doesn't matter, it's still the end of the frame.
Note for C#ers: I did this in 242 bytes though it could probably be golfed more.
@TheLethalCoder God damnit, i'm not gonna come close to that
@IanH. Just realised it's 240 I had some erroneous parenthesis in there.
Whats the formula to calculate the gap between the boxes?
13:34
@LiefdeWen This should be the same width as a box but no particles will land there so 2n-1
I'm with @LeakyNun, the interpretation of probabilities is not obvious from the explanation in the task. Consider clarifying that part in the description.
@algmyr Is my above comment clear enough?
It should be enough.
@TheLethalCoder do you mean "25% chance to fall into ONE of them" or "25% chance for EACH of them"?
@AndrewDunai They each have a 25% chance for it to fall into them.
13:34
@TheLethalCoder which of them has higher priority then? (Which should be checked first.) Left or right?
@AndrewDunai Doesn't matter. (Hint: seeing as only one particle can land per frame you can check the 25% chance then randomly pick either of them)
@TheLethalCoder thanks! I think this detail can be included in the original question.
@AndrewDunai Well it is an abuse of how it works, though an allowable one. So I'll leave it out of the main rules.
You can think of this as probabilities if I understand your description correctly. I'll index the maxima with i=0 at the center. Think of the process as a probability tree like in s2.postimg.org/4sl316e6h/tree.png for which the sum of probabilities actually is 1. Is that what you're after?
Does "You should output to STDOUT." mean this must be a console program composed of Ascii art? Processing is disallowed?
13:34
@Carcigenicate I meant it as in you should output in real time i.e. no returning arrays of steps etc.
@TheLethalCoder So Processing is allowed?
@Carcigenicate I'm not familiar with it. I fit can produce real time output like a console window in the above GIF then yes.
@TheLethalCoder It produces "real grapics", not console graphics. It's used for animations.
@Carcigenicate Go ahead and post it.
@TheLethalCoder Thanks. Just wanted to make sure.
13:34
"As they are lazy your program should be as short as possible." +1

last day (15 days later) »