I am getting references in a paper on genetic programming, to a "protected division" operation. When I google this, i get mostly papers on genetic programming and various results related to cryptography, but none that explain what it actually is. Does anybody know?
4 Answers
Protected division (often notated with %) checks to see if its second argument is 0. If so, % typically returns the value 1 (regardless of the value of the first argument).
http://en.wikipedia.org/wiki/Genetic_programming
In cryptography it doesn't seem to be well-defined, but the top google hit is for protecting against side channel attacks (in that case, via power use - you can guess what numbers are being used in the division by looking at the power consumption of the hardware doing the encryption) http://dl.acm.org/citation.cfm?id=1250996 http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.9.7298&rep=rep1&type=pdf

- 45,717
- 10
- 93
- 143
-
well thats quite simple. Wish I understood the link. Thank you very much! – wfbarksdale Sep 01 '11 at 02:46
In GP protected division is a modified division operator which does not signal "division by zero" error when denominator is 0 (zero). It typically returns 1 when denominator is zero.

- 851
- 1
- 11
- 26
-
Optionally the protected division also influences the fitness of the program such that (almost) causing a "division by zero" error is punished. – Jay Dec 11 '11 at 12:43
It divides on threshold function of argument instead of argument.
Thres(x) = epsilon*Theta(x) if fabs(x)<epsilon.
Where Theta() is non-zero variant of theta-function.
Other threshold functions possible. Or sometimes it is just 'epsilon'.

- 139
- 6
When evolving programs with Genetic Programming (GP), every generated program is tested to get its fitness value. The protected division is required when the evolved programs are mathematical expressions. In cryptography, the mathematical expression might be used to model a decision-making process. In the evaluation step, the program may perform a division by zero, which would cause a crash. To avoid this, the protected division is set to return a specific value if the denominator equals zero. I've seen three settings:
- If the denominator equals zero, return 1
- If the denominator equals zero, return 0
- If the denominator equals zero, return the numerator
The setting should be specified somewhere in the paper. If not, the safest bet is to assume that the protected division returns the numerator. Given that 1 is a multiplicative neutral and 0 is an additive neutral, they could cause some bias in the programs generated during the evolution but are still commonly used.

- 57
- 7