instruction
stringlengths
0
29.8k
⌀
**Laconic** This is the highest profile attempt I've heard of so far. It was announced on this paper by Adam Yedidia and [Scott Aaronson](https://www.scottaaronson.com/): https://www.scottaaronson.com/busybeaver.pdf and on this blog post by Scott: https://scottaaronson.blog/?p=2725 - repo toplevel on Adam's GitHu...
null
null
Assume that the graph is non-empty, pick an arbitrary vertex $s$ and construct the first $\lceil \log n \rceil$ levels of the BFS tree $T$ from $s$. You will encounter some non-tree edge $(u,v)$ in the process. This is trivially true when $n=4$, as the only possible graph that satisfies the degree constraints is $K...
There are many algorithms used for Very large-scale integration design (VLSI) or EDA (Electronic Design Automation). Most of them are challenges that imply some combinatorial/mathematical optimization. For instance, some well-known problems and their algorithms can be interesting for the field - Graph generation, Fl...
What are some applications of gerrymandering for Electronic Design Automation/Very large-scale integration?
|optimization|combinatorics|combinatorial-design|
With a simplified notation, $\omega$ holds if $\forall\,c:f>c\,g$, while $O$ holds if $\exists\,c: f\le c\,g$. These are obviously contradictory statements.
As pointed by [@Pseudonym](https://cs.stackexchange.com/users/6553/pseudonym) a context-free language is deterministic if and only if it has a grammar such that is $LR(k)$, for some $k$. Let's take $k = 1$, the grammar is $LR(1)$ (and $LALR(1)$) so it is deterministic.
null
null
Given recurrence equation : $T(N) = T(N) + T(N-1) + N$ Given base case $ T(1) = -3$ So I rewrote the equation as $ T(n)+ n + T(1) = T(n-1)+ (n-1) + T(1) + T(n-2)+(n-2)+T(1)$ Substituting $ V(n) = T(n) + n + T(1)$ we get : $V(n) = V(n-1) + V(n-2) $ which is the Fibonacci relation , hence : ...
Validity of time complexity analysis
|time-complexity|
I think this sounds like a pretty fascinating question. If you can simply normalize all the weights to be between 0 and 1, both on the initial sphere and in the segment, then you can get the weight values to be comparable. If that does not work, one algorithm I would try would be using a weighted k-means cluster...
Given recurrence equation : $T(N) = T(N-1) + T(N-2) + N$ Given base case $ T(1) = -3$ So I rewrote the equation as $ T(n)+ n + T(1) = T(n-1)+ (n-1) + T(1) + T(n-2)+(n-2)+T(1)$ Substituting $ V(n) = T(n) + n + T(1)$ we get : $V(n) = V(n-1) + V(n-2) $ which is the Fibonacci relation , hence : ...
Given recurrence equation : $T(N) = T(N-1) + T(N-2) + N$ Given base case $ T(1) = -3$ So I rewrote the equation as $ T(n)+ n - T(1) = T(n-1)+ (n-1) - T(1) + T(n-2)+(n-2)-T(1)$ Substituting $ V(n) = T(n) + n - T(1)$ we get : $V(n) = V(n-1) + V(n-2) $ which is the Fibonacci relation , hence : ...
null
|time-complexity|check-my-answer|
**Notation**: We write $|\alpha|$ to denote the length in characters of an expression $\alpha$ in propositional logic. Consider an expression $\alpha_n$ in disjunctive normal form built from $2n$ variables where each conjunct contains $n$ variables chosen from those $2n$ original variables. All $\binom{2n}{n}$ conj...
Complexity of a Set of Formulas
|complexity-theory|logic|propositional-logic|
null
Self-taught programmer here. I'm reading CORS, and right at the beginning, question 1.2-2, there asks a question: > For inputs of size $n$, insertion sort runs in $8n^2$ steps, which merge sort runs in $64n\lg n$ steps. Which values of $n$ does insertion sort beat merge sort? I simplified this to $n=8\lg n$, and...
Understanding crossover points in efficiency between insertion and merge sorts
|algorithms|sorting|efficiency|mathematical-analysis|
Yes, there is an oracle with $P^A = NP^A$ and $EXP^A \not= NEXP^A$. It is an exercise in Odifreddi: Classical Recursion Theory Vol. II on page 253. An example is in Kurtz : Sparce sets in NP - P: relativization S.I.A.M J. Comp. 14(1985) 113-119
I think a divide and conquer (D&C) approach is valid, and leads to an $O(n \log^3 n)$ solution (maybe the log exponent can be reduced). The D&C technique reduces the problem to the following: Given two arrays $A$ and $B$ compute $$\prod_{a \in A, b \in B} a - b$$ Consider the following polynomial: $$P_A(X) ...
Understand that the purpose of the exercise is to let you realize that there can be crossover points. But the given functions are imaginary and just mean to show trends. (In practice, the expressions are more complicated and low order terms become dominant for low $n$.) So don't care about small $n$. Obviously, this...
**Laconic** This is the highest profile attempt I've heard of so far. It was announced on this paper by Adam Yedidia and [Scott Aaronson](https://www.scottaaronson.com/): https://www.scottaaronson.com/busybeaver.pdf and on this blog post by Scott: https://scottaaronson.blog/?p=2725 - repo toplevel on Adam's GitHu...
null
I have a finite region of 3D space that some (arbitrarily-shaped, concave) geometry occupies, and I need to identify whether that geometry forms a closed 3D volume (or multiple disjoint closed 3D volumes). That is, I need to identify if, and where, the geometry isn’t airtight. The geometry is, effectively, a series of ...
Detecting non-airtight geometry
|computational-geometry|space-partitioning|
null
null
I've you've ever had a table of text like in Word or Google Docs, you'd know that there are ideal widths for each table column to minimize the height of the table and fit the most text, [here's an example](https://imgur.com/a/6wd9H5i). I've tried thinking about how I could implement that myself, but have no ideas. I wo...
What would be an algorithm for calculating the ideal column widths of a table to show on-screen, to minimize the table's height?
|algorithms|
null
Yes. You can build a Boolean circuit $\beta_n$ of size $O(n \lg n)$, that is equivalent to $\alpha_n$. It works by counting the number of "true"s among the inputs, compares it to $n$, and outputs true if it is greater or equal, or false if it is less. What's the size of this circuit? Adding up the number of "true...
There is a reasonably efficient algorithm for this. I will assume that you have a value $w$ that is the maximum possible width for the table, and you want to find column widths that sum to at most $w$, that minimize the table height. For instance, $w$ might be the width of the page or of the text region on the page....
null
The algorithm by Chazelle in the linked paper, for general dimension, is optimal in terms of worst case asymptotic complexity. So in terms of theoretical results for finding exact solutions, this paper is pretty much the last word. Indeed, Raimund Seidel notes in the chapter on convex hulls from the _Handbook of Comput...
null
A mesh is airtight if every edge belongs to exactly two faces. It is a purely topological test. But life can be made harder with multiple vertices having the same coordinates, degenerate faces where edges have been merged, self-intersecting surfaces...
null
A good account of this result is in the [lecture notes of Dexter Kozen][1], although the original work of Meyer and Stockmeyer contains a refined space bounds. You may consult that version in Stockmeyer's thesis, proposition 4.11 and theorem 4.13, for instance. For the part on showing that if the languages are inequ...
null
SAT Solvers focus on CNF formulas. For many implications it is much mroe natural to use implications and conjunctions to encode problems, and when converting to CNFs, information is lost, and the solver may need to extra work. Is it possible that if we would rewrite SAT solvers to solve formulae using conjunctions a...
Could SAT solvers be significantly more efficient if they allowed for non-CNF formula?
|sat-solvers|
From this [research paper](https://www.ariel.ac.il/wp/noam-hazon/wp-content/uploads/sites/317/2023/03/23.aamas_.fair_capacity.pdf) I want to write an algorithm for finding envy-freeness(EF) and Pareto optimality(PO) division for more than two agents. We consider the problem of fairly and efficiently allocating indi...
Finding an algorithm EF[1,1] and PO division for more than two agents
|algorithm-analysis|machine-learning|artificial-intelligence|agent-based-computing|
I recently had a software engineering exam, and there's a particular question that's causing some confusion between my professor and me. I'd like to get some insights from the community to better understand this issue. If I can convince my professor I was right, I could get a higher grade. The Question: The quest...
Question Regarding Design Constraints in Software Engineering Exam
|software-engineering|
*I'm a freshman in computer science and I have a question that has been bugging me after my programming and electronics classes were over.* **My question** is that in an integer datatype (assume **short** datatype in Java, where the range is from -32768 to +32767.) I understand (based on what has been taught) that t...
Datatypes and number representaton
|programming-languages|
From this [research paper](https://www.ariel.ac.il/wp/noam-hazon/wp-content/uploads/sites/317/2023/03/23.aamas_.fair_capacity.pdf) I want to write an algorithm for finding envy-freeness(EF) and Pareto optimality(PO) division for more than two agents. We consider the problem of fairly and efficiently allocating indi...
Let us do 8-bit numbers, it's less writing. **The left-most bit is *not* the sign.** It contributes $-256$ to the value. More precisely, here are the values of the bits, where bit 0 is the right-most one and bit 8 is the left-most one: |Bit|Value| |---|-----| | 0 | $2^0 = 1$ | | 1 | $2^1 = 2$ | | 2 | $2^2 = 4...
null
You can use CPLEX to solve by modeling your problem as MIP or CP. For the MIP algorithms in CPLEX is branch and cuts algorithms. For the CP algorithm in CP Optimizer is filter method. You can refer the official website in Cplex to realize the detailed. [MIP Solver][1] [CP Opimizer][2] [1]: https://w...
Hint: One obvious algorithm for this problems goes as follows. Given two regular expressions $R,S$, convert them to NFAs $N_R,N_S$ and then to DFAs $D_R,D_S$. Using the product construction, construct a DFA for $D_R \Delta D_S$ (here $A \Delta B$ is the symmetric difference), and check whether the language it accepts i...
The [prior answer](https://cs.stackexchange.com/a/161240/755) already explained a standard way to solve this kind of problem: introduce boolean (0-or-1) variables to model the disjunction, and then solve with an off-the-shelf integer linear programming (ILP) solver.
null
That's a natural idea. However, to the best of my knowledge, despite attempts, no one has succeeded in making such an approach do better than just converting to CNF and using an existing SAT solver. First, I want to note that many implications *are* already natively supported. The implication $u \implies x$ is equ...
I am trying to encode some circuit checking algorithms, but encountered difficulty creating a 2SAT representation for a NAND circuit. Is there a proof that this is not possible?
Is there a 2SAT encoding for a NAND gate
|logic|satisfiability|circuits|software-verification|combinatory-logic|
No. Using the definition of NAND and [De Morgan's law][1]: $$x \;\text{NAND}\; y = \overline{x \wedge y} = \overline{x} \vee \overline{y}.$$ [1]: https://en.wikipedia.org/wiki/De_Morgan%27s_laws
Let HALT be a program that can decide the halting problem for any program and its input. HALT has two inputs, the program and the program's input. Let OPPOSITE be a program that accepts a program as input, calls HALT with its input as both of HALT's inputs, and then does the opposite of whatever HALT has concluded. ...
My reading of > *Initial states* prescribe fixed starting values for all but the input register; in particular, the output register starts with value $b$. on page 376 is that, for any consensus protocol $P$ considered in the paper, the program counter and the internal storage of every process $p$ are uniquely det...
null
null
null
There is no proof that it is impossible, but it is believed that it's unlikely to be possible, because if you could convert every circuit with NAND gates to 2CNF, you would have a proof that P = NP. (This is because there are known polynomial-time algorithms to test the satisfiability of 2CNF; if such a convers...
The truth table of $\textrm{NAND}$ is: $$ \begin{array}{|c c|c|} % |c c|c| means that there are three columns in the table and % a vertical bar ’|’ will be printed on the left and right borders, % and between the second and the third columns. % The letter ’c’ means the value will be centered within the column, ...
The discount factor **does not** represent the likelihood of reaching the state $s′ $from the state $s$. That would be $p(s'|s,a)$, which is not used in Q-Learning, since it is model-free (only model-based reinforcement learning methods use those transition probabilities). The discount factor $γ$ is a hyperparameter t...
null
Okay so here's my current solution for the question that asks whether the language is context free: $$L = { a^nb^{3n}c^n | \, n \geq 0 } $$ Assume by contradiction that L is context-free. Let p be the pumping length given by the Pumping Lemma. Choose string $$s = a^pb^{3p}c^p ∈ L$$. |s| ≥ p. Take an arbitra...
Confused about decomposition in Context Free Pumping lemma
|formal-languages|context-free|proof-techniques|pumping-lemma|
null
Let us assume I use bloom filters of size $m$ bits with $k$ hash functions. Now I have two set $X$ and $Y$. Let $B(X)$ be bloom filter of the set $X$. In general I know that $B(X\cup Y)= B(X) \lor B(Y)$. Let us assume that $|X|=n, |Y|=m, |X\cap Y|=l$. So I can use [formula from wiki][1] for math expectation for n...
Number of non-zero elements in intersection of two bloom filters
|probability-theory|probabilistic-algorithms|bloom-filters|
I know there are algorithms for translating regular NFAs into their corresponding DFAs. Can these algorithms be applied to automata that employ transitions involving counters in a straightforward way, or are there special considerations that need to be taken into account, or even different algorithms altogether?
Translating non-deterministic finite automata with counters to deterministic ones
|automata|finite-automata|nondeterminism|
Your substitution is correct and indeed leads to Fibonacci. Anyway the final answer does not respect $T(1)=3$. I would prefer to rework the recurrence independently of $T(1)$, writing $$T(n)+n=T(n-1)+n+T(n-2)+n$$ or $$U(n)=U(n-1)+U(n-2)+3$$ then $$U(n)+3=U(n-1)+3+U(n-2)+3$$ and $$V(n)=V(n-1)+V(n-2).$$...
Your substitution is correct and indeed leads to Fibonacci. Anyway the final answer does not respect $T(1)=3$. I would prefer to rework the recurrence independently of $T(1)$, writing $$T(n)+n=T(n-1)+n+T(n-2)+n$$ or $$U(n)=U(n-1)+U(n-2)+3$$ then $$U(n)+3=U(n-1)+3+U(n-2)+3$$ and $$V(n)=V(n-1)+V(n-2).$$...
Your substitution is correct and indeed leads to Fibonacci. Anyway the final answer does not respect $T(1)=3$ and there is a sign error. I would prefer to rework the recurrence independently of $T(1)$, writing $$T(n)+n=T(n-1)+n+T(n-2)+n$$ or $$U(n)=U(n-1)+U(n-2)+3$$ then $$U(n)+3=U(n-1)+3+U(n-2)+3$$ and ...
If you could encode Q = A NAND B using a conjunction of disjunctive clauses with 2 literals, then you could transform any circuit into a polynomial-size 2-SAT formula (NAND gates are universal). This would allow to check whether there is a set of inputs for which the circuit outputs "true" in polynomial-time. Howev...
null
Your substitution is correct and indeed leads to Fibonacci. Anyway the final answer does not respect $T(1)=-3$ and there is a sign error. I would prefer to rework the recurrence independently of $T(1)$, writing $$T(n)+n=T(n-1)+n+T(n-2)+n$$ or $$U(n)=U(n-1)+U(n-2)+3$$ then $$U(n)+3=U(n-1)+3+U(n-2)+3$$ and...
I would argue that the answer is "all of the above". - Programming language and algorithms: is it worth the cost of a new compiler and associated tools to use the newest wiz-bang language, or do you make do with the language and tools you have already purchased? What algorithms will allow the application to perfor...
Yes, they can be employed in a straightforward way. However, the size of the formulas blows up exponentially big. If the NFA's transitions involve formulas $\ell$ of a particular form (e.g., $\text{ctr} \ge 3$, $\text{ctr}' = \text{ctr}+1$), then the DFA's transitions will involve DNF formulas where $\ell$ are lite...