fixed.intervals: Fixed intervals

Description Usage Arguments Details Value See Also Examples

Description

The function generates approximately M intervals with endpoints in 1,2,...,n, without random drawing. This routine can be used inside wbs function and is typically not called directly by the user.

Usage

1

Arguments

n

a number of endpoints to choose from

M

a number of intervals to generate

Details

Function finds the minimal m such that \code{M} <= \code{m(m-1)/2}. Then it generates m approximately equally-spaced positive integers lower than n and returns all possible intervals consisting of any two of these points.

Value

a 2-column matrix with start (first column) and end (second column) points of an interval in each row

See Also

random.intervals wbs

Examples

1

Example output

      [,1] [,2]
 [1,]    1    2
 [2,]    1    3
 [3,]    1    4
 [4,]    1    5
 [5,]    1    6
 [6,]    1    7
 [7,]    1    8
 [8,]    1    9
 [9,]    1   10
[10,]    2    3
[11,]    2    4
[12,]    2    5
[13,]    2    6
[14,]    2    7
[15,]    2    8
[16,]    2    9
[17,]    2   10
[18,]    3    4
[19,]    3    5
[20,]    3    6
[21,]    3    7
[22,]    3    8
[23,]    3    9
[24,]    3   10
[25,]    4    5
[26,]    4    6
[27,]    4    7
[28,]    4    8
[29,]    4    9
[30,]    4   10
[31,]    5    6
[32,]    5    7
[33,]    5    8
[34,]    5    9
[35,]    5   10
[36,]    6    7
[37,]    6    8
[38,]    6    9
[39,]    6   10
[40,]    7    8
[41,]    7    9
[42,]    7   10
[43,]    8    9
[44,]    8   10
[45,]    9   10

wbs documentation built on May 15, 2019, 1:04 a.m.