fencepost error n.
1. [common] A problem with the discrete
equivalent of a boundary condition, often exhibited in programs by
iterative loops. From the following problem: "If you build a
fence 100 feet long with posts 10 feet apart, how many posts do you
need?" (Either 9 or 11 is a better answer than the obvious 10.)
For example, suppose you have a long list or array of items, and
want to process items m through n; how many items are
there? The obvious answer is n - m, but that is off by one;
the right answer is n - m + 1. A program that used the
`obvious' formula would have a fencepost error in it. See also
zeroth and off-by-one error, and note that not all
off-by-one errors are fencepost errors. The game of Musical Chairs
involves a catastrophic off-by-one error where N people try
to sit in N - 1 chairs, but it's not a fencepost error.
Fencepost errors come from counting things rather than the spaces
between them, or vice versa, or by neglecting to consider whether
one should count one or both ends of a row. 2. [rare] An error
induced by unexpected regularities in input values, which can (for
instance) completely thwart a theoretically efficient binary tree
or hash table implementation. (The error here involves the
difference between expected and worst case behaviors of an
algorithm.)
1. [common] A problem with the discrete
equivalent of a boundary condition, often exhibited in programs by
iterative loops. From the following problem: "If you build a
fence 100 feet long with posts 10 feet apart, how many posts do you
need?" (Either 9 or 11 is a better answer than the obvious 10.)
For example, suppose you have a long list or array of items, and
want to process items m through n; how many items are
there? The obvious answer is n - m, but that is off by one;
the right answer is n - m + 1. A program that used the
`obvious' formula would have a fencepost error in it. See also
zeroth and off-by-one error, and note that not all
off-by-one errors are fencepost errors. The game of Musical Chairs
involves a catastrophic off-by-one error where N people try
to sit in N - 1 chairs, but it's not a fencepost error.
Fencepost errors come from counting things rather than the spaces
between them, or vice versa, or by neglecting to consider whether
one should count one or both ends of a row. 2. [rare] An error
induced by unexpected regularities in input values, which can (for
instance) completely thwart a theoretically efficient binary tree
or hash table implementation. (The error here involves the
difference between expected and worst case behaviors of an
algorithm.)
Related:
- fencepost error: n. 1. A problem with the discrete equivalent of a
boundary condition,
often exhibited in programs by iterative loops.... - off-by-one error n.
[common] Exceedingly common error
induced in many ways,
such as by starting at 0 when you should have started... - off-by-one error: n. Exceedingly common error induced in many
ways,
such as by starting at 0 when you should have started... - slop: n. 1. A one-sided {fudge factor}, that is, an allowance for
error but in only one of two directions.
For example, if you need a piece of wire 10 feet... - slop n.
1. A one-sided fudge factor, that is, an
allowance for error but in only one of two directions.
For example, if you need a piece of wire 10 feet... - HAKMEM /hak'mem/ n.
MIT AI Memo 239 (February 1972).
A legendary collection of neat mathematical and... - banana problem n.
[from the story of the little girl who
said "I know how to spell `banana',
but I don't know when to stop"]. Not knowing where... - banana problem: n. [from the story of the little girl who said "I
know how to spell `banana',
but I don't know when to stop"]. Not knowing where... - obi-wan error /oh'bee-won` er'*r/ n.
[RPI, from
`off-by-one' and the Obi-Wan Kenobi character in "Star
Wars"] A loop of some sort in which the index is off by 1.
Common when the index should have started from 0...
From the same category:
- blow an EPROM /bloh *n ee'prom/ v.
(alt. `blast an
EPROM',
`burn an EPROM') To program a read-only memory, e.g... - wall time n.
(also `wall clock time') 1. `Real world'
time (what the clock on the wall shows),
as opposed to the system clock's idea of time. ... - zero-content adj.
Syn.
content-free... - smart terminal n.
1. A terminal that has enough computing
capability to render graphics or to offload some kind of front-end
processing from the computer it talks to.
The development of ... - FTP /F-T-P/, not /fit'ip/
1. [techspeak] n. The
File Transfer Protocol for transmitting files between systems on
the Internet.
2. vt. To beam a file using the File Transfer Protocol...
