gbp: Finding the target room size in generalized birthday problem

Description Arguments Value Examples

View source: R/gbp.R

Description

Finding the target room size in generalized birthday problem

Arguments

k

Integer. k persons shared birthday.

p

Integer. Room size to be tested.

B_l

Lower bound of tested room size.

B_u

Upper bound of upper room size.

threshold

A threshold to keep while loop running for binary search.

print

Set TRUE if you want to check the result while simulating. Default is FALSE.

recor

TRUE if you want to output the room tested in simulation. Default is FALSE.

Value

Room size

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Simple example with k=2
system.time({
y <- gbp(k=2, p=0.5)
})
y

# You can also track the simulation process
y <- gbp(k=3, p=0.5, print=TRUE)

# Or output the tested room sizes
y <- gbp(k=3, p=0.5, recor=TRUE)
y

Chang-Yu-Chang/GeneralBirthdayProblem documentation built on May 23, 2019, 2:42 p.m.