Efficient Self-Testing/Self-Correction of Linear Recurrences S Ravi Kumar Department of Computer Science Cornell University Ithaca, NY 14853. Email: D. Sivakumar ² Department of Computer Science State University of New York at Buffalo Buffalo, NY 14260. Email: Abstract We consider the problem of designing self-testers/self- correctors for functions defined by linear recurrences. We present the first complete package of efficient and simple self-testers, self-correctors, and result-checkers for such functions. The results are proved by demonstrating an ef- ficient reduction from this problem to the problem of test- ing linear functions over certain matrix groups. Our tools include spectral analysis of matrices over finite fields, and various counting arguments that extend known techniques. The matrix twist yields simple and efficient self-testers for all linear recurrences. We also show a technique of using con- volution identities to obtain very simple self-testers and self- correctors. Our techniques promise new and efficient ways of testing VLSI chips for applicationsin control engineering, signal processing, etc. An interesting consequence of our methods is a com- pletely new and randomness-efficient self-tester for polyno- mials over finite fields and rational domains. In particular, our self-tester for polynomials over rational domains over- comes a main drawback of the result of [RS92]—the need for a test domain of much larger size and of much finer pre- cision. 1. Introduction The concept of program self-testing, introduced by Blum, Luby, and Rubinfeld [BLR93], is a radically new ap- proach to testing the correctness of programs. In conven- tional program testing, the program is tested by comparing its output, say on many randomly chosen inputs, to the cor- rect answer it is supposed to compute. The intellectual leap This work is partially supported by ONR Young Investigator Award N00014-93-1-0590, the Alfred P. Sloan Research Award, and NSF grant DMI-91157199. Part of this research conducted while visiting the M.I.T. Lab. for Computer Science. ² Research supported in part by NSF grant CCR-9409104. in self-testing is to test the program’s correctness by using the (possibly faulty) program itself to cross-check its work. The key idea is to identify certain mathematical properties of the functions being computed, and exploit them in the testing process. It is interesting to note that this approach to software testing has been used in practice [Cod91, CS91] without any theoretical justification. Formalizing this idea [Blu88, BLR93] has led to efficient and remarkably simple methods of testing programs that are both provably good and practically useful [BW94a, BW94b]. Related concepts of result-checking [BK89] and self-correction [BLR93, Lip91] have also proved themselves to be very useful in ensuring software correctness. Let f be a function and P be a program that purports to compute f . Informally, a self-tester for f is a probabilistic program T that uses P as a black-box and works as follows: if P is wrong on more than an ε fraction of the inputs then T rejects P as “too erroneous,” if P is perfect then T certifies P as “pretty trustworthy,” otherwise the outcome of T is not specified. As we will observe in Section 2, the higher the value of δ ε 2, a key parameter, the fewer the queries T makes to P. So, one of the goals in building self-testers is to make them work for δ as large as possible. A self-corrector for f , when given a “not too erroneous” program P and any input x, computes fx correctly with high probability. Us- ing self-correction, we can often provably convert a program that has been tested to be correct on most inputs into a pro- gram that is correct on all inputs. The ability to self-correct makes the problem of self-testing both attractive and impor- tant. A result-checker for f , when given an input x, checks if P computes f at x correctly. It is not hard to see that a result-checker can be constructed from a self-tester and a self-corrector [BLR93]. The broad agenda for the research program on self- testing/self-correction is to investigate and identify the mathematical functions that allow efficient self-testing/self- correction. In this paper, we continue this quest, and fo- cus on self-testing and self-correcting functions described by linear recurrences: fn ∑ d i 1 c i fn i Linear recur-