511 research outputs found

    An Efficient Dynamic Programming Algorithm for the Generalized LCS Problem with Multiple Substring Exclusion Constrains

    Full text link
    In this paper, we consider a generalized longest common subsequence problem with multiple substring exclusion constrains. For the two input sequences XX and YY of lengths nn and mm, and a set of dd constrains P={P1,...,Pd}P=\{P_1,...,P_d\} of total length rr, the problem is to find a common subsequence ZZ of XX and YY excluding each of constrain string in PP as a substring and the length of ZZ is maximized. The problem was declared to be NP-hard\cite{1}, but we finally found that this is not true. A new dynamic programming solution for this problem is presented in this paper. The correctness of the new algorithm is proved. The time complexity of our algorithm is O(nmr)O(nmr).Comment: arXiv admin note: substantial text overlap with arXiv:1301.718

    A note on the largest number of red nodes in red-black trees

    Full text link
    In this paper, we are interested in the number of red nodes in red-black trees. We first present an O(n2logn)O(n^2\log n) time dynamic programming solution for computing r(n)r(n), the largest number of red internal nodes in a red-black tree on nn keys. Then the algorithm is improved to some O(logn)O(\log n) time recursive and nonrecursive algorithms. Based on these improved algorithms we finally find a closed-form solution of r(n)r(n)

    Complete Solutions for a Combinatorial Puzzle in Linear Time

    Full text link
    In this paper we study a single player game consisting of nn black checkers and mm white checkers, called shifting the checkers. We have proved that the minimum number of steps needed to play the game for general nn and mm is nm+n+mnm + n + m. We have also presented an optimal algorithm to generate an optimal move sequence of the game consisting of nn black checkers and mm white checkers, and finally, we present an explicit solution for the general game

    The Reconstruction of Non-Minimal Derivative Coupling Inflationary Potentials

    Full text link
    We derive the reconstruction formulae for the inflation model with the non-minimal derivative coupling term. If reconstructing the potential from the tensor-to-scalar ratio, we could obtain the potential without using the high friction limit. As an example, we reconstruct the potential from the parametrization r=8α/(N+β)γr=8\alpha/(N+\beta)^{\gamma}, which is a general form of the α\alpha-attractor. The reconstructed potential has the same asymptotic behavior as the T- and E-model if we choose γ=2\gamma=2 and α1\alpha\ll1. We also discuss the constraints from the reheating phase preceding the radiation domination by assuming the parameter wrew_{re} of state equation during reheating is a constant. The scale of big-bang nucleosynthesis could put a up limit on nsn_s if wre=2/3w_{re}=2/3 and a low limit on nsn_s if wre=1/6w_{re}=1/6.Comment: 12 pages, 3 figure

    Estimating Ion Temperatures at the Polar Coronal Hole Boundary

    Full text link
    Physical quantities, such as ion temperature and nonthermal velocity, provide critical information about the heating mechanism of the million-degree solar corona. We determined the possible ion temperature TiT_i intervals using extreme ultraviolet (EUV) line widths, only assuming that the plasma nonthermal velocity is the same for all ions. We measured ion temperatures at the polar coronal hole boundary simultaneously observed in 2007 by the EUV Imaging Spectrometer (EIS) on board the Hinode satellite and the Solar Ultraviolet Measurements of Emitted Radiation (SUMER) on board the Solar and Heliospheric Observatory (SOHO). The temperatures of ions with the charge-to-mass ratio (Z/AZ/A) less than 0.20 or greater than 0.33 are much higher than the local electron temperature. The measured ion temperature decreases with the Z/AZ/A to 0.25 and then increases with the charge-to-mass ratio. We ran the Alfv\'en Wave Solar Model-realtime (AWSoM-R) and the SPECTRUM module to validate the ion temperature diagnostic technique and to help interpret the results. We suggest that the widths of hot lines in the coronal hole (e.g., Fe XII, Fe XIII) are also affected by the solar wind bulk motions along the line of sight. We discussed the factors that might affect the line width fitting, including the instrumental width and non-Gaussian wings in some bright SUMER lines that can be fitted by a double-Gaussian or a κ\kappa distribution. Our study confirms the presence of preferential heating of heavy ions in coronal holes and provides new constraints to coronal heating models.Comment: Submitted to ApJ, 26 pages, 18 figures. Jupyter notebooks are available at https://github.com/yjzhu-solar/EIS_SUMER_PCH_Ti. Comments are welcom
    corecore