Computing the Value of Pi in the Manner of Lambda Function with R Statistical Programming Language


  • Muhammad Reza Fahlevi Universitas Sumatera Utara
  • Mohammad Andri Budiman Universitas Sumatera Utara



anonim, fungsi, integral, jumlah riemann, lingkaran, luas di bawah suatu kurva, R


The value of π is one of the famous mathematical constant, not only to mathematicians, but also to physicists and to engineers. Numerous algorithm is used to compute what is the value of π, but most of programmer do not use lambda function and neglect the aesthetic of their script. This study aims to compute the value π by write it first as infinite series using Riemann sum, and then the computing of it is conducted in R programming language. We involved the role of anonymous function or known as lambda function to make the R code is more beautiful, artistic, and elegant.


Download data is not yet available.


J. Stewart, D. K. Clegg, and S. Watson, Calculus: early transcendentals. Cengage Learning, 2020.

H. Wickham, “The tidyverse,” R Packag. ver, vol. 1, no. 1, p. 1, 2017.

O. Yavoruk, “How does the Monte Carlo method work?,” arXiv Prepr. arXiv1909.13212, 2019.

H. Bae and J. Chang, “An investigation into computing the digits of pi.”

G. Galperin, “Playing pool with $π$ (the number $π$ from a billiard point of view),” Regul. chaotic Dyn., vol. 8, no. 4, pp. 375–394, 2003.

T. W. Körner, Vectors, pure and applied: a general introduction to linear algebra. Cambridge University Press, 2012.

W. N. Venables and D. M. Smith, “The R Core Team. An Introduction to R, Notes on R: A Programming Environment for Data Analysis and Graphics, Version 3.6. 3. 2020.” 2020.



How to Cite

Muhammad Reza Fahlevi, & Budiman, M. A. (2021). Computing the Value of Pi in the Manner of Lambda Function with R Statistical Programming Language. Data Science: Journal of Computing and Applied Informatics, 5(1), 39-48.