# TBT.criticalValue: Critical value for Topological Binary Test In CryptRndTest: Statistical Tests for Cryptographic Randomness

 TBT.criticalValue R Documentation

## Critical value for Topological Binary Test

### Description

Approximately computes cumulative distribution function of the test statistic of the Topological Binary Test of Alcover et al. (2013) and finds the required critical value for the test.

### Usage

```  TBT.criticalValue(m, k, alpha = 0.01, cdf = FALSE, exact = TRUE)
```

### Arguments

 `m` the length of words (B-bit) in Topological Binary Test. `k` the number of words (integers) generated by the RNG of interest that will be tested. `alpha` a predetermined value of type-I error with the default value of 0.05. `cdf` if `TRUE`, the cumulative distribution function of the test statistic is stored and printed. `exact` if `TRUE`, the function `Stirling2` from the package gmp is used to calculate the Stirling numbers of the second kind in the case that the function `Strlng2` from the package CryptRndTest returns a `NaN`. Otherwise, nothing is done for `NaN`'s generated by `Strlng2`.

### Details

The function `TBT.criticalValue` lists the cumulative probabilities greater than zero if `cdf` is set to `TRUE`.

A correction factor is applied to improve accuracy of the the function `Strlng2` in the computation of probabilities. Accuracy of the computations decreases with increasing value of `m`.

### Value

 `prob` a vector containing the cumulative probabilities corresponding to the values in `value`. `value` a vector containing the values of the test statistic. `critical.value` critical value of the test statistic corresponding to `alpha`.

### Author(s)

Haydar Demirhan

Maintainer: Haydar Demirhan <haydarde@hacettepe.edu.tr>

### References

Alcover, P.M., Guillamon, A., Ruiz, M.C., A new randomness test for bit sequences. Informatica (2013), 24(3), 339–356.

### Examples

```# Critical values for the Topological Binary Test at 0.01 and 0.05 levels of significance.

TBT.criticalValue(m=8, k=256, alpha=0.01, cdf=FALSE, exact=FALSE)
TBT.criticalValue(m=8, k=256, alpha=0.05, cdf=FALSE, exact=FALSE)
```

CryptRndTest documentation built on April 22, 2022, 9:07 a.m.