Post
Topic
Board Announcements (Altcoins)
Re: [ANN][CLAM] CLAMs, Proof-Of-Chain, Proof-Of-Working-Stake, a.k.a. "Clamcoin"
by
dooglus
on 23/01/2016, 22:08:21 UTC
Spoiler alert... I give the game away in this post. If you don't want to read it yet, scroll past...

x

x

x

x

x

What i meant is that your statement might be true WHEN you don't check it against the reality. So we know one clam block is found in average every 1 minute. Then when you don't check it against the real blocks found, let's say you take a point in the future, then you would await that the next block, in average would be 1 minute away. The last block was one minute away in average too. Because you don't have data to rely on. Though when you check it against the past blocks or wait until the blocks were solved around that point then the theoretical truth proofs to be wrong because that point in time has to be somewhere between 1 minute blocks. Which would be the same for the average of all points in time that are checked against the real blocks.

Whether you check against theoretical or real blocks, you find the same.

If you randomly pick a point in time over the last year and see what the time between blocks was at that point, you get number around 2 minutes on average. Even though the average blocktime is only one minute.

So was your statement theoretical only?

No, it really happens.

Do you want to know why?

It's because when you pick a random point in time you have very little chance of picking one of the quick blocks, and a much bigger chance of picking a slow block. That's what messes up the average time - there's a bias towards you picking the bigger gaps, just because they are bigger.

But what i want to say is that how can the average be higher than the average of these points in between a block if the average blocksize is 60 seconds?

It's a funny effect isn't it.

Maybe this related situation makes it clearer:

Suppose there are two busses per hour at your local stop. One one the hour, and one at 5 minutes past the hour. You don't know the timetable; you just know that there are 2 busses per hour, so an average time between busses of 30 minutes. You guess your expected wait time will be 15 minutes.

Now suppose you arrive at the bus stop at a random point in time. How long do you expect to be waiting for a bus?

5/60 probability you arrive between x:00 and x:05 and have an average wait of 2.5 minutes
55/60 probability you arrive after x:05 and have an average wait of 27.5 minutes
Note that the average of 2.5 and 27.5 is 15 minutes - but the probabilities aren't equal. The long wait is much higher probability.

The actual expected wait time is (2.5 * 5/60) + (27.5 * 55/60) = 25.4166 minutes. The expected 'time between busses' you see, when you randomly arrive at the stop is twice that, at around 51 minutes. Because almost all the time you're not lucky enough to get there between :00 and :05.

--

Alternatively, suppose there are two busses, one with 10 people on it, and one with 90 people on it. You take the 100 people into a room and do a survey. You ask them "how many people were on your bus?" and average the replies.

There was an average of 50 people per bus, but you're going to hear "90" much more than you hear "10", so the average of the numbers you hear is going to be closer to 90 than to the true average.

   I'm not a python programmer, but in the find routine, it looks like your returning the newer block, and then the older block.  but in the main routine, your looking for the older block then the newer block.  

   Have you tried running the code with a small subset, just so you can manually verify the output.  

I would expect the averages to be 1/2 the block time.  

Maybe I don't know what I'm talking about....  (Won't be the first time)

It's not clear from my code, but the datafile has newest blocks first, so find routine is returning the older block first, then the newer one.

I did test it on a small sample first, and it is doing the first thing.

I would have expected the averages to be 30 seconds too, but they aren't. See my "bus" examples above for an intuitive explanation of why... basically when you pick a random time you have a bigger chance of picking a time when we were waiting a long time for a block than picking one of the quick ones...

x

x

x

x

x