Problem Detail: Consider a static set $S$ of positive numbers from range $[1..10^9]$. Is there an efficient algorithm to answer queries of the form: “Given a number $d$ is there an element $x in S$ such that $d | x$”. Simple Read More …
Blog
[Solved]: What is a real-world use-case/need for a left-recursive grammar?
Problem Detail: I understand the basics of how left-recursion works, and why some people say it’s bad. And I’ve also ready opinions such as: …like LL and LR parsing, PEGs are often frustrating to use in practise. This is, principally, because Read More …
[Solved]: What is a stateful computation?
Problem Detail: I am reading about a specific field of probabilistic programming, and trying to understand what the term “stateful computation” means. See: http://projects.csail.mit.edu/church/wiki/Simple_Generative_Models (search for “XRP”) Asked By : Astrid Answered By : Shreesh Stateful computation basically means that the model of Read More …
[Solved]: Variation on Insertion Sort
Problem Detail: I’m writing insertion sort in scheme, but due to the difficulty of writing it recursively within the constraints of list processing of scheme, I made what seems like an insignificant change to the “find lowest” or inner loop. I’ll Read More …
[Solved]: 2-way Graph Partitioning problem
Problem Detail: We have a graph $G=(V,E)$ and we need to divide this graph into two clusters $A$ and $B$. Some pairs of vertices $u$, $v$ should not be in the same cluster, and we define an edge $(u,v) in E$. Read More …
[Solved]: Recipe book for SAT encodings?
Problem Detail: SAT solvers are getting more and more efficient in solving large instances and are being used as back-ends in various contexts. Every time one wants to use them to solve a problem in a specific domain, he/she has to Read More …
[Solved]: Error-correction code for transmission only with bit-flipping from 0 to 1
Problem Detail: I am using a transmission system that uses a Bloom filter (this part is out of my control). I want to send a small amount of data (32 bits) using this system. For each bit [0,31], I add its Read More …
[Solved]: Find the smallest summed distances by uniquely pairing elements of one set to elements of another set
Problem Detail: As input I have two sets of points in RN, typically for large N, for example N=40. Supose both sets have m elements: S = s1 … sm T = t1 … tm Semantically both sets are equal, but Read More …
[Solved]: Metagame Paradox: what is wrong with this explanation?
Problem Detail: Today I’ve heard about fascinating metagame paradox. I tried to come up with an explanation via Turing Machines formalization (below). Do you know what is the solution to the paradox? (the post content: definition – proposed solution – conclusion) Read More …
[Solved]: Small-step semantics: for-loops
Problem Detail: I’m trying to construct the small-step semantic rules involving the for-loops, but I can’t find anything about it in the literature (only about while-loops). I was wondering if anyone could help me out with this? This is a first Read More …