1. Introduction
Random numbers generation is the process of generating a sequence of numbers that appear to be random, with no predictable pattern or structure. Random numbers are a fundamental component of many applications in probability theory and statistics, as well as in various fields such as finance, engineering, computer science, and cryptography. [1]
In probability theory, random numbers play a critical role in simulation and modeling. Simulations are often used to study the behavior of complex systems or to estimate the probability of rare events. To perform such simulations, random numbers are used to represent the various sources of uncertainty in the system being modeled. For example, in a simulation of a manufacturing process, random numbers might be used to represent the variation in the size or weight of raw materials, or the variability in machine settings or operator behavior.
The use of random numbers in simulation allows the modeler to study the behavior of the system under a wide range of possible scenarios, and to estimate the likelihood of various outcomes. [2-3]
Random numbers also play a critical role in statistical inference, which is the process of drawing conclusions about a population based on a sample of data. Random sampling is a common method used in statistics to select a subset of individuals or units from a larger population for analysis. By using random sampling, it is possible to ensure that the sample is representative of the population, and to make statistical inferences about the population based on the characteristics of the sample. In addition, random numbers are used in various statistical tests to determine whether an observed pattern or result is likely to have occurred by chance or is statistically significant. [4]
There are many methods for generating random numbers, ranging from simple coin flips and dice rolls to more sophisticated algorithms based on complex mathematical formulas or physical processes. The choice of a particular method depends on the application and the desired properties of the random numbers, such as their distribution, independence, and reproducibility. [5]
In neutrosophic sets theory many goodness of fit tests were generalized to handle uncertain interval valued data like [6-10], but until this moment there is no test can handle neutrosophic literal numbers of the form π= π+ ππΌ ; πΌ2 = πΌ. So, in this paper we will first represent a method for generating random numbers follow a specific literal neutrosophic probability distribution then we represent a goodness of fit approach that assure the null hypothesis of having no significant difference between the generated numbers and the generator distribution.
2. Preliminaries
Definition 2.1 [11]
Definition 2.2 [12]
Let π (πΌ) be the literal neutrosophic real numbers set, transformation π defined below is called the AHisometry:
Let π1, π2 βπ (πΌ) and π be the AH-Isometry, π is an algebraic isomorphism and it satisfies the following properties:
3. π is correspondence one-to-one.
4. π preserves distances.
Definition 2.3 [12]
Definition 2.4 [13]
with one neutrosophic variable.
Definition 2.5 [14-15]
Literal neutrosophic random variable ππ is defined as follows:
Where:
And:
π1, π2 are both real valued crisp random variables defined on Ξ©1, Ξ©2 respectively and taking values in π .
Definition 2.6 [7]
Literal neutrosophic probability ππ is defined as follows:
1. Proposed Algorithm for Random Literal Neutrosophic Numbers Generating
Say that ππ= π1 + π2πΌ is a literal neutrosophic probability that describes the literal neutrosophic cumulative probability distribution πΉπ(π₯π; Ξπ) where Ξπ= Ξ1 + Ξ2πΌ is a vector of distributionβs parameters, i.e., ππ=
πΉπ(π₯π; Ξπ), then to generate random literal neutrosophic numbers following distribution πΉπ we can follow the following steps:
1. Solve the neutrosophic equation ππ= πΉπ(π₯π; Ξπ) for π₯π to get an equation of the form:
2. Take the isometry to equation (3).
3. You will have two equations of the form:
4. Generate a random number for π1 in [0,1] and for π1 + π2 in [0,1] (a crisp uniformly distributed number).
5. Solve equations (4-5) with respect to π₯1, π₯2.
6. The random literal neutrosophic number will be:
7. Repeat steps 4 to 6 until you have the sufficient set of numbers.
3.1 Random Numbers Generation of Literal Neutrosophic Uniform Distribution (LNUD)
Literal neutrosophic cumulative distribution function (LNCDF) of LNUD is defined in [7] as:
Solving equation (6) with respect to π₯π gives:
Taking isometric image of (7) results:
Which means depending on (2) and the properties of AH-Isometry that:
: ECDF and TCDF of π1 of LNUD Figure 1: ECDF and TCDF of π1 + π2 of LNUD
3.2 Random Numbers Generation of Literal Neutrosophic Exponential Distribution (LNED)
Literal neutrosophic cumulative distribution function (LNCDF) of LNED is defined in [7] as:
Solving equation (9) with respect to π₯π gives:
Taking isometric image of (10) results:
Which means depending on (2) and the properties of AH-Isometry that:
3.3 Random Numbers Generation of Literal Neutrosophic Normal Distribution (LNND)
Literal neutrosophic cumulative distribution function (LNCDF) of LNND is defined in [7] as:
Or simply write:
Solving equation (12) with respect to π₯π gives:
Taking isometric image of (13) results:
Which means depending on (2) and the properties of AH-Isometry that:
2. Literal Neutrosophic Kolmogorov-Smirnov Goodness of Fit Test
The Kolmogorov-Smirnov (KS) test is a statistical test used to determine whether a sample of data comes from a specified distribution, such as a normal distribution or an exponential distribution. The KS test can be used as a goodness-of-fit test to test the hypothesis that a sample of data comes from a specified distribution.
In this section we are going to develop the classical KS test to handle literal neutrosophic numbers proposing the following algorithm:
1. Determine the literal neutrosophic distribution to which you want to compare your data.
2. Define the null hypothesis and the alternative hypothesis. The null hypothesis is that the sample of data comes from the specified distribution, while the alternative hypothesis is that the sample of data does not come from the specified distribution.
3. Calculate the LNCDF of the specified distribution.
4. Calculate the literal neutrosophic empirical distribution function (LNEDF) of your sample data, here you will use neutrosophic ordering relation in definition 2.3.
5. Calculate the test statistic, which is the maximum absolute difference between the LNCDF and
LNEDF.
Where:
πΉπ is the LNCDF of the specified distribution.
ππ is the LNEDF of the sample data.
6. Calculate neutrosophic p-value (ππ£π) of the test using the formula:
7. Compare the calculate ππ£π with desired significance level πΌπ= πΌ1 + πΌ2πΌ (can be crisp significance level when πΌ2 = 0). If ππ£π is less than πΌπ, reject the null hypothesis; otherwise, fail to reject the null hypothesis.
3. Simulation Study
1. Based on equation (8), a simulation study was performed π= 10000 times to generate different samples of sizes π= 10,30,50,100 each is following literal neutrosophic uniform distribution with parameters ππ= 1 βπΌ, ππ= 2 + 2πΌ and tested whether these random samples are drawn from literal neutrosophic uniform distribution with parameters ππ= 1.5 βπΌ, ππ= 2.5 + 2πΌ or not at significance level πΌ= 0.05. The following table shows simulation results:
We see that test power increases when sample size increases. Proposed Kolmogorov-Smirnov test works better with samples of size larger than 50 for literal neutrosophic uniform distribution detection.
2. Based on equation (11), a simulation study was performed π= 10000 times to generate different samples of sizes π= 10,30,50,100 each is following literal neutrosophic exponential distribution with parameter ππ= 2.5 β1.5πΌ and tested whether these random samples are drawn from literal neutrosophic exponential distribution with parameter ππ= 4 βπΌ or not at significance level πΌ= 0.05. The following table shows simulation results:
4. Conclusions and future research directions
In this study, we developed a new random number generator algorithm and applied it to find analytical formulas for three different literal neutrosophic probability distributions: uniform, exponential, and normal. We also developed the Kolmogorov-Smirnov test for goodness of fit to evaluate the performance of literal neutrosophic data. Our results show that the power of the test increases as the sample size grows, indicating that the test is effective in detecting differences between the generated data and the target distributions. Our study has several strengths, including the use of literal neutrosophic distributions and the potential applications of the developed algorithm in various fields. However, further research is needed to explore the properties of these distributions and to compare the results of our method with those from other methods. In conclusion, our study provides a new tool for generating random numbers from literal neutrosophic probability distributions and for evaluating the goodness of fit of the generated data. Future research in this area could further improve the performance and applicability of these methods.
Funding: βThis research received no external fundingβ
Acknowledgments: Authors are very thankful to Editors-In-Chief for their assistance and management, authors also thank reviewers for their valuable edits and suggestions.
Conflicts of Interest: βThe authors declare no conflict of interest.β
References
Appendix β R Code
# Generating Random Numbers Code
rm(list=ls()) library(ggplot2) set.seed(123) options("scipen"=100, "digits"=4) n<-1000
####################################################
#Uniform x1<-runif(n,min=1,max=2) x12<-runif(n,min=0,max=4) for (i in 1:n) if(x12[i]-x1[i]>=0) cat(x1[i],"+",x12[i]-x1[i],"I\n") else cat(x1[i],"-",abs(x12[i]-x1[i]),"I\n") for (i in 1:n) cat(x1[i],"\n") for (i in 1:n) cat(x12[i]-x1[i],"\n") ggplot(data.frame(x1), aes(x1)) + stat_ecdf(geom = "step", aes(colour = "ECDF")) + stat_function( fun = ~ (.x-1)
,aes(colour = "TCDF") theme_light() + labs( x = "x1", y = "Fn(x)", title = "Empirical Distribution Function"
ggplot(data.frame(x12), aes(x12)) + stat_ecdf(geom = "step", aes(colour = "ECDF")) + stat_function( fun = ~ (.x/4)
,aes(colour = "TCDF") theme_light() + labs( x = "x1+x2", y = "Fn(x)", title = "Empirical Distribution Function"
#####################################################
#Exponential x1<-rexp(n,rate=2.5) x12<-rexp(n,rate=1) for (i in 1:n) if(x12[i]-x1[i]>=0) cat(x1[i],"+",x12[i]-x1[i],"I\n") else cat(x1[i],"-",abs(x12[i]-x1[i]),"I\n") for (i in 1:n) cat(x1[i],"\n") for (i in 1:n) cat(x12[i]-x1[i],"\n") ggplot(data.frame(x1), aes(x1)) + stat_ecdf(geom = "step", aes(colour = "ECDF")) + stat_function( fun = ~ (1-exp(-2.5*.x))
,aes(colour = "TCDF") theme_light() + labs( x = "x1", y = "Fn(x)", title = "Empirical Distribution Function"
ggplot(data.frame(x12), aes(x12)) + stat_ecdf(geom = "step", aes(colour = "ECDF")) + stat_function( fun = ~ (1-exp(-.x))
,aes(colour = "TCDF") theme_light() + labs( x = "x1+x2", y = "Fn(x)", title = "Empirical Distribution Function"
############################################################### n<-1000
#Normal x1<-rnorm(n,0,1) x12<-rnorm(n,2,2) for (i in 1:n) if(x12[i]-x1[i]>=0) cat(x1[i],"+",x12[i]-x1[i],"I\n") else cat(x1[i],"-",abs(x12[i]-x1[i]),"I\n") for (i in 1:n) cat(x1[i],"\n") for (i in 1:n) cat(x12[i]-x1[i],"\n") ggplot(data.frame(x1), aes(x1)) + stat_ecdf(geom = "step", aes(colour = "ECDF")) + stat_function( fun = ~ (pnorm(.x,mean=0,sd=1))
,aes(colour = "TCDF") theme_light() + labs( x = "x1", y = "Fn(x)", title = "Empirical Distribution Function"
ggplot(data.frame(x12), aes(x12)) + stat_ecdf(geom = "step", aes(colour = "ECDF")) + stat_function( fun = ~ (pnorm(.x,mean=2,sd=2))
,aes(colour = "TCDF") theme_light() + labs( x = "x1+x2", y = "Fn(x)", title = "Empirical Distribution Function"
# Simulation Code
rm(list=ls()) library(ggplot2) set.seed(123) options("scipen"=100, "digits"=4)
N<-10000 nSet<-c(10,30,50,100)
####################################################
#Uniform for (n in nSet) p<-0 for (i in 1:N) x1<-runif(n,min=1,max=2) x12<-runif(n,min=0,max=4) p1<-ks.test(x1,"punif",1.5,2.5)$p p2<-ks.test(x12,"punif",0.5,4.5)$p if ((p1<0.05) & (p1+p2<0.05)) p<-p+1 cat("power of n = ",n," is: ",p/N,"\n")
#####################################################
#Exponential for (n in nSet) p<-0 for (i in 1:N) x1<-rexp(n,rate=2.5) x12<-rexp(n,rate=1) p1<-ks.test(x1,"pexp",4)$p p2<-ks.test(x12,"pexp",3)$p if ((p1<0.05) & (p1+p2<0.05)) p<-p+1 cat("power of n = ",n," is: ",p/N,"\n")
###############################################################
#Normal for (n in nSet) p<-0 for (i in 1:N) x1<-rnorm(n,0,1) x12<-rnorm(n,2,2) p1<-ks.test(x1,"pnorm",0,2)$p p2<-ks.test(x12,"pnorm",1,3)$p if ((p1<0.05) & (p1+p2<0.05)) p<-p+1 cat("power of n = ",n," is: ",p/N,"\n")
- S. M. Ross, Introduction to probability models, 10 ed., United States: Academic Press, 2019.
- L. Devroye, Non-Uniform Random Variate Generation, New York: Springer, 1986.
- G. S. Fishman, Monte Carlo: concepts, algorithms, and applications, New York: Springer, 1996.
- D. E. Knuth, The Art of Computer Programming, vol. 2, United States: Addison-Wesley, 1998.
- P. L'Ecuyer and R. Simard, "TestU01: A C library for empirical testing of random number generators," ACM Transactions on Mathematical Software, vol. 33, no. 4, pp. 1-40, 2007.
- M. Aslam, "Introducing KolmogorovβSmirnov Tests under Uncertainty: An Application to Radioactive Data," ACS Omega, vol. 5, pp. 914-917, 2020.
- M. Aslam, "A new goodness of fit test in the presence of uncertain parameters," Complex & Intelligent Systems, vol. 7, pp. 359-365, 2021.
- M. Ahsan-ul-Haq, "A new CramΓ¨rβvon Mises Goodness-of-fit test under Uncertainty," Neutrosophic Sets and Systems, vol. 49, pp. 262-268, 2022.
- M. Aslam, "Chi-square test under indeterminacy: an application using pulse count data," BMC Med Res Methodology, vol. 21, no. 1, 2021.
- M. Jdid, R. Alhabib and A. A. Salama, "Fundamentals of Neutrosophical Simulation for Generating Fundamentals of Neutrosophical Simulation for Generating Random Numbers Associated with Uniform Probability Random Numbers Associated with Uniform Probability Distribution," Neutrosophic Sets and Systems, vol. 49, pp. 92-102, 2022.
- M. B. Zeina and M. Abobala, "A Novel Approach of Neutrosophic Continuous Probability Distributions using AH-Isometry with Applications in Medicine," in Cognitive Intelligence with Neutrosophic Statistics in Bioinformatics, Elsevier, 2023.
- M. B. Zeina , O. Zeitouny , F. Masri , F. Kadoura and S. Broumi, "Operations on Single-Valued Trapezoidal Neutrosophic Numbers using (Ξ±,Ξ²,Ξ³)-Cuts βMaple Packageβ," International Journal of Neutrosophic Science, vol. 15, no. 2, pp. 113-122, 2021.
- M. Abobala and M. B. Zeina, "A Study of Neutrosophic Real Analysis by Using the One-Dimensional Geometric AH-Isometry," Galoitica: Journal of Mathematical Structures and Applications, vol. 3, no. 1, pp. 18-24, 2023.
- M. B. Zeina and A. Hatip, "Neutrosophic Random Variables," Neutrosophic Sets and Systems, vol. 39, pp. 44-52, 2021.
- A. Astambli, M. B. Zeina and Y. Karmouta, "On Some Estimation Methods of Neutrosophic Continuous Probability Distributions Using One-Dimensional AH-Isometry," Neutrosophic Sets and Systems, vol. 53, pp. 641-652, 2023.