instruction
stringlengths
35
29.1k
It is known that: ${\sf BQP} \subseteq {\sf PSPACE}$ and ${\sf PH} \subseteq {\sf PSPACE}$. If tomorrow its proven that ${\sf PH} = {\sf PSPACE}$ it would also imply ${\sf BQP} \subseteq {\sf PH}$. Query: Since, it is also widely believed that ${\sf NP} \not\subseteq {\sf BQP}$. So where does this leave us in terms of ...
I'm reading Type Theory and Formal Proof by Nederpelt and Geuvers. Chapter 3 is about $\lambda 2$ and $\Pi$-Types (aka System F, I think?) and the derivation rule for 2nd order abstraction seems to forbid "shadowing" of the type variable; i.e. in context $\Gamma \equiv \alpha : *$ it is not possible to derive a term of...
The stable algorithm has to run in O(n) time and must call the following unstable algorithm at least once. EDIT: Calling unstablesort() is free (costs 0 operations). def unstablesort(l): return selectionsort(shuffled(l)) # shuffled(l) returns list l randomized This is apparently an easy question but frankly I don'...
Given an undirected graph with nonnegative edge weights and a partition of the vertex set into terminals and Steiner vertices, the Steniner tree problem consists in finding a minimum weight tree in the graph that contains all terminals and any subset of the Steiner vertices. The metric steiner tree problem is when the ...
I want to sort a set of items, where some comparisons are expensive and others are cheap. What is an algorithm that will minimize the worse-case number of expensive comparisons? For instance, I want to rank sports players (assuming performance is completely deterministic, i.e. a game between two players will always hav...
I know that formally the time compliexity of an algorithm is measured in the length of the input, which in binary would be the number of bits required to encode the input. The problem that I have with this definition is that wouldn't this definition make a lot of seemingly obvious poly-time algorithms involving numbers...
I am currently making a 2 tape turing machine for a language that has a binary palindrome (ex: L = {x is over {0,1} | x is a palindrome }. I can assume that the tape is only infinite in one way (the right side). and when using 2 tapes, the first one contains the input, the other is empty, and both heads start at the b...
I'm having a bad time understanding how multiple concepts work simultaneously for achieving linking/loading correctly an executable. From the very beginning loading/linking is basically the art of putting another layer of abstraction over concrete memory addresses to achieve using the same piece of code over multiple e...
I'm a programmer, let's start by that. The question may sound really broad, and in fact it is. I'll list some things that I know, and some other things I've doubts about under the form of questions. My current understanding is the following: You have a CPU. This CPU can have multiple cores. Each core runs in parallel. ...
Are there languages that can be parsed by an LR(k) parser but not by an LL(k′) parser for any k′?
Let $S = \{P_1, P_2, ..., P_m\}$ be a set of convex polygons in $\mathbb R^2$ with a total of $n$ vertices. Polygons are defined by ordered lists of vertices, and each vertex is represented by a pair $(x,y)$ of its Cartesian coordinates. Polygons may have non-empty pairwise intersections. A convex polygon is called sta...
I was recently sorting a large list of names - I just ended up sorting it in Python, but it inspired in me the following question. If we're given a list $L$ of $n$ numbers, but can only see $k$ contiguous elements at a time and can shift a group of elements at once, what would be the fastest way to sort this list? I or...
The various temporal logics are particularly suitable for the specification and verification of concurrent computer programs. Are there logics that are particularly suitable for the specification and verification of multi-agent and distributed systems and algorithms? Or are the temporal logics used as-is for these purp...
In my textbook "AI: A Modern Approach" it states that we expand a node to generate it's children. So I understand the definition of those two words as: Expand - Generate/create all the new children nodes of a particular node Generating - A (child) node is generated when its parent is expanded Now, when it comes to goal...
Rice's theorem comments on the undesirability of non-trivial semantic properties, however there are syntactic properties that are undecidable as well, such as the "useless" states problem for Turing Machines. What are some undecidable syntactic properties? Can we comment on the undecidability of a syntactic property ...
I can't find example of L not regular language that suff(L) is regular I tried something like this: {0^n1^n|n>= 0}, but i can't prove that it's suffix is regular Suff(L) = {x ∈ Σ ∗ | ∃u ∈ Σ ∗ such that u · x ∈ L}. thank you for the help :)
The celebrated proof that IP = PSPACE relies on an interactive proof for the QBF problem. Is there any other "natural" interactive proof for a PSPACE-hard problem other than QBF? (of course, since QBF is PSPACE-complete, such a proof exists via a reduction to QBF; I ask for a direct interactive proof that does not go t...
I've seen that quantum computing calculations have their own complexity classes https://en.wikipedia.org/wiki/Quantum_complexity_theory, namely BQP and QMA. I've heard that this would beat any classical computer, but I wonder if it would also beat a custom-made massively parallel computer. By massively parallel compute...
Here's Alan Turing's halting problem in pseudocode: function halts(f: Function, input: any): boolean { // Some logic that can supposedly solve the halting problem // ... } // A function that takes itself as an argument and does the opposite of what halts says function paradox(f: Function, input: any) { if (halts...
[1] gives an example for PDA which contains rules of: (p,e,Z,q,Z) (p,e,A,q,A) and says, The third and fourth instructions say that, at any moment the automaton may move from state p to state q. So, how does PDA know when it needs to move from a state to another? [1] https://en.m.wikipedia.org/wiki/Pushdown_automaton...
Im designing my own CPU but I don't know how it jumps to an instruction that's no longer in ram. People have told me it puts the address in the SSD but for example, if the address were 3 in ram it would most likely not be in address 3 in the SSD. someone help me I don't understand.
It is often said that NP-intermediate problems, such as factoring, graph isomorphism, discrete log, and so on are "harder" than the problems in P. Meaning that they cannot be solved in polynomial time. But does this imply that all problems in P reduce to all problems in NPI? This would imply that all problems in P redu...
We know if $NP\subseteq P/poly$ then $PH=\Sigma_2$ Then We want to show that $\Sigma_2-SAT\in P/poly$. Now $$\phi\in \Sigma_2-SAT\iff \exists\ x\in\{0,1\}^{p_1(n)}\ \forall\ y\in \{0,1\}^{p_2(n)},\ \phi(x,y)=1$$ Now consider the language $L=\{(\phi,x)\mid \forall \ y\in\{0,1\}^{p_2(n)},\ \phi(x,y)=1\}$. This language i...
According to the theorem(see reference) on the rigidity of frameworks: A rectangular framework is rigid if and only if its associated bipartite graph is connected. Now consider the case for a 2-by-2 rectangular framework. In this case, if we draw a brace in the first and the third squares, the framework becomes rig...
Consider a Euclidean space $\mathbb{R}^d$. Consider $ X \subset \mathbb{R}^d$ where $X$ is a finite set with $|X|=n$. Consider the set of line segments $\{xy | x,y \in X\}$ . I have a process $Z$ that I want to apply to each line segment, from smallest to largest but I will stop examining line segments when a line segm...
Given a problem (D, c, Min) with admissible set D={(x,y)∈R2 : |y+√3x|≤2√3,|y-√3x|≤2√3,|y|≤3} and the price function c(x, y) = x + 2y. Translate the given problem to a linear program in standard form. Determine the corresponding matrix A and the vectors ⃗b and ⃗c respectively.
In a multi commodity network, we define a demand to be a vector $d \in \mathbb{R}^{k}$, where $k$ is the number of pairs of sinks. That is, $k = \binom{S}{2}$, where $S$ is the set of sinks (aka terminals). For example, if $\left| S \right| = 3$ we have $\binom{3}{2} = 3$ possible pairs of sinks. A demand can be of the...
Given two problems, $A$ and $B$, that are NP-hard. Is either one of the following is true? $A \leq_m$ B $B \leq_m$ A In other words, is there always a relationship between any two arbitrary NP-hard problems? Also, I am speaking of polynomial time reductions, but I don't think specifying that will change the answer to...
So the problem starts with a graph in which every node is connected with every node by a weighted edge. The goal is to find a weight treshold W, so that every edge that has a weight lower than or equal to W gets removed, which results in the maximum amount of connected components. A connected component is defined as at...
In the class $IP$ we have a probabilistic polytime verifier which interacts with a nondeterministic prover polynomial times and all the messages are of length polynomial of the input. We can think of this as a $BPP$ machine asking queries to a $NP$ oracle and doing its computation. All the interactions the verifier doe...
Let L = { y = {0,1}* | y = code(M) for some Turing Machine M and M halts on no input} How can I prove whether this language recognizable or unrecognizable?
I'm trying to write a gradient ascent approach to divide all points on a polygon into two sets via a continuous line (something like the below, where our polygon is a circle and we partition such that all points above the secant line in the circle are in $S_1$ and all points below the secant line within the circle are ...
By "$T$ runs in polynomial time", I mean that $T$ halts for every input of length $n$ in $O(n^k)$ steps for some $k$. By Turing-recognizable, I mean that there exists a Turing machine that halts in the accept state iff the input $w = \langle T\rangle \in L$. I'm not really sure how to approach this problem. It seems ...
Say I have f(x1,x2,x3,...) where the output is either 0 for all inputs (unsatisfiable) or a variable boolean output of 0 or 1 depending on the input (satisfiable). Let's not consider functions that are always satisfiable) If I don't know whether f is satisfiable or not: Can I find a function f' (in polynomial time), su...
I've been trying to come up with a proper grammar for this sort of language: L = { aˣbʸaˣbʸ | x, y >= 0 } I have failed to find a way to enforce consistent generation of terminals on either part (the same amount of a's and b's on both "sides", where a side would be aˣbʸ). I've observed that this language could be a con...
Say we have context-free grammar for function declarations and calls (C-style) START = DECLLIST CALLLIST DECLLIST = FDECL DECLLIST | FDECL CALLLIST = FCALL CALLLIST | FCALL FDECL ::= fname lbrac TARGS rbrac semicolon TARGS ::= TARGFST TARGSREM TARGFST ::= type name TARGSREM ::= comma type name | comma type name TARGSR...
(Sorry for my previous ill-posed question; I deleted it. This question is a refinement.) For every computer we use, it has finite RAM. In perspective of complexity theory, it's one giant memory that is accessible in constant time. However, Turing machines have unbounded memory, and thus cannot be represented in finite ...
I'm reading OSTEP for my Operating Systems course, and I have a question from Chp.6.3: Note that there are two types of register saves/restores that happen during this protocol. The first is when the timer interrupt occurs; in this case, the user registers of the running process are implicitly saved by the hardware, u...
I was asked a question whether I could come up with a 2-CNF over several variables that has no 2-DNF representation. However I thought that any CNF can be converted to DNF through some manipulations e.g. De Morgan, distributivity, etc.
I'm in the process of designing a data structure (using only linked lists and arrays) with the following complexity requirements: -initialize 0(1) get,delete,modify by index O(sqrt(n)) add_last 0(sqrt(n)) In order to cover all original n elements I've decided to make a collection of lists numbered 1,2,...,√3n (a hin...
I have a weakly-connected weighted digraph $G$, and I'd like to divide it into $k$ weakly connected subgraphs $G_k$ each with approximate equal total weight $w_{T_k}$ ($w_{T_k}$ = sum of weights of all edges in $G_k$). I'm not able to find exactly what I'm looking for using networkx, so I'm wondering if there's an easy...
Problem: Given a list of wild card strings(wild card is a * which is always at the end of a string), determine if the list has strings that are extension of another wild card string in the list. Examples: [abc., abc.def. ] the list has field abc.def.* which is an extension of abc.* [abc.xyz., def.] the list has ...
How would you modify the Product Construction for DFAs to find a DFA that recognises the union of two regular languages with different alphabets. I am not looking for a way of finding an NFA then converting that to an equivalent DFA but explicitly modifying the Product Construction Theorem.
To understand the Pumping Lemma, I'm going to prove that the language $L = \{0^n1^m0^n | n,m \geq0\}$ is not regular. I choose string $w = 0^{p/2}1^{p/2}0^{p/2}$, for any even number $p$. Clearly $|w| > p$. I use the following decomposition $x = 0^{p/2}$ $y = 1^{p/2}$ $z = 0^{p/2}$ Clearly for any $i$, $xy^iz \in L$,...
In an undirected graph it takes $O(|V| + |E|)$ time to visit all nodes in a simple graph using BFS according to our lecture notes. But why can't you visit them all in $(|V|)$ time instead?
For every $i$ we define $\Sigma_i=${$1, 2, ..., i$} and a language over said $\Sigma_i$: $L_i=${$w\in \Sigma_i^*| \exists \sigma \in \Sigma_i :\sigma$ does not appear in $w$} And I'm asked to prove that for all $i>2$, $L_i$ has an NFA with $i+1$ vertices. I've had the idea of implementing it as a chain of vertices wher...
Background Let $n, m \in \mathbb{N}$ with $n < m$. We call $C : \{0, 1\}^n \rightarrow \{0, 1\}^m$ an error correcting code of distance $\delta \in [0,1]$ if for any distinct $x^1, x^2 \in \{0,1\}^n$, it is the case that $$\Delta_C(x_1, x_2) := \frac{|\{i \in [m] : C(x^1)_i \neq C(x^2)_i\}|}{m} \geq \delta$$ The Walsh-...
I am going through notes on Computability theory and Galosis Theory by Russel Miller. In it, many times the phrase "set of all programs" is used. Could someone give a formal definition of what the set of all programs are?
The term "heap" has majorly two meanings in computer science - The "heap" memory in the context of memory management. The "heap" data structure as the representation of a priority tree as an array. I can understand the use of the word "heap" in the context of memory as it correlates to the literal meaning of the word...
Having this, if I pass an empty input to the machine it is supposed to be accepted, isn't it? It doesn't say 'exactly'.
If m = Ram quantity in GB, b = bus width in bits, and n = a nonnegative integer, it appears that b = m•2^n and or m = w/2^n, what do the variables represent physically? I.e., what physically changes to, say, a GPU design if you change b, m, or n? E.g., how is the design different for m₁ = 5 and n₁=7 instead of m₂=10 ...
I am looking at the problem of finding the quadrilateral of minimum area that encloses a convex polygon. I found the following articles: An Optimal Algorithm for Finding Minimal Enclosing Triangles by Joseph O'Rourke, Alok Aggarwal, Sanjeev Maddila, and Michael Baldwin, in time $O(n)$, for triangles; Implementation o...
I have the main idea, yet I'm uncertain on how to construct this PDA (in terms of states, transitions) We can assume the alphabet $\Sigma$ is {$0,1$}, proving for $\Sigma=${$0,1$} is a sufficient proof that 'covers' all $\Sigma$'s such that $|\Sigma|\geq 2$. I want to use the fact that the language $L=${$w\in\Sigma^* :...
I am studying an optimization problem which can be recast as an LP I have described below. I wish to understand the structure of optimizers of the original problem by studying the optimizers of the LP. There are several versions of assignment problems that are comparable to our LP, such as the many-to-many and many-to-...
I am looking for a O(1) solution for finding the number of substrings a character is part of. For instance, let s = "abcde" and all substrings of s are a, b, c, d, e, ab, bc, cd, de, abc, bcd, cde, abcd, bcde, abcde Now 'a' is part of a, ab, abc, abcd, abcde So I guess The first (and the last character) of the string i...
I am wondering about a way to CNF encode an EqualsK constraint with two possible values. In other words, I want to solve for the equation: $$ (\sum_{i=1}^n x_i = A) \lor (\sum_{i=1}^n x_i = B) $$ There are CNF encodings already discussed for encoding EqualsK constraints with one value K, like here for instance, where t...
Given 2 arrays $A, B$ each of size $n$. If we want to find if the two arrays satisfy the condition that $A[i] + B[i] \ge k$ for all indices $i$, it's sufficient to fulfill 3 conditions below: Sum of all elements of $A$ and $B$ is $\ge nk$ Sum of max element of $A$ and min element of $B$ is $\ge k$ (edge case) Sum of m...
Preliminaries. Let $n,m \in \mathbb{N}$. Let our alphabet be $\Sigma = \{0,1\}$, with non-empty languages $ L \subseteq \Sigma^n$ and $ L' \subseteq \Sigma^m$. We follow the standard definition for deterministic finite-state automata except that we allow the state-transition function $\delta$ to be a partial function. ...
Let's say there was a CPU with an input bus of 4 bits and the 4 bits are the opcode then the next 4 bits are the operand. It would just be an 8-bit instruction split in two. Is this possible and how would it be done with logic gates?
I am learning how to remove epsilon productions and the result I am getting seems to vary from other results I find. Beginning productions: $$S \rightarrow bSb|Ba$$ $$B \rightarrow BdSc|S|\epsilon$$ The answer I came up with is: S -> bSb|Ba|a B -> BdSc|dSc|S However, I am also seeing these two differing solutions: ...
Given an array $A[]$ of N integers. pseudocode: Traverse from left to right of this array. Let's say you are standing at index $j$. For each index i=1 to i=j-1, increment all $A[i]$ by $1$ if and only if $A[i] \ge A[j]$. Once done for all $i<j$ move over to the next $j$ ie $j=j+1$ For example lets start with: $7, 5...
Given a binary string, K, with length N, and Kolmogorov Complexity N, is there a program P, of length M, and with Kolmogorov Complexity M such that: P outputs K. M >= N. P does not contain K.
The classical proof for the sample complexity of the hypothesis class of axis-aligned rectangles usually begins by stating that our $A(S) \subset R^*$, where $R^*$ is the target function. My only question is regarding the inclusion, surely if we have no positive samples, then there is no (obvious at least) reason to be...
This question is a bit of a shot in the dark. I am asking here, though I am not convinced that such an example exists. I'd like a quick, highly intuitive example that I can throw out to my students before we engage in the halting problem. I will come back and explore RELs in more depth later in the lecture, but I was h...
I'm at a problem I don't know better to name it... maybe it's already a well known problem? It seems quite simple: There are objects and labels in a n:m relation. (Each of the n objects may be assigned to any subset of the m labels). Let s be the overall sum of the label-assignments of all objects. You can take it as a...
I'm trying to derive the language it represents. However, I'm kind of new to those topics. What happens if input b is gathered once or more than one time at state q without a in the stack? It does not have any transition, does it fail or since it is stuck is it accepted? example: abb
I asked this question specifically about why the JVM has a separate area for local variables: https://stackoverflow.com/q/76086392/1463507 It was answered satisfactorily within the scope of the question, but it made me realise my real question is actually not what I asked, but rather this: Is it possible to compile pro...
It is known that Christofides’ algorithm returns a 3/2-approximation for the traveling salesman problem given a complete graph $G$ such that distances obey the triangle inequality. Suppose that we weaken the triangle inequality to the setting where distances obey the guarantee that for each triple $i, j, l \in V$ it i...
Suppose that I have some nested algebraic data type (ie. something one can construct via datas in Haskell) that is serializeable (so no functional fields a -> b) is there any literature or known algorithms about how to automatically derive an efficient delta encoding of a change to that data type. data ADT = ... data ...
I am trying to use a boundary integral equation method to solve for laplace equation given the control points of a NURBS curve. But my BIEM is giving me very large error for numerical functions. I first did an analytical example of a circle and it work perfectly with negligible error, but then when I moved on to do the...
What is the time complexity of finding the maximal value in a minimum heap with n nodes? Can I assume the maximal value is in one of leafs? If yes, there are ceil n/2 leafs. Does that make the time complexity to O(ceil[n/2]). Is there a way to find the maximal value in O(logn)?
Prove that the following language is recursively enumerable: L = {<M,x> | Turing machine M enters the same configuration twice on input x} I have tried to construct a TM that maintains the current configuration which is of the form (u,q,v) where uv is the current tape content and the tape head is over the first symbol ...
I have a list of integers: each integer represents a node in a directed graph, and the value of the integer is both the desired indegree and outdegree of said node. Some research suggests that this is called a "balanced graph", and that my list of integers represents a "realization problem." I'm looking for a relativel...
So, as I understand things, System F (polymorphic lambda calculus) doesn't have the Y Combinator and isn't Turing Complete, but it is very expressive. This answer (https://cstheory.stackexchange.com/questions/29519/what-functions-can-system-f-not-compute), plus others, have given me the impression that there's nothing ...
I am wondering if they are automated theorem provers which can take as input known models of the theory, for example to help discard statements which are not correct. For example, if the statements are about group theory, the prover could have access to a collection of examples of groups. This approach has been used i...
I was attempting to solve "Maximum Independent Set of a Tree" and came up with an algorithm that resembled this one Why is greedy algorithm not finding maximum independent set of a graph? Code extract shown here: Greedy(G): S = {} While G is not empty: Let v be a node with minimum degree in G S = union(S, {v}) ...
I'm looking at writing a FPT (fixed parameter tractable) algorithm that takes in a tree; $T = (V, E)$. And a set of pairwise distinct vertex pairs (from $V$), $H$ and a $k>0$. Does there exist a set of edges, $E' \subseteq E$ where $|E'| \leq k$, such that the forests created by $(V, E\setminus E')$ disjoins each pair ...
In my opinion we should not talk about chatgtp or similar AIs as if they have agency, because that will lead to people thinking these programs are real intelligent beings. So I think we should avoid phrases like: ChatGTP said..,..thinks,.."it" / "he/she",... did this/did that, and so on. Is there a general way how to a...
I recently read the following article https://www.quantamagazine.org/researchers-identify-master-problem-underlying-all-cryptography-20220406/ which links to https://arxiv.org/abs/2009.11514 that proves that the existence of one way functions is equivalent to the time-bounded Kolmogorov Complexity being impossible to c...
Motivation An informal way word this question is, How would re-do some of the weird promotion rules in languages descended from C, like C# or Java. The goal would as to minimize human bewilderment when you add a signed integer (element of $\mathbb{Z}$) to an unsigned integer (an element of $\mathbb{N}$) .. However, w...
The circular buffer is filled with data one value at a time. The buffer size is N elements (let's take 3 as an example). Is there an algorithm that allows you to always know what is the minimum and maximum of the data in the buffer at a given time? Example: Initial samples: {3 4 3 1 5 2 7 3 4 1} Step 1: {[3] 4 3 1 5 2...
I was given the following definition of a verifier: Verifier $V$ is called $PrefixFree$ if for every $x,y$ such that $V(x,y)=1$, then for every $y'$ (which is not an empty string, $y'\ne\epsilon$) $V(x,yy')=0$. Based on the definition above we create the complexity class $PrefixFreeNP$ of all the decision problems th...
Problem (TL;DR): I'd like to know how to construct a CLA adder that has $O(n)$ size and $O(\log n)$ depth using only fan-in 2 AND gates and XOR gates, as suggested in this answer and this answer. Settings and motivation: I am doing a research project where we need to add or subtract two $n$ bit strings in 2's completem...
We have a procedure $P(n)$ that makes multiple calls to a procedure $Q(m)$, and runs in polynomial time in n. Unfortunately, a significant flaw was discovered in $Q(m)$, and it had to be replaced by $R(m)$, which runs in exponential time in m. Thankfully, P is still correct when we replace each call to $Q(m)$ with a ca...
Prove - The spanning tree $M$ is a minimum spanning tree (MST) for $G$ with weights $c > 0$ if and only if $M$ is an MST for $G$ with weights $c^x$ for $x > 0$. I am confused, how to prove this, as $c$ could be between $0$ and $1$, and then multiplying edge weights by $c$, will decrease weight. How can I prove the pr...
Suppose that I have 7 different integers stored in an array. Among those arrange- ments that can be viewed as a min heap, what is the maximum number of inverse pairs within the array?
If ETM = {<M> ∣ M is a Turing Machine and L(M) = ∅}, how can I prove that the complement of ETM is semi-decidable?
In a video Noam Chomsky said, that if these LLM get bigger, than also the things they are not good at get bigger too. He doesn't explain more details about this. So is this true? In what way do their problems get bigger? Sry for the little context of in what they are getting also more bad at. here is the video: (it's s...
Post's problem, posed in 1944 by Post, was to know if there is a recursively enumerable set, which, being undecidable, was not equivalent to the Halting problem under Turing reducibility. While I've seen the proof that such sets exist (the book Gems of Theoretical Computer Science has a chapter on this), the proof work...
Quantum search differs from the standard boolean SAT as it is restricted to only oracle calls to a circuit (or CNF formula). Where SAT gives us the structure of a formula (however loosely defined that is), quantum search algorithms make queries to $U_f$. It seems pretty clear that this oracle-only SAT problem is NP-har...
I was reading the LICM section of the book Advanced Compiler Design and Implementation and found me questioning why the expression d = -c wasn't tagged as invariant. It isn't hard to see that c = 2 is invariant given its operand is a constant. Then, since d = -c is taking an invariant operand, then d also should be inv...
I get the residual graph by Ford-Fulkerson Algorithm: I get that the minimum cut can be found by the residual graph, and when traversing this residual network from the source to all reachable nodes, these nodes define one part of the partition. Call this partition $S$, the rest of the nodes are called $T$. The size o...
I have a problem $\mathsf{A}$ and I would like to analyze its (parameterized) computational complexity. I found a parameterized reduction from the complement of the independent set ($\mathsf{coIS}$) problem (i.e. given a graph $G$ and an integer $k$, is there no independent set of size $k$ in G?), such that there is a ...
The title isn't the most explanatory or accurate since I had issues putting it into just a few words so here we go. I have a real-world problem and managed to find an inefficient solution that my computer is barely able to find before running out of RAM. I'm interested to find out if my problem is unique or if there is...
We are require to show that a problem where the input is a system of equalities and inequalities, each involving polynomials of degree at most 2 (with integer coefficients) in n real variables x1, x2, ..., xn. The problem is to decide whether there exists an assignment to x1, x2, ..., xn that satisfies all the constra...
I am self teaching myself basics of AI, from the internet, I am trying to do pset3 of MIT's 6.034 here at https://ocw.mit.edu/courses/6-034-artificial-intelligence-fall-2010/pages/assignments/ the specs of the pset wants to implement a alpha-beta search algorithm with the following signature def alpha_beta_search(board...
I want to find an appropriate structuring element so that only the indicated pixels (by X) are removed as a result of an opening operation, while all other image points remain unchanged. I know how to do opening operation but designing the kernel is very confusing. Is there a simple way to this by inspection?
public static void reverseFirstK(Queue<Integer> q, int k) { LinkedList<Integer> stack = new LinkedList<>(); for (int i = 0; i < k; i++) { stack.push(q.remove()); } System.out.println(q); System.out.println(stack); while (!stack.isEmpty()) { q.add...
I was studying graphs and it got me wondering if edges with negative weights affected the outcome of Prim's Algorithm in finding a minimum spanning tree. So would the Prim's algorithm still find a suitable MST unaffected by negative weights on the edges of the graph?
Preliminaries. Let $n,m,p \in \mathbb{N}$ with $n,m,p > 1$. We allow that $p$ could be large but still bounded by a function of $n$: $p = O(2^n)$. Let our alphabet be $\Sigma = \{0,1\}$, with non-empty languages $ L_1,L_2,...L_p \subseteq \Sigma^n$ and $ L' \subseteq \Sigma^m$. The other preliminaries are the same as t...