Bitcoin Forum
April 30, 2024, 06:21:51 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3]  All
  Print  
Author Topic: [Quiz] Answer the Bitcoin question and earn merits! #2  (Read 775 times)
BlackHatCoiner (OP)
Legendary
*
Online Online

Activity: 1498
Merit: 7307


Farewell, Leo


View Profile
March 22, 2024, 09:52:12 AM
 #41

So in the end the exactly didn't matter and I guessed this was why after this:

Pr (3 block) = 1 - (Pr( ≤2 block) + Pr (>3 block))
I still got the same 0.06133 which is roughly same as the 0.06131
But you're calculating exactly three in here. If P(block=3) = 1 - {every other possibility than P(block=3)), then you're calculating for exactly three. If you wanted to calculate for at least three, you would work out P(block >= 3), which is just 1 - P(block = 0) - P(block = 1) - P(block = 2) = 0.080302 ~= 8%.

Another fun fact. The probability of not finding any block for 10 minutes is the same as finding exactly one block; about 36.8%.

I wanted to check reality to see how often this occurred (start with Bitcoin block data available in CSV format, and download time.txt), but there is no accurate data on block times. In some cases the block time moves backwards.
That will be a little difficult. Block times are not accurate, as rightly said. Your best source of information is debug.log (in which it is written when your node received the blocks). But it won't be accurate either, because hashrate does not remain constant for a long time.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
1714501311
Hero Member
*
Offline Offline

Posts: 1714501311

View Profile Personal Message (Offline)

Ignore
1714501311
Reply with quote  #2

1714501311
Report to moderator
1714501311
Hero Member
*
Offline Offline

Posts: 1714501311

View Profile Personal Message (Offline)

Ignore
1714501311
Reply with quote  #2

1714501311
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714501311
Hero Member
*
Offline Offline

Posts: 1714501311

View Profile Personal Message (Offline)

Ignore
1714501311
Reply with quote  #2

1714501311
Report to moderator
1714501311
Hero Member
*
Offline Offline

Posts: 1714501311

View Profile Personal Message (Offline)

Ignore
1714501311
Reply with quote  #2

1714501311
Report to moderator
1714501311
Hero Member
*
Offline Offline

Posts: 1714501311

View Profile Personal Message (Offline)

Ignore
1714501311
Reply with quote  #2

1714501311
Report to moderator
Amphenomenon
Sr. Member
****
Offline Offline

Activity: 504
Merit: 326


Hope Jeremiah 17vs7


View Profile WWW
March 22, 2024, 11:02:13 AM
Merited by BlackHatCoiner (4)
 #42

So in the end the exactly didn't matter and I guessed this was why after this:

Pr (3 block) = 1 - (Pr( ≤2 block) + Pr (>3 block))
I still got the same 0.06133 which is roughly same as the 0.06131
But you're calculating exactly three in here. If P(block=3) = 1 - {every other possibility than P(block=3)), then you're calculating for exactly three. If you wanted to calculate for at least three, you would work out P(block >= 3), which is just 1 - P(block = 0) - P(block = 1) - P(block = 2) = 0.080302 ~= 8%.
 
I was actually working base on this
Question: What is the chance of having exactly three blocks mined within the next 10 minutes? You can assume that a new block is mined every 10 minutes on average.

Quote
Another fun fact. The probability of not finding any block for 10 minutes is the same as finding exactly one block; about 36.8%.
I actually discovered this earlier, yesterday during my calculations though didn't speak about it or actually showed my working after I got a value similar to the probability of mining 3 blocks https://www.talkimg.com/images/2024/03/22/J7oDT.jpeg
https://www.talkimg.com/images/2024/03/22/J77k1.jpeg
https://www.talkimg.com/images/2024/03/22/J75Zl.jpeg

I wanted to check reality to see how often this occurred (start with Bitcoin block data available in CSV format, and download time.txt), but there is no accurate data on block times. In some cases the block time moves backwards.
That will be a little difficult. Block times are not accurate, as rightly said. Your best source of information is debug.log (in which it is written when your node received the blocks). But it won't be accurate either, because hashrate does not remain constant for a long time.
franky1 said this earlier on this thread

freebitcoin       ▄▄▄█▀▀██▄▄▄
   ▄▄██████▄▄█  █▀▀█▄▄
  ███  █▀▀███████▄▄██▀
   ▀▀▀██▄▄█  ████▀▀  ▄██
▄███▄▄  ▀▀▀▀▀▀▀  ▄▄██████
██▀▀█████▄     ▄██▀█ ▀▀██
██▄▄███▀▀██   ███▀ ▄▄  ▀█
███████▄▄███ ███▄▄ ▀▀▄  █
██▀▀████████ █████  █▀▄██
 █▄▄████████ █████   ███
  ▀████  ███ ████▄▄███▀
     ▀▀████   ████▀▀
BITCOIN
DICE
EVENT
BETTING
WIN A LAMBO !

.
            ▄▄▄▄▄▄▄▄▄▄███████████▄▄▄▄▄
▄▄▄▄▄██████████████████████████████████▄▄▄▄
▀██████████████████████████████████████████████▄▄▄
▄▄████▄█████▄████████████████████████████▄█████▄████▄▄
▀████████▀▀▀████████████████████████████████▀▀▀██████████▄
  ▀▀▀████▄▄▄███████████████████████████████▄▄▄██████████
       ▀█████▀  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  ▀█████▀▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
▄█████
██
██
██
██
██
██
██
██
██
██
██
▀█████
.
PLAY NOW
█████▄
██
██
██
██
██
██
██
██
██
██
██
█████▀
AmaGold70
Jr. Member
*
Offline Offline

Activity: 35
Merit: 4


View Profile
March 22, 2024, 11:23:52 AM
 #43

Mia Chloe is right. Mining is a Poisson process. One important characteristic of a Poisson process, is that it is memoryless; whether a block was found recently or not, does not give us a clue about the likelihood that another block will be found soon. Whether the last block was mined 2 hours ago or 10 minutes ago, the probability of mining a block within the next 10 minutes remains the same. (Of course, under the assumption that hashrate is constant and blocks are mined every 10 minutes on average)

As displayed in Wikipedia, the formula is: P{N = n} = Λn * e / n!, where:
- n: the number of blocks to find within 10 minutes
- Λ: the number of blocks you would expect to find in 10 minutes.

For n=3, Λ=1, we get 0.0613132, or 6.13%.

The C++ code that implements it is the following:
Code:
#include <iostream>
#include <cmath>
using namespace std;

// constant number 'e'
const double Euler = std::exp(1.0);

// return x^y
int power(int x, int y){
    if(y == 0 && x != 0) return 1;
    int i, z = x;  
    for(i = 0; i < y; i++)
        z *= z;

    return z;
}

// factorial of integer x
int fact(int x){
    if(x == 0) return 1;
    
    int i, factorial = 1;
    for(i = 1; i <= x; i++)
        factorial *= i;

    return factorial;
}

int main(){
    // P{N = n} = Λ^n * e^-Λ / n!
    // n: number of blocks to find within given time frame
    // Λ or lambda: number of blocks you would expect to find in 10 minutes

    int n = 3, lambda = 1;
    double P = power(lambda, n) * pow(Euler, -lambda) / fact(n);
    
    cout << P << endl;
}

Just compile with "g++ -o mining mining.cpp" and run with "./mining".

See how abruptly improbable it becomes as you increase n.
Code:
For n=3, Λ=1, P=0.0613132
For n=4, Λ=1, P=0.01532830
For n=5, Λ=1, P=0.00306566
For n=6, Λ=1, P=0.000510944
For n=7, Λ=1, P=0.00000729
Hahaha, I wasn't expecting to win against top members in the forum but I thought I was pretty close even though my presentation wasn't good enough. Thumbs up @Mia Chloe you deserve the win. @BlackHatcoiner hoping to participate again in your next contest.
BlackHatCoiner (OP)
Legendary
*
Online Online

Activity: 1498
Merit: 7307


Farewell, Leo


View Profile
March 31, 2024, 12:48:46 PM
 #44

New quiz!

https://bitcointalk.org/index.php?topic=5491058.msg63882296#msg63882296

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Pages: « 1 2 [3]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!