What is the difference between [ and ) while specifying a set of numbers?

51 Views Asked by At

I have a text on Algorithms which has these 2 lines in it -

random double value in [a,b)

random int value in [0..N)

What do the notations [ and ) mean?

What's the difference between the 2 lines?

1

There are 1 best solutions below

0
On BEST ANSWER

$(a, b)$ means all $x$ such that $a<x<b$.

$(a,b]$ means all $x$ such that $a<x\le b$.

$[a, b)$ ... such that $a\le x <b$.

$[a, b]$ ... $a\le x \le b$