last day (15 days later) » 

5:26 AM
0
Q: Expectation of Spread

w33z8kqrqk8zzzx33Every second, the following operation is performed on the current string S: Random distinct indices, A and B, are chosen uniformly at random. The letter at index B becomes the letter at index A, regardless of what the letter at index B previously was. Calculate the expected time, in seconds, ...

 
Are you sure that for example 2 the answer is 164.9 rather than 164.0?
I'm not a fan of this challenge because it's basically a chameleon challenge for a math puzzle. There's a result in combinatorics that gives an explicit formula for the exact answer, so the challenge is really to implement that. And I think the answer is hard to come up with unless you've seen the theorem or at least the idea behind it, so basically one person will post it and everyone will copy it.
 
@A_ This challenge is asking to calculate the expected steps needed, not the shortest number of steps needed. This also eliminates the nondeterministicness of the randomness.
@xnor What is wrong with a chameleon challenge? I actually find them much more entertaining than normal ones.
and why is that
I think that a major part of this challenge is converting it into a simple combinatorical expression. Some people may create a simple expression and others may create a lengthy one. It would ruin half of the problem to state "Calculate (long expression)". Furthermore, there are multiple ways to solve this problem.
 
@w33z8kqrqk8zzzx33 In reality, I or someone else will post the expression and everyone will copy it. People are mostly here to golf code, not solve math puzzles. I do like coding where some math insight helps you, but this seems pretty all or nothing. I think the resulting expression is interesting to golf, and I think people would have been happy to just be given it from the start. You might try Puzzling SE, though the reception to hard-ish math puzzles there is hit or miss.
@w33z8kqrqk8zzzx33 In any case, can you confirm if I'm mistaken that example 2 should be 164.9 rather than 164.0? The formula gives 164.0. If you did some Monte Carlo test, could it be that you didn't do enough trials to get the average to the needed accuracy? I suspect you need at least a million trials to get one decimal of accuracy here.
 
I'm pretty sure it is 164.9. Perhaps I typed it in incorrectly. Also, the point is to find, and implement, the simplest expression possible. People may create their own expressions.
 
@w33z8kqrqk8zzzx33 I'm still getting 164.0 for that string, which I assume is equivalent to the original. In fact, I have that the answer is always integer. I'll post my solution and you can tell me where you disagree.
 
5:26 AM
That's odd. Expected value is supposed to be created by dividing by a value. I don't understand why you're getting an integer...
What is your formula?
 
@w33z8kqrqk8zzzx33 I posted it in an answer
It turns out the ratio of dividing is always a whole number
 
???
tbh this isn't my own problem, I got it online
but online the answer is 164.9
 
Where did you get this problem?
 
I got it from an online judge in China
The problem isn't released public yet though
 
@w33z8kqrqk8zzzx33 Yes, but the logic of the top answer extends to any start position, and I think the other answers develop it more.
Alternatively, since you know the result, you can prove it by induction.
 
5:38 AM
Does the solution acknowledge you can operate on balls with the same color?
 
Yes
 
i.e. you can pick two balls with the same color
Hm
 
Are you sure btw the the contest in China is fine with this being posted if it's for a running competition?
I know on math.SE they wait until after the deadline for things like that
 
It is, since I am pretty sure no one looking at the contest would be on PPCG, and I further simplified the problem
I may have missed one point
It's a small contest - there aren't many people in it, roughly 200
 
When is the competition over?
 
5:42 AM
At 4:00 PM here, so in about 3 hours
it was running for 4 hours already
 
I think it would have been better to wait to post this, especially since it's not that long
 
The thing is that in the original problem, it also specified that every time you selected a and b, there was a probability that b would have been painted b (i.e. not all the time)
but the problem said the probability is always 1
so right now my head's reeling as to what I did wrong
 
Wait, you're doing this competition?
 
yes
..?
ppcg is generally a better place to ask OI problems than stack overflow
 
Does the competition expect for you to get help from people online?
 
5:46 AM
It didn't have any rules against it, and it was a team competition.
i.e. you can get help from others
not exactly sure if this was in scope
 
My general assumption would be strongly no
 
I'm going to put off submitting this problem
 
This is basically getting other people to solve part of a problem for you
 
It is a team competition...
 
I'm not on your team
 
5:47 AM
true
but it means you can get help though
Your code doesn't get through anyways, I'm trying to figure it out
 

last day (15 days later) »