TASK 2: Calculating Pi using Leibniz formula and multithreading (15% - 100 marks)
The Leibniz formula is an infinite series method of calculating Pi. The formula is a very simple way of calculating Pi , however, it takes a large amount of iterations to produce a low precision value of Pi . This task requires a large amount of computation and therefore it is vital that you use multithreading to speed up the program. Below is the Leibniz formula:
As the series can be iterated infinite number of times, your program should allow the user to take in 2 inputs; the first is the number of iterations and the second is the number of threads the user would like to use. This means that the slicing of workload needs to be dynamic.
Calculating Pi using Leibniz formula (20 marks)
Using multithreading with appropriate slicing (60 marks)
Correct value of Pi print edoutdependingoniterationcount(20marks) write this code in c programming not in python
TASK 2:Calculating Pi using Leibniz formula and multithreading(15%-100 marks)
The Leibniz formula is an infinite series method of calculating Pi.The formula is a very simple way of
calculating Pi, however,it takes a large amount of iterations to produce a low precision value of Pi
This task requires a large amount of computation and therefore it is vital that you use multithreading
to speed up the program.Below is the Leibniz formula:
(-1)n 2n+1 n= -0
TT
4
As the series can be iterated infinite number of times,your program should allow the user to take in 2 inputs;the first is the number of iterations and the second is the number of threads the user would
like to use.This means that the slicing of workload needs to be dynamic
Calculating Pi using Leibniz formula (20 marks)
Using multithreading with appropriate slicing (60 marks)
Correct value of Pi printed out depending on iteration count (20 marks)