8,486 research outputs found

    Two Compact Incremental Prime Sieves

    Get PDF
    A prime sieve is an algorithm that finds the primes up to a bound nn. We say that a prime sieve is incremental, if it can quickly determine if n+1n+1 is prime after having found all primes up to nn. We say a sieve is compact if it uses roughly n\sqrt{n} space or less. In this paper we present two new results: (1) We describe the rolling sieve, a practical, incremental prime sieve that takes O(nloglogn)O(n\log\log n) time and O(nlogn)O(\sqrt{n}\log n) bits of space, and (2) We show how to modify the sieve of Atkin and Bernstein (2004) to obtain a sieve that is simultaneously sublinear, compact, and incremental. The second result solves an open problem given by Paul Pritchard in 1994

    Algorithmic Debugging of Real-World Haskell Programs: Deriving Dependencies from the Cost Centre Stack

    Get PDF
    Existing algorithmic debuggers for Haskell require a transformation of all modules in a program, even libraries that the user does not want to debug and which may use language features not supported by the debugger. This is a pity, because a promising ap- proach to debugging is therefore not applicable to many real-world programs. We use the cost centre stack from the Glasgow Haskell Compiler profiling environment together with runtime value observations as provided by the Haskell Object Observation Debugger (HOOD) to collect enough information for algorithmic debugging. Program annotations are in suspected modules only. With this technique algorithmic debugging is applicable to a much larger set of Haskell programs. This demonstrates that for functional languages in general a simple stack trace extension is useful to support tasks such as profiling and debugging

    Versatile spectral imaging with an algorithm-based spectrometer using highly tuneable quantum dot infrared photodetectors

    Get PDF
    We report on the implementation of an algorithm-based spectrometer capable of reconstructing the spectral shape of materials in the mid-wave infrared (MWIR) and long-wave infrared (LWIR) wavelengths using only experimental photocurrent measurements from quantum dot infrared photodetectors (QDIPs). The theory and implementation of the algorithm will be described, followed by an investigation into this algorithmic spectrometer's performance. Compared to the QDIPs utilized in an earlier implementation, the ones used here have highly varying spectral shapes and four spectral peaks across the MWIR and LWIR wavelengths. It has been found that the spectrometer is capable of reconstructing broad spectral features of a range of bandpass infrared filters between wavelengths of 4 and 12 mu m as well as identifying absorption features as narrow as 0.3 mu m in the IR spectrum of a polyethylene sheet

    On Rearrangement of Items Stored in Stacks

    Full text link
    There are n2n \ge 2 stacks, each filled with dd items, and one empty stack. Every stack has capacity d>0d > 0. A robot arm, in one stack operation (step), may pop one item from the top of a non-empty stack and subsequently push it onto a stack not at capacity. In a {\em labeled} problem, all ndnd items are distinguishable and are initially randomly scattered in the nn stacks. The items must be rearranged using pop-and-pushs so that in the end, the kthk^{\rm th} stack holds items (k1)d+1,,kd(k-1)d +1, \ldots, kd, in that order, from the top to the bottom for all 1kn1 \le k \le n. In an {\em unlabeled} problem, the ndnd items are of nn types of dd each. The goal is to rearrange items so that items of type kk are located in the kthk^{\rm th} stack for all 1kn1 \le k \le n. In carrying out the rearrangement, a natural question is to find the least number of required pop-and-pushes. Our main contributions are: (1) an algorithm for restoring the order of n2n^2 items stored in an n×nn \times n table using only 2n2n column and row permutations, and its generalization, and (2) an algorithm with a guaranteed upper bound of O(nd)O(nd) steps for solving both versions of the stack rearrangement problem when dcnd \le \lceil cn \rceil for arbitrary fixed positive number cc. In terms of the required number of steps, the labeled and unlabeled version have lower bounds Ω(nd+ndlogdlogn)\Omega(nd + nd{\frac{\log d}{\log n}}) and Ω(nd)\Omega(nd), respectively

    Limits on Fundamental Limits to Computation

    Full text link
    An indispensable part of our lives, computing has also become essential to industries and governments. Steady improvements in computer hardware have been supported by periodic doubling of transistor densities in integrated circuits over the last fifty years. Such Moore scaling now requires increasingly heroic efforts, stimulating research in alternative hardware and stirring controversy. To help evaluate emerging technologies and enrich our understanding of integrated-circuit scaling, we review fundamental limits to computation: in manufacturing, energy, physical space, design and verification effort, and algorithms. To outline what is achievable in principle and in practice, we recall how some limits were circumvented, compare loose and tight limits. We also point out that engineering difficulties encountered by emerging technologies may indicate yet-unknown limits.Comment: 15 pages, 4 figures, 1 tabl
    corecore