2011-11-01から1ヶ月間の記事一覧

complexity of transforming a propositional formula to its CNF

The space complexity of transforming a propositional formula to its CNF is as follows: O(Var(p)*Leng(p)) where Var(p) is the number of variables, and Leng(p) is the length of the p. According to Thierry Boy de la Tour: An Optimality Result…

generating random number in haskell

Haskell でランダム数の発行。 import System.Random main = do g <- getStdGen let ns = take 5 (randomRs (1,20) g) print $ (ns :: [Int]) -- rollDice :: IO Int -- rollDice = getStdRandom (randomR (1,6))