user93004: I understand that the Bitcoin mining problem is to find a string s (hash of previous block + Merkle Tree Hash + nonce) such that sha256(s) has n leading zeros, where n determines the mining difficulty.

According to Blockchain.Info, The Current Difficulty is 63,93,02,37,17,201.

The output of sha256() is a 16 bit hex value.
Question 1
The above image indicates that if N=4, there are 4 zeroes in the 16bit hex value. So if N=16 is the entire string is expected to have only zeroes? Please explain difficulty using this example.
So if N=6393023717201 How do I expect 63,93,02,37,17,201 number of zeroes in 16bit length string? Please explain the significance of this huge number of zeroes in this context.
Question 2
Why is difficulty decreases at some point in time?

user70627: For your First question please check out Bitcoin Mining Difficulty
The Answer to your second question:
Bitcoin network adjusts its difficulty every 2016 blocks (about 2 weeks).
The difficulty adjustment is such that, if the average time to mine a block is greater than 10 minutes, then the difficulty will decrease. If the average time for mining a block is less than 10 minutes, then the difficulty will increase.
Expected Time to mine last 2016 blocks = 2016 * 10 = 20160
Actual Time = Actual time it took
New Difficulty = (20160/Actual Time) * Old Difficulty
Now if the average mining time for last 2016 blocks is less than 10 mins, then;
(20160/Actual Time) > 1; and hence new difficulty will be greater than old value.
Similarly if the average mining time for last 2016 blocks is greater than 10 mins, then;
(20160/Actual Time) < 1; and hence new difficulty will be lower than old value.

user90837: 
Bitcoin mining problem is to find a string s (hash of previous block + Merkle Tree Hash + nonce) such that sha256(s) has n leading zeros, where n determines the mining difficulty.

First a clarification. string s (block header) will include hash of previous block header, merkle root, nonce, target bits, timestamp and nonce. 

So if N=6393023717201, how do I expect 63,93,02,37,17,201 number of zeroes in 16bit length string? 

That is not how difficulty is represented. We start with the genesis block that has a difficulty of 1. At that difficulty we needed to find the block hash that was less than 0x00000000ffff0000000000000000000000000000000000000000000000000000. The current target hash is finding block header less than 0x0000000000000000002c071d0000000000000000000000000000000000000000. So your difficulty number is genesis block header hash target/current block header hash target. That's how you get 6393023717201.863.
Refer here for more info as to how block header hash target is determined using target bits that are in the block header.

Why difficulty decreases at some point in time?

In bitcoin the difficulty keeps the average block time at 10 minutes. If miners start using sophisticated instruments (eg. ASIC chips) that find the solution to the block header faster than 10 minutes, then every 2016 block the difficulty is adjusted so that the time needed to mine blocks increases. If miners start lowering their investments in sophisticated instruments so that average block mining time over 2016 blocks is more than 10 minutes, then the difficulty is lowered so that block mining time is faster. All of this is done so that we converge to 10 minutes as the average block mining time. 

93004: <p>I understand that the Bitcoin mining problem is to find a <strong>string s</strong> (hash of previous block + Merkle Tree Hash + nonce) such that <strong>sha256(s)</strong> has <strong>n</strong> leading zeros, where <strong>n</strong> determines the mining difficulty.</p>
<p><a href="https://i.stack.imgur.com/bSp6c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bSp6c.png" alt="Minng Difficulty" /></a></p>
<p>According to <a href="https://www.blockchain.com/en/charts/difficulty" rel="nofollow noreferrer">Blockchain.Info</a>, The Current Difficulty is 63,93,02,37,17,201.</p>
<p><a href="https://i.stack.imgur.com/VsFi8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VsFi8.png" alt="enter image description here" /></a></p>
<p>The output of <strong>sha256()</strong> is a 16 bit hex value.</p>
<p><strong>Question 1</strong>
The above image indicates that if N=4, there are 4 zeroes in the 16bit hex value. So if N=16 is the entire string is expected to have only zeroes? Please explain difficulty using this example.
So if N=6393023717201 How do I expect 63,93,02,37,17,201 number of zeroes in 16bit length string? Please explain the significance of this huge number of zeroes in this context.</p>
<p><strong>Question 2</strong>
Why is difficulty decreases at some point in time?</p>
 70627: <p>For your First question please check out <a href="https://en.bitcoinwiki.org/wiki/Difficulty_in_Mining#Bitcoin_mining_difficulty" rel="nofollow noreferrer">Bitcoin Mining Difficulty</a></p>

<p>The Answer to your second question:
Bitcoin network adjusts its difficulty every 2016 blocks (about 2 weeks).
The difficulty adjustment is such that, if the average time to mine a block is greater than 10 minutes, then the difficulty will decrease. If the average time for mining a block is less than 10 minutes, then the difficulty will increase.</p>

<p><code>Expected Time to mine last 2016 blocks = 2016 * 10 = 20160</code>
<code>Actual Time = Actual time it took</code></p>

<p><code>New Difficulty = (20160/Actual Time) * Old Difficulty</code></p>

<p>Now if the average mining time for last 2016 blocks is less than 10 mins, then;</p>

<p><code>(20160/Actual Time) &gt; 1;</code> and hence new difficulty will be greater than old value.</p>

<p>Similarly if the average mining time for last 2016 blocks is greater than 10 mins, then;</p>

<p><code>(20160/Actual Time) &lt; 1;</code> and hence new difficulty will be lower than old value.</p>
 90837: <blockquote>
  <p>Bitcoin mining problem is to find a string s (hash of previous block + Merkle Tree Hash + nonce) such that sha256(s) has n leading zeros, where n determines the mining difficulty.</p>
</blockquote>

<p>First a clarification. string s (block header) will include hash of previous block header, merkle root, nonce, target bits, timestamp and nonce. </p>

<blockquote>
  <p>So if N=6393023717201, how do I expect 63,93,02,37,17,201 number of zeroes in 16bit length string? </p>
</blockquote>

<p>That is not how difficulty is represented. We start with the genesis block that has a difficulty of 1. At that difficulty we needed to find the block hash that was less than <code>0x00000000ffff0000000000000000000000000000000000000000000000000000</code>. The current target hash is finding block header less than <code>0x0000000000000000002c071d0000000000000000000000000000000000000000</code>. So your difficulty number is <code>genesis block header hash target/current block header hash target</code>. That's how you get 6393023717201.863.</p>

<p>Refer <a href="https://bitcoin.stackexchange.com/questions/44579/how-is-a-block-header-hash-compared-to-the-target-bits">here</a> for more info as to how block header hash target is determined using target bits that are in the block header.</p>

<blockquote>
  <p>Why difficulty decreases at some point in time?</p>
</blockquote>

<p>In bitcoin the difficulty keeps the average block time at 10 minutes. If miners start using sophisticated instruments (eg. ASIC chips) that find the solution to the block header faster than 10 minutes, then every 2016 block the difficulty is adjusted so that the time needed to mine blocks increases. If miners start lowering their investments in sophisticated instruments so that average block mining time over 2016 blocks is more than 10 minutes, then the difficulty is lowered so that block mining time is faster. All of this is done so that we converge to 10 minutes as the average block mining time. </p>
