An Upper Bound for Locating Strings with High Probability Within Consecutive Bits of Pi
Abstract
1. Introduction
2. Materials and Methods
2.1. Bernoulli Model
2.2. Information Entropy
2.3. Correlation Coefficient
2.4. Discrete Fourier Transform
2.5. Goodness-of-Fit Test
3. Two Hypothesis Derived from Pi
3.1. Equiprobable Property of Bits
3.2. Independence Property of Bit Strings
- Let represent a bit to the right of the decimal point of the number .
- Let denote a string of n bits.
- Let a different bit string with m bits. It is assumed that there is at least a bit at position j in that does not exist at the same position in , and vice-versa.
4. The Upper Bound
4.1. The Probability of Selecting a String
- Base case: The base case is considered when , representing the probability of selecting the 1-bit string , which consists solely of the bit . In other words, . According to the first hypothesis, it follows thatThis result aligns with the statement of the Lemma, confirming consistency.
- Inductive hypothesis: Assume that the Lemma holds true for . Under this assumption, the inductive hypothesis states that the probability of selecting the k-bit string is given by .
- Inductive step: Prove that the formula also holds for . We then analyze the scenario wherein a string of bits is selected, it is . Consequently, the probability of selecting the string can be expressed as the probability of selecting the k-bit string and the 1-bit string .Leveraging the Hypothesis 2, we deduceSubsequently, utilizing the inductive hypothesis and the Hypothesis 1 indicating , it follows thatConsequently,
4.2. The Probability of Finding
- First trial: The initial n consecutive bits of the string are selected and compared to determine if they match the string . A successful outcome occurs when the selected sequence matches the string, while failure arises if there is no match. Referring to Lemma 1, the probability of success is . In addition, it is possible to form strings of n consecutive bits in one of length N, which implies that the number of trials is .
- Second trial: Another string of n bits is obtained from starting from bit position 1 and extending to bit n. Following the same reasoning, the probability of this string being equal to is . Additionally, since the string of n bits from trial 1 is different from that of trial 2, it is independent as per the second hypothesis.
- i-th trial: In general, for the i-th trial, the string to be compared with starts from bit number of , encompassing the consecutive n bits.
4.3. An Upper Bound N for Finding
5. Results Analysis and Discussion
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviation
DFT | Discrete Fourier Transform |
References
- Agarwal, R.P.; Agarwal, H.; Sen, S.K. Birth, growth and computation of pi to ten trillion digits. Adv. Differ. Equ. 2013, 2013, 100. [Google Scholar] [CrossRef]
- Bailey, D.H.; Borwein, J.M. Pi: The Next Generation: A Sourcebook on the Recent History of Pi and Its Computation, 1st ed.; Springer International Publishing: Cham, Switzerland, 2016; Volume 5, pp. 1–501. [Google Scholar] [CrossRef]
- Balasubramanian, K.; Davidson, E.R. Rational approximations to pie: Transcendental π and Euler’s Constant e. J. Math. Chem. 2023, 61, 1471–1476. [Google Scholar] [CrossRef]
- Bailey, D.; Borwein, P.; Plouffe, S. On the rapid computation of various polylogarithmic constants. Math. Comput. 1997, 66, 903–913. [Google Scholar] [CrossRef]
- Frey, B.; Van Schie, A.; Zacheo, G. Pi-Experience—Making 62.8 Trillion Digits Come Alive. In Proceedings of the 15th International Symposium on Visual Information Communication and Interaction (VINCI), Chur, Switzerland, 16–18 August 2022; pp. 1–4. [Google Scholar] [CrossRef]
- Bokari, N. Piece of Pi: Wit-Sharpening, Brain-Bruising, Number-Crunching Activities With Pi, 1st ed.; Taylor & Francis: New York, NY, USA, 2023; pp. 1–3. [Google Scholar] [CrossRef]
- Wang, H.; Hsu, C.; Harn, L. A Lightweight and Robust Stream Cipher Based on PI for Intelligent Transportation Systems. Wirel. Pers. Commun. 2023, 130, 1661–1675. [Google Scholar] [CrossRef]
- Mengdi, Z.; Xiaojuan, Z.; Yayun, Z.; Siwei, M. Overview of randomness test on cryptographic algorithms. J. Phys. Conf. Ser. 2021, 1861, 012009. [Google Scholar] [CrossRef]
- Silva-García, V.M.; Ramírez-González, M.D.; Flores-Carapia, R.; Vega-Alvarado, E.; Escobar-Rodríguez, E. A novel method for image encryption based on chaos and transcendental numbers. IEEE Access 2019, 7, 163729–163739. [Google Scholar] [CrossRef]
- Erkan, U.; Toktas, A.; Toktas, F.; Alenezi, F. 2D eπ-map for image encryption. Inf. Sci. 2022, 589, 770–789. [Google Scholar] [CrossRef]
- Richards, N. Questions in Dataviz: A Design-Driven Process for Data Visualization, 1st ed.; AK Peters/CRC Press: Boca Raton, FL, USA, 2022; pp. 286–288. [Google Scholar] [CrossRef]
- Émile Borel, M. Les probabilités dénombrables et leurs applications arithmétiques. Rend. Circ. Matem. Palermo 1909, 27, 247–271. [Google Scholar] [CrossRef]
- Wagon, S. Is π normal? Math. Intell. 1985, 7, 65–67. [Google Scholar] [CrossRef]
- Lepore, A.; Palumbo, B.; Poggi, J.M. Interpretability for Industry 4.0: Statistical and Machine Learning Approaches, 1st ed.; Springer Nature: Cham, Switzerland, 2022; pp. 5–6. [Google Scholar] [CrossRef]
- Bailey, D.H.; Borwein, J.M.; Calude, C.S.; Dinneen, M.J.; Dumitrescu, M.; Yee, A. An empirical approach to the normality of π. Exp. Math. 2012, 21, 375–384. [Google Scholar] [CrossRef]
- Bailey, D.H.; Borwein, J.M.; Brent, R.P.; Reisi, M. Reproducibility in computational science: A case study: Randomness of the digits of Pi. Exp. Math. 2017, 26, 298–305. [Google Scholar] [CrossRef]
- Gronau, Q.F.; Wagenmakers, E.J. Bayesian evidence accumulation in experimental mathematics: A case study of four irrational numbers. Exp. Math. 2018, 27, 277–286. [Google Scholar] [CrossRef]
- Miklas-Kalczynska, M.; Drezner, T.D.; Drezner, Z. Experimenting with the generalized binomial distribution. Commun. Stat. Case Stud. Anal. Appl. 2024, 10, 27–46. [Google Scholar] [CrossRef]
- Shapiro, S.S.; Zahedi, H. Bernoulli trials and discrete distributions. J. Qual. Technol. 1990, 22, 193–205. [Google Scholar] [CrossRef]
- Li, C.; Lin, D.; Feng, B.; Lü, J.; Hao, F. Cryptanalysis of a chaotic image encryption algorithm based on information entropy. IEEE Access 2018, 6, 75834–75842. [Google Scholar] [CrossRef]
- Zolfaghari, B.; Bibak, K.; Koshiba, T. The odyssey of entropy: Cryptography. Entropy 2022, 24, 266. [Google Scholar] [CrossRef] [PubMed]
- Kumar, V.; Pathak, V.; Badal, N.; Pandey, P.S.; Mishra, R.; Gupta, S.K. Complex entropy based encryption and decryption technique for securing medical images. Multimed. Tools Appl. 2022, 81, 37441–37459. [Google Scholar] [CrossRef] [PubMed]
- Wu, Y.; Zhou, Y.; Saveriades, G.; Agaian, S.; Noonan, J.P.; Natarajan, P. Local Shannon entropy measure with statistical tests for image randomness. Inf. Sci. 2013, 222, 323–342. [Google Scholar] [CrossRef]
- Alghamdi, Y.; Munir, A. Image Encryption Algorithms: A Survey of Design and Evaluation Metrics. J. Cybersecur. Priv. 2024, 4, 126–152. [Google Scholar] [CrossRef]
- Diaconu, A.V.; Dascalescu, A.C. Correlation distribution of adjacent pixels randomness test for image encryption. Proc. Rom. Acad. Ser. A 2017, 18, 351–360. [Google Scholar]
- Luengo, E.A.; Olivares, B.A.; Villalba, L.J.G.; Hernandez-Castro, J. Further analysis of the statistical independence of the NIST SP 800-22 randomness tests. Appl. Math. Comput. 2023, 459, 128222. [Google Scholar] [CrossRef]
- Cirrone, G.; Donadio, S.; Guatelli, S.; Mantero, A.; Mascialino, B.; Parlati, S.; Pia, M.; Pfeiffer, A.; Ribon, A.; Viarengo, P. A goodness-of-fit statistical toolkit. IEEE Trans. Nucl. Sci. 2004, 51, 2056–2063. [Google Scholar] [CrossRef]
- Brereton, R.G. The chi squared and multinormal distributions. J. Chemometr. 2014, 29, 9–12. [Google Scholar] [CrossRef]
- Zhang, X.; Liu, G.; Zou, C. An image encryption method based on improved Lorenz chaotic system and Galois field. Appl. Math. Model. 2024, 131, 535–568. [Google Scholar] [CrossRef]
- Wen, H.; Xie, Z.; Wu, Z.; Lin, Y.; Feng, W. Exploring the future application of UAVs: Face image privacy protection scheme based on chaos and DNA cryptography. J. King Saud Univ.-Comput. Inf. Sci. 2024, 36, 101871. [Google Scholar] [CrossRef]
- Singh, L.D.; Thingbaijam, R.; Patgiri, R.; Singh, K.M. Cryptanalysis of cross-coupled chaotic maps multi-image encryption scheme. J. Inf. Secur. Appl. 2024, 80, 103694. [Google Scholar] [CrossRef]
- Bailey, D.H.; Crandall, R.E. Random generators and normal numbers. Exp. Math. 2002, 11, 527–546. [Google Scholar] [CrossRef]
- Ponuma, R.; Amutha, R. Compressive sensing based image compression-encryption using novel 1D-chaotic map. Multimed. Tools Appl. 2018, 77, 19209–19234. [Google Scholar] [CrossRef]
- Iqbal, N.; Hussain, I.; Khan, M.A.; Abbas, S.; Yousaf, S. An efficient image cipher based on the 1D scrambled image and 2D logistic chaotic map. Multimed. Tools Appl. 2023, 82, 40345–40373. [Google Scholar] [CrossRef]
- Du, L.; Teng, L.; Liu, H.; Lu, H. Multiple face images encryption based on a new non-adjacent dynamic coupled mapping lattice. Expert Syst. Appl. 2024, 238, 121728. [Google Scholar] [CrossRef]
- Xian, Y.; Wang, X. Fractal sorting matrix and its application on chaotic image encryption. Inf. Sci. 2021, 547, 1154–1169. [Google Scholar] [CrossRef]
- Wang, C.; Chong, Z.; Zhang, H.; Ma, P.; Dong, W. Color image encryption based on discrete memristor logistic map and DNA encoding. Integration 2024, 96, 102138. [Google Scholar] [CrossRef]
- Holzer, M.; Kutrib, M. Descriptional and computational complexity of finite automata—A survey. Inf. Comput. 2011, 209, 456–470. [Google Scholar] [CrossRef]
Bit String Length n | Percentage of Zero Bits | Percentage of One Bits |
---|---|---|
49.999583 | 50.000417 | |
51.074219 | 48.925781 | |
49.935913 | 50.064087 | |
50.023270 | 49.976730 | |
49.990329 | 50.009671 | |
49.999331 | 50.000669 | |
50.000190 | 49.999810 | |
50.000034 | 49.999966 | |
49.999905 | 50.000095 |
Bit String Length (n) of , and | ||||
---|---|---|---|---|
Starting Bit () of | 100 | 1000 | 1,000,000 | 100,000,000 |
1 | −0.04166 | −0.00200 | 0.00080 | 0.000025 |
2 | −0.08333 | 0.00459 | −0.00121 | 0.00012 |
3 | −0.08333 | 0.00799 | −0.00052 | 0.000072 |
4 | 0.10790 | 0.00439 | 0.00081 | −0.000055 |
5 | 0.02490 | −0.00800 | −0.00050 | −0.000075 |
6 | −0.09960 | −0.00320 | 0.00048 | 0.000076 |
7 | −0.11580 | 0.00119 | 0.00100 | 0.000100 |
8 | 0.03298 | −0.01040 | 0.00021 | −0.000100 |
9 | −0.04947 | 0.00219 | 0.00062 | 0.000059 |
10 | 0.11544 | −0.00200 | 0.00184 | 0.000088 |
Measure | Figure | Red | Green | Blue |
---|---|---|---|---|
Horizontal correlation | Figure 1 | 0.00462 | −0.00067 | −0.00979 |
Figure 2 | 0.00102 | −0.00151 | −0.00396 | |
Vertical correlation | Figure 1 | 0.00290 | −0.00189 | 0.00287 |
Figure 2 | −0.00152 | 0.00049 | −0.00103 | |
Diagonal correlation | Figure 1 | −0.00687 | 0.00195 | −0.00292 |
Figure 2 | 0.00137 | 0.00548 | −0.00336 | |
Entropy | Figure 1 | 7.99920 | 7.99939 | 7.99931 |
Figure 2 | 7.99981 | 7.99982 | 7.99982 |
Test | Figure | Red | Green | Blue |
---|---|---|---|---|
Figure 1 | 288.7 < 308 ✔ | 218.3 < 308 ✔ | 250.2 < 308 ✔ | |
Figure 2 | 262.6 < 308 ✔ | 247.9 < 308 ✔ | 262.0 < 308 ✔ | |
p-value of DFT | Figure 1 | 0.789 > 0.01 ✔ | 0.501 > 0.01 ✔ | 0.292 > 0.01 ✔ |
Figure 2 | 0.782 > 0.01 ✔ | 0.502 > 0.01 ✔ | 0.294 > 0.01 ✔ |
Starting Bit-Position of of Consecutive | |||
---|---|---|---|
Length | Length | Zeros | Ones |
5 | 150 | 95 | 10 |
10 | 4723 | 901 | 644 |
15 | 150,914 | 11,790 | 58,275 |
20 | 4,828,882 | 726,843 | 1,962,900 |
25 | 154,523,896 | 171,498,579 | 47,536,570 |
30 | 4,944,763,863 | 1,407,238,213 | 207,861,697 |
35 | 158,232,442,734 | 21,774,349,073 | 61,906,790,708 |
40 | 5,063,438,167,262 | 1,584,920,456,449 | 1,748,147,295,589 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Silva-García, V.M.; Cardona-López, M.A.; Flores-Carapia, R. An Upper Bound for Locating Strings with High Probability Within Consecutive Bits of Pi. Mathematics 2025, 13, 313. https://doi.org/10.3390/math13020313
Silva-García VM, Cardona-López MA, Flores-Carapia R. An Upper Bound for Locating Strings with High Probability Within Consecutive Bits of Pi. Mathematics. 2025; 13(2):313. https://doi.org/10.3390/math13020313
Chicago/Turabian StyleSilva-García, Víctor Manuel, Manuel Alejandro Cardona-López, and Rolando Flores-Carapia. 2025. "An Upper Bound for Locating Strings with High Probability Within Consecutive Bits of Pi" Mathematics 13, no. 2: 313. https://doi.org/10.3390/math13020313
APA StyleSilva-García, V. M., Cardona-López, M. A., & Flores-Carapia, R. (2025). An Upper Bound for Locating Strings with High Probability Within Consecutive Bits of Pi. Mathematics, 13(2), 313. https://doi.org/10.3390/math13020313