Random Numbers Flashcards

1
Q

can computers generate truly random numbers

A

no only sort of random, psuedo random ones

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

in java how do you create a random number generator

A

importing the random library

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

import random library line

A

import java.util.Random

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

create random number line

A

Random generator = newRandom();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

to create a random number generator with a seed

A

Random generator = new Random ();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is a seed

A

a place where the numbers are derived from

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

generate a random integer

A

integer randomInt = generator.nextInt();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

generate a random double

A

double randomDouble = generator.nextDouble();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

generate a random boolean

A

boolean randomBoolean = generator.nextBoolean();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

to generate a random integer in a specified range, in this case 100

A

integer randomInt = generator.nextInt(100);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what are the possible integers in this range

integer randomInt = generator.nextInt(100);

A

0-99 inclusive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly