9 research outputs found

    Enumerating the rationals from left to right

    Full text link
    Farey sequences, Stern-Brocot sequences, the Calkin-Wilf sequences are shown to be generated via almost identical second order recurrence relations. These sequences have combinatorial, computational, and geometric applications, and are useful for enumerating the rational numbers.Comment: 6 pages, 3 figure

    Child’s addition in the Stern–Brocot tree

    Get PDF
    AbstractWe use child’s addition and cross-differencing to discover significant relationships for diagonals, paths and branches within the Stern–Brocot tree and the Stern–Brocot sequence. This allows us to develop results for continued fraction summation under child’s addition

    Construction and Composition of Rooted Trees via Descent Functions

    Get PDF

    Algorithmic debugging for complex lazy functional programs

    Get PDF
    An algorithmic debugger finds defects in programs by systematic search. It relies on the programmer to direct the search by answering a series of yes/no questions about the correctness of specific function applications and their results. Existing algorithmic debuggers for a lazy functional language work well for small simple programs but cannot be used to locate defects in complex programs for two reasons: Firstly, to collect the information required for algorithmic debugging existing debuggers use different but complex implementations. Therefore, these debuggers are hard to maintain and do not support all the latest language features. As a consequence, programs with unsupported language features cannot be debugged. Also inclusion of a library using unsupported languages features can make algorithmic debugging unusable even when the programmer is not interested in debugging the library. Secondly, algorithmic debugging breaks down when the size or number of questions is too great for the programmer to handle. This is a pity, because, even though algorithmic debugging is a promising method for locating defects, many real-world programs are too complex for the method to be usuable. I claim that the techniques in in this thesis make algorithmic debugging useable for a much more complex lazy functional programs. I present a novel method for collecting the information required for algorithmically debugging a lazy functional program. The method is non-invasive, uses program annotations in suspected modules only and has a simple implementation. My method supports all of Haskell, including laziness, higher-order functions and exceptions. Future language extensions can be supported without changes, or with minimal changes, to the implementation of the debugger. With my method the programmer can focus on untrusted code -- lots of trusted libraries are unaffected. This makes traces, and hence the amount of questions that needs to be answered, more manageable. I give a type-generic definition to support custom types defined by the programmer. Furthermore, I propose a method that re-uses properties to answer automatically some of the questions arising during algorithmic debugging, and to replace others by simpler questions. Properties may already be present in the code for testing; the programmer can also encode a specification or reference implementation as a property, or add a new property in response to a statement they are asked to judge

    Locating terms in the Stern-Brocot tree

    Get PDF
    In this paper we discover an efficient method for answering two related questions involving the Stern Brocot tree: What is the jth term in the nth level of the tree? and What is the exact position of the fraction t/s in the tree? \u2
    corecore