|
The Serial Total occurs as unique number that is one of a series assigned for identification which varies from its successor or predecessor by a fixed discreet integer value. Most common usage has expanded a term to refer to any unique alphanumeric identifier for one of a big set of objects, however inside data processing and allied fields in computer science, the distinction between serial & nominal numbers is an important 1.
Whenever considered when serial figures there are no value has any particular
significance, no minimum or even maximal serial total, every
value has the successor & predecessor. Serial cost come formed from either either non-negative whole number from the finite subset of the range of tons whole number values. A last-place whole number inside each subset utilized for this purpose is zero.
Inside computer science applications, the maximal is universally 1 to a lesser degree a power of 2.
To define a serial total to exist as utilized in that way, the size of the
serial total space must become given. This value, known as "SERIAL_BITS",
gives a power of 2 which outcomes within of these big than a largest
whole total corresponding to the serial number value. This as well specifies
the total of bits compulsory to hang on to each imaginable value of a serial
total of the defined nature and severity. A operations permitted upon serial
statistics come defined in the ensuing division.
Operations on serial numbers (sequence space arithmetic)
Just deuce operations come defined upon serial figures, addition of a
caring whole number of limited range, & comparison with another serial
total.
Addition
Serial prices can be incremented per addition of the positive
whole number north, inorth which n is taken from either a range of integers
[0 .. (2^(SERIAL_BITS - One) - One)]. For the sequence dull s, the
effect of such an addition, s', is defined as
s' = (s + north) modulo (Ii ^ SERIAL_BITS)
in which a addition & modulus operations on this button work values that
come non-negative values of limitless size in the common ways of
whole number arithmetic.
Addition of a value outside the range
[0 .. (2^(SERIAL_BITS - One) - Single)] is vague.
Comparison
Any ii serial prices, s1 & s2, can be equated. A definition
of the symptom of this comparison is when follows.
For the purposes of this definition, assume 2 whole number, i1 and
i2, from either a limitless placed of non-negative whole number, such that i1 and
s1 use at times a equivalent numeral value, when wash i2 & s2. Arithmetic and
comparisons applied to i1 & i2 utilize average limitless integer
arithmetic.
So, s1 is said to exist as up to s2 in case & merely whenever i1 is capable i2,
all told more shells, s1 is non capable s2.
s1 is said to become to a lesser degree s2 in case, & simply in case, s1 is non capable s2,
and
(i1 < i2 and i2 - i1 < 2^(SERIAL_BITS - 1)) or
(i1 > i2 & iOne - i2 > 2^(SERIAL_BITS - 1))
s1 is said to exist as greater than s2 whenever, & merely whenever, s1 is non equal to
s2, and
(i1 < i2 and i2 - i1 > 2^(SERIAL_BITS - One)) or
(i1 > i2 & i1 - i2 < 2^(SERIAL_BITS - 1))
Note that there are some pairs of values s1 and s2 for which s1 is
not equal to s2, but for which s1 is neither greater than, nor less
than, s2. An attempt to use these ordering operators on such pairs
of values produces an undefined result.
The reason for this is that those pairs of values are such that any
simple definition that were to define s1 to be less than s2 where
(s1, s2) is such a pair, would also usually cause s2 to be less than
s1, when the pair is (s2, s1). This would mean that the particular
order selected for a test could cause the result to differ, leading
to unpredictable implementations.
While it would be possible to define the test in such a way that the
inequality would not have this surprising property, while being
defined for all pairs of values, such a definition would be
unnecessarily burdensome to implement, and difficult to understand,
and would still allow cases where
s1 < s2 and (s1 + 1) > (s2 + Unity)
which is even as non-intuitive.
So a condition outbreak is left vague, implementations come loose to
go to either effect, or even to flag an error, & users must choose care
does'nt to depend in any particular effect. Normally this might mean
avoiding allowing for people particular pairs of amounts to co-survive.
A relationships greater than or even even capable, & to a lesser degree or equal
to, watch in a natural way from either the above definitions.
These definitions bring about to a bit of final result of note.
Corollary 1
For any sequence total s & any whole number north such that addition of n
to s is swell defined, (s + north) >= s. More (s + north) = s sole when
north = Zero, altogether more defined suits, (s + north) > s.
Corollary 2
Whenever s' is a symptom of adding the nonorth-zero whole number n to the sequence
benumb s, & m is an additional whole number from either a range defined when a cappella to
exist as added to the sequence total, & s" is the result of adding m to
s', then it is undefined whether s" is greater than, or even to a lesser degree s,
though these are known that s" is not equal to s.
Corollary 3
If s" from either a former corollary is farther incremented, so there
is no protracted any known relationship between a symptom & s.
Corollary 4
inside case inorth corollary Deuce a value (n + m) is such that addition of the sum
to sequence total s would develop the defined effect, so corollary 1
applies, & s" is known to be greater than s.
A trivial example
The simplest meaningful serial number space has SERIAL_BITS = 2. In
this space, the integers that make up the serial number space are 0,
1, 2, and 3. That is, 3 = 2^SERIAL_BITS - 1.
In this space, the largest integer that it is meaningful to add to a
sequence number is 2^(SERIAL_BITS - 1) - 1, or 1.
Then, as defined 0+1 = 1, 1+1 = 2, 2+1 = 3, and 3+1 = 0.
Further, 1 > 0, 2 > 1, 3 > 2, and 0 > 3. It is undefined whether
2 > 0 or 0 > 2, and whether 1 > 3 or 3 > 1.
A slightly larger example
Consider the case where SERIAL_BITS = 8. In this space the integers
that make up the serial number space are 0, 1, 2, ... 254, 255.
255 = 2^SERIAL_BITS - 1.
In this space, the largest integer that it is meaningful to add to a
sequence number is 2^(SERIAL_BITS - 1) - 1, or 127.
Addition is as expected in this space, for example: 255+1 = 0,
100+100 == 200, and 200+100 = 44.
Comparison is more interesting, 1 > 0, 44 > 0, 100 > 0, 100 > 44,
200 > 100, 255 > 200, 0 > 255, 100 > 255, 0 > 200, and 44 > 200.
Note that 100+100 > 100, but that (100+100)+100 < 100. Incrementing
a serial number can cause it to become "smaller". Of course,
incrementing by a smaller number will allow many more increments to
be made before this occurs. However this is always something to be
aware of, it can cause surprising errors, or be useful as it is the
only defined way to actually cause a serial number to decrease.
The pairs of values 0 and 128, 1 and 129, 2 and 130, etc, to 127 and
255 are not equal, but in each pair, neither number is defined as
being greater than, or less than, the other.
It could be defined (arbitrarily) that 128 > 0, 129 > 1,
130 > 2, ..., 255 > 127, by changing the comparison operator
definitions, as mentioned above. However note that that would cause
255 > 127, while (255 + 1) < (127 + 1), as 0 < 128. Such a
definition, apart from being arbitrary, would also be more costly to
implement.
Ref: Serial Number Arithmetic from RFC1982.
Estimating the population size using serial numbers
If there are items whose serial numbers is part of a sequence of consecutive numbers and you take n number of random samples of the items. You can determine the population of items "in the wild".
To do so, calculate the difference between the largest serial number and the smallest serial number in your sample. The expected population size of the item is that difference divided by the expected proportion.
Example
You take 4 random samples. The serial numbers are 2,7,34,13. Thus the difference is 34-2=32. The expected proportion is 0.6 The expected population size is 32 / 0.6 = 53 and the standard deviation of the expected proportion is 0.2
numofsamples = 2 proportion = 0.333 std_dev = 0.236
numofsamples = 3 proportion = 0.500 std_dev = 0.224
numofsamples = 4 proportion = 0.600 std_dev = 0.200
numofsamples = 5 proportion = 0.667 std_dev = 0.178
numofsamples = 6 proportion = 0.714 std_dev = 0.160
numofsamples = 7 proportion = 0.750 std_dev = 0.144
numofsamples = 8 proportion = 0.778 std_dev = 0.132
numofsamples = 9 proportion = 0.800 std_dev = 0.121
numofsamples = 10 proportion = 0.818 std_dev = 0.111
numofsamples = 11 proportion = 0.833 std_dev = 0.103
numofsamples = 12 proportion = 0.846 std_dev = 0.097
numofsamples = 13 proportion = 0.857 std_dev = 0.090
numofsamples = 14 proportion = 0.867 std_dev = 0.085
numofsamples = 15 proportion = 0.875 std_dev = 0.080
Applications of serial numbering
Serial numbers are valuable in quality control, as once a defect is found in the production of a particular batch of product, the serial number will quickly identify which units are affected. Serial numbers are also used as a deterrent against theft and counterfeit products in that serial numbers can be recorded, and stolen or otherwise irregular goods can be identified.
Many computer programs come with serial numbers, often called "Video keys," and the installers often require the user to enter a valid serial number to continue. These numbers are verified using a certain algorithm to avoid usage of counterfeit keys.
Serial numbers also help track down counterfeit currency, because in some countries each banknote has a unique serial number.
The ISSN or International Standard Serial Number seen on magazines and other periodicals, an equivalent to the ISBN applied to books, is serially assigned but takes its name from the library science use of serial to mean a periodical.
Certificates and Certificate Authorities (CA) are necessary for widespread use of cryptography. These depend on applying mathematically rigorous serial numbers and serial number arithmetic
The term "serial total" is also used in military formations as an alternative to the expression "service number".
Infocom games and other Z-machine format games have a serial number that signifies the date of compilation, but this is not a serial number in the traditional sense.
|