<p>To sum up the mining process: miners have a <em>potential</em> future block and they need to solve a problem based on that block to prove that they worked on it (Proof of Work). They apply a <a href="https://en.wikipedia.org/wiki/Hash_function" rel="nofollow noreferrer">hash function</a> to the block and get back a hash. The hash needs to have some properties, e.g. start with 3 zeros. If it doesn't, the miners change a value in the block (called nonce) and apply the hash function again. The new hash will be different. If it still doesn't start with 3 zeros miners repeat the process until they find a hash that starts with 3 zeros. For more details, please read <a href="https://en.bitcoin.it/wiki/Proof_of_work" rel="nofollow noreferrer">this</a> to understand the mining process.</p>

<p>A hash function is in itself deterministic. However, the mining process is not. Thus, the answer in the link you provided is wrong. If everyone was trying to mine identical blocks with identical nonces of the same exact order then it might be, in a sense, deterministic but that is not the case. </p>

<p>Everyone has a chance to win (although it is so small that in practice doesn't occur). See <a href="https://bitcoin.stackexchange.com/questions/14346/what-are-the-odds-of-discovering-a-block-as-a-solo-miner">here</a> for some examples.</p>

CC BY-SA 3.0
2016-02-23T11:19:46.320Z
2016-02-23T11:19:46.320Z
2017-04-13T12:47:33.743Z
karask
<p>The number of attempts to close a block is probabilistically determined by the law of large numbers. In other words, it is theoretically possible for you to generate at your first try an hashing that meets the target even using your paper and pencil but the probability is very low. </p>

<p>As analogy, if you bet on zero playing at roulette you have <strong>1/36</strong> of chance per try. It turns out that you can win at your first try or most likely you don't. If you repeat the try <strong>N</strong> times (say 1000 times), you will observe that you will win a number <strong>K</strong> of bets, where <strong>K/N</strong> is a random variable that has an expected value of <strong>1/36</strong>. That <strong>does NOT mean that your K/N is equal to 1/36</strong>, it means that if you repeat the <strong>N</strong> sequence again and again you will observe <strong>K/N</strong> average value will be close to <strong>1/36</strong>. </p>

<p>In the same way, mining a block is like betting on zero on a roulette with many many more numbers (your odds being much much lower) and according to the number of attempts you can do (say per hour) it is probabilistically defined how many blocks you will be likely to close in the same period.  </p>

CC BY-SA 3.0
2016-02-23T22:20:35.933Z
Good answer with the analogy. You should try to aerate the text more though, try to make it more readable.
Gopoi
CC BY-SA 3.0
2016-02-23T11:17:49.613Z
2016-02-24T10:35:44.330Z
2016-02-24T10:35:44.330Z
Davide C
<p><a href="https://islam.stackexchange.com/a/12320/940">This</a> answer says that Bitcoin is not chance based, may I know how it is deterministic and does not have any associated probability of mining a coin?</p>

<cryptography><mining-theory><random>
Is Bitcoin mining chance based?
Ali
# Is Bitcoin mining chance based?

(Asked by: username_0 on 2016-02-23)

[This](https://islam.stackexchange.com/a/12320/940) answer says that Bitcoin is not chance based, may I know how it is deterministic and does not have any associated probability of mining a coin?

**Tags:** cryptography, mining-theory, random


---

## 2 answers

### Answer by username_1 on 2016-02-23. Score: 1

To sum up the mining process: miners have a *potential* future block and they need to solve a problem based on that block to prove that they worked on it (Proof of Work). They apply a [hash function](https://en.wikipedia.org/wiki/Hash_function) to the block and get back a hash. The hash needs to have some properties, e.g. start with 3 zeros. If it doesn't, the miners change a value in the block (called nonce) and apply the hash function again. The new hash will be different. If it still doesn't start with 3 zeros miners repeat the process until they find a hash that starts with 3 zeros. For more details, please read [this](https://en.bitcoin.it/wiki/Proof_of_work) to understand the mining process.

A hash function is in itself deterministic. However, the mining process is not. Thus, the answer in the link you provided is wrong. If everyone was trying to mine identical blocks with identical nonces of the same exact order then it might be, in a sense, deterministic but that is not the case.

Everyone has a chance to win (although it is so small that in practice doesn't occur). See [here](https://bitcoin.stackexchange.com/questions/14346/what-are-the-odds-of-discovering-a-block-as-a-solo-miner) for some examples.


---

### Answer by username_2 on 2016-02-23. Score: 0

The number of attempts to close a block is probabilistically determined by the law of large numbers. In other words, it is theoretically possible for you to generate at your first try an hashing that meets the target even using your paper and pencil but the probability is very low.

As analogy, if you bet on zero playing at roulette you have **1/36** of chance per try. It turns out that you can win at your first try or most likely you don't. If you repeat the try **N** times (say 1000 times), you will observe that you will win a number **K** of bets, where **K/N** is a random variable that has an expected value of **1/36**. That **does NOT mean that your K/N is equal to 1/36**, it means that if you repeat the **N** sequence again and again you will observe **K/N** average value will be close to **1/36**.

In the same way, mining a block is like betting on zero on a roulette with many many more numbers (your odds being much much lower) and according to the number of attempts you can do (say per hour) it is probabilistically defined how many blocks you will be likely to close in the same period.

> **Comments:**
> **username_3**: Good answer with the analogy. You should try to aerate the text more though, try to make it more readable.  

---

