================================================================================
LAB 4: PROOF-OF-WORK EXECUTION & COMMAND REFERENCE GUIDE
================================================================================

1. CHECK PYTHON ENVIRONMENT
--------------------------------------------------------------------------------
Command: python --version  (or python3 --version)
Explanation: Verifies Python 3.x is installed. Only standard library modules 
             ('hashlib' and 'time') are used, so no extra pip install is needed.

2. RUN ENTIRE LAB SUITE (TASKS 1 THROUGH 4)
--------------------------------------------------------------------------------
Command: python pow_lab4.py
Explanation: Executes all 4 tasks sequentially and outputs formatted terminal logs.

3. EXECUTE SINGLE TASK MODULES INTERACTIVELY (VIA PYTHON INTERACTIVE SHELL)
--------------------------------------------------------------------------------
Command: python -i pow_lab4.py
Explanation: Runs the script and opens an interactive prompt so you can execute
             specific tasks on demand with custom parameters:

  - Task 2 (Mine block at specific difficulty):
    >>> execute_task_2(difficulty=4)

  - Task 3 (Compare effort across custom difficulty steps):
    >>> execute_task_3(difficulties=[1, 2, 3, 4, 5, 6])

  - Task 4 (Analyze target threshold & probability for target difficulty):
    >>> execute_task_4(difficulty=6)

4. SAVE EXECUTION OUTPUT TO A TEXT FILE (FOR LAB REPORT SUBMISSION)
--------------------------------------------------------------------------------
Command: python pow_lab4.py > lab4_results.txt
Explanation: Redirects all terminal stdout into 'lab4_results.txt' to easily copy
             or print raw metrics directly for examiner submission.

5. MEASURE EXACT EXECUTION TIME VIA SYSTEM COMMAND
--------------------------------------------------------------------------------
Linux/macOS Command: time python pow_lab4.py
Windows PowerShell Command: Measure-Command { python pow_lab4.py }
Explanation: Evaluates total operating system CPU/real clock time taken to finish.
================================================================================








#######
Sample Ouput:

>>> LAB 4: PROOF-OF-WORK, NONCE AND MINING DIFFICULTY <<<

=================================================================
 TASK 1: Proof-of-Work Engine Functional Test (Difficulty: 2)
=================================================================
Status:                 PoW Engine Initialized & Working
Input Data String:      'Lab4_Task1_Initialization_Test'
Target Prefix Required: '00'
Validated Hash Result:  00b9cdf2413fb9204f4a309d16d0da31ee3077a99e0e1355c5757b11809f025f
Nonce Found:            17

=================================================================
 TASK 2: Mine Block & Report Nonce, Hash & Attempts (Difficulty: 4)
=================================================================
Target Prefix Required: '0000'
Resulting Nonce:        43146
Resulting Hash:         0000368a4686782f1ceb806faeefbf0473eb2a953d851892d5aea0d35dbb2fcd
Total Iterations:       43,147
Execution Time:         0.0594 seconds

=====================================================================================
 TASK 3: Mining Difficulty & Computational Effort Comparison
=====================================================================================
Diff   | Attempts     | Time (s)   | Growth Factor  | Resulting Hash
-------------------------------------------------------------------------------------
1      | 4            | 0.0000     | Baseline       | 09b1e35d517d0d8f8865db5e...
2      | 127          | 0.0002     | 31.75x         | 00d22fae532741393ab93799...
3      | 3,374        | 0.0060     | 26.57x         | 0007c6b4c6822c8c993efe53...
4      | 34,225       | 0.0481     | 10.14x         | 0000ecf29abf1729d730b91f...
5      | 2,585,087    | 2.6096     | 75.53x         | 000006a3e330dcbcbfc56775...

=====================================================================================
 TASK 4: Target, Difficulty, and Effort Relationship (Difficulty: 5)
=====================================================================================
1. Leading Zero Target Prefix:  00000
2. Numerical Target Threshold:  0x00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
3. Relative Target Size:        0.000095%
4. Success Probability (p):     9.536743e-07 (1 in 16^5)
5. Theoretical Expected Engine:  1,048,576 attempts
