instruction stringlengths 35 29.1k |
|---|
Is it true that
$\mathsf{P} \neq \mathsf{NP}$ implies $\mathsf{NP} \neq \mathsf{PSPACE}$?
I have here some problem that is in $\mathsf{PSPACE} \setminus \mathsf{NP}$ if $\mathsf{P} \neq \mathsf{NP}$. Since I cannot find a fault in my proof, I wanted to be sure, if the upper implication holds or not.
|
My professor doesn't always know what's actually correct or wrong - he always has to think about it for a very long time and get back to the book and read the book for a long time to answer any of our questions.
He says that
I tell you that an algorithm runs in $O(2^n)$ but yet is in $\mathsf{P}$. How can this be?
Ans... |
Suppose a router X is dropping packets. Another router A will investigate whether X is dropping packets due to congestion. What are the procedures that A should follow?
A already knows X's buffer capacity. Please explain the procedures and assume an arbitrary threshold T (if needed).
|
I'm working on a project where I want to to search for vectors in the form (x1, x2, x3,...xn), and be able to search for them by specifying a specific x value and getting all vectors with that x value for that dimension. The value n, the number of dimensions, will be 4 or 5 in most cases.
For example, if I have a vect... |
I am trying to show the data abstraction for a double ended queue along with the axioms. A double ended queue is a queue where items can be added to and remove from either end of the queue. I have already got the abstraction and axioms for a normal queue but looking at it, it looks to me like it would also work for a ... |
Given boolean function $f$, let $F$ denote the unique multiaffine real polynomial representing $f$.
Sensitivity of $f$ at input $x$ is $$S_x(f) = |\{i:f(x)\neq f(x^i)\}|$$ where $x^i=x\oplus\Bbb 1_i$ where $\oplus$ is $XOR$ operation.
Sensitivity of $f$ is $$S(f)=\max_xS_x(f)$$
Is there an easy proof to show $S(f)\leq ... |
Is the language $ L = \{a^n ~| ~n \text{ has even number of digits in 10-base system}\} $ regular?
My approach: let the $ p $ be from the Pumping Lemma. Chose the smallest $ n $ which has even number of digits in 10-base system, but bigger or equal to $ p $, that is $ n = 10^{2m - 1} $ for appropriate $ m $.
According... |
Critical sections limit performance by constraining parallel execution and adding overhead. What features should a critical section have for improving performance?
|
I am writing a greedy algorithm for a variation of the interval scheduling problem that I haven't seen before.
I have a set of jobs, each with start and finish time. All jobs in set must be assigned to a worker, workers cannot have overlapping jobs. My greedy algorithm should minimise workers - use the least number of ... |
I understand what a multilayer neural network is, but what about them allows them to solve non-linear problems unlike perceptrons? Is it the fact that they can extend to any number of outputs/hidden layers? Or is it another feature?
|
It is definitely possible to write a program that takes another program as an input and changes it syntactically, but does not alter the meaning.
But is it possible to write a general program $alter$ that alters the output of a given program $P$ for some input, i.e. $\exists x: P(x) \neq alter(P)(x)$? Edit: Let's add t... |
Suppose $P \neq NP$. Does it imply that there exists some superpolynomial time bound, such that any $NP$-complete problem, like SAT, can be used to simulate an arbitrary deterministc Turing Machine working in that time bound?
Rephrasing does $P \neq NP$ imply that there exists some class $D$ of languages solvable by a ... |
For measuring the complexity of an algorithm, is it time complexity, or computational complexity? What is the difference between them?
I used to calculate the maximum (worst) count of basic (most costing) operation in the algorithm.
|
Its known that a polynomial time approximation algorithm that satisfies 3MaxSAT in 7/8+e clauses implies P=NP.
Its also experimentally known that 3SAT has the most difficult known cases when the clause to literal ratio is approximately 4.2.
Q1. Is there a similar result for 3MaxSAT where the approximation algorithm ... |
When implementing TSP GA I decided for adjacency representation (i.e. $j$ value in $i$-th index means that node $j$ goes right after node $i$), as it enables interesting heuristical crossover operation (see Greffenstette, 1985). However this source, like many others, is silent about a sensible option of mutating soluti... |
I see this theorem whose proof is not clear to me :
"Let $L \subseteq \{0,1\}^*$ be a language and suppose that there exists a polynomial time PTM M such that for every $x \in \{0,1\}^*$ and $Pr[ M(x) = L(x) ] \geq 1/2 + \vert x \vert ^{-c}$ Then for every constant $d >0$ there exists a polynomial-time PTM M' such th... |
What does "in positive position" and "in negative position" mean in the context of type theory?
The only thing I understood from Bob Harper's blog post on the topic is that there is a connection between polarity in this sense in type theory and polarity in logic, but I don't know what that connection is.
|
I'm wanting to dabble with metaheuristics and am interested to know what the "hello world" problem sets are.
In other words, what are the common problems (e.g Traveling Salesman, Vehicle Routing Problem, Maze Solving) to test various algorithms against in order to compare algorithm design?
|
I'm working on graph generation, trying to implement the RT-nested-Smallworld network model described in this paper.
We are talking about generating an undirected graph in a slightly different way than what the Watts-Strogatz model does.
One of the very first steps of the algorithm is
instead of selecting links to con... |
Set cover is NP-complete given an arbitrary set $U$, a set $S$ of subsets of $U$, and an integer $k$. However, what if $k$ is always a constant 3? Is that problem still NP-complete?
|
By this I mean a permutation of the $n$ input items to be sorted such that the number of comparisons taken to produce the correct order is maximal over all of the possible permutations of $n$ items.
Is there a pattern like all input ascending is worst case, or even some class of input permutations that have been proved... |
I am taking DBMS classes and am currently studying the various normal forms. The following is the definition of a Prime Attribute I learned in class:
A prime attribute belongs to the set of attributes which compose the candidate keys.
For example, if R(ABCDEF) is a relation with the functional dependencies given as:
F... |
http://www.algorithmist.com/index.php/UVa_10918
The above link is a solution to UVa 10918 Problem. The problem is based on Dynamic Programming. I am not able to understand this approach to the problem. I have coded the solution but the approach is completely different. I want to understand the given approach. The probl... |
Given $n$ points $(x_1, y_1), \ldots, (x_n, y_n)$ on a 2-dimensional plane.
A point $(x_1, y_1)$ dominates $(x_2, y_2)$ if $x_1 > x_2 \land y_1 > y_2$.
A point is called a maxima if no other points dominate it.
I can come up with an $O(n \log n)$ algorithm to find all the maxima. However, I failed to solve:
Prob... |
I recently created a parallel implementation of the Merge Sort, in which the sorting of several groups was accomplished by different processes, and was wondering if this was theoretically possible on Turing Machine?
|
I've been trying to convert a regular expression to a non-deterministic finite automata (NFA) first using Thompson's construction, giving:
, which looks correct.
I am then using subset construction to create the DFA from the NFA, shown here.
But this does not look correct to me, as for example 0 followed by 0 is not ... |
I know from several sources that they are equivalent, but couldn't find a reasonable explanation. My first approach was to show their equivalence by using the logical consequence rule and both axioms, but I couldn't figure out a reasonable solution.
Here is the exact problem definition:
Anybody can give me a hint how ... |
On the Lambda Calculus, there are several different ways to represent a list. For example, one can encode it as its right fold:
list = (λ (cons nil) (cons 1 (cons 2 (cons 3 nil))))
One can, instead, use pair, false, fst and snd as aliases to cons, nil, head and tail. This way, you will have this:
list = (λ (a) (a 1 (λ... |
count=0
x=7
y=3
while(y<x):
y+=1
count+=1
I'm having trouble writing this as a single expression.
|
Let $P$ be a given polygon in $\mathbb{R}^{2}$ such that all the vertices lie on integral points $\mathbb{Z}^{2}$. An integral polygonal sub-divison of $P$ is a subdivison of $P$ into integral sub-polygons. I would like to know:
If there is an algorithm to generate all such sub-divisons? I would prefer an easier to i... |
So I've been stuck trying to figure this problem out for a while. I've looked on wikis and all over stack exchange but I'm really stumped. This isn't my best subject, so any sort of explanation would be AMAZING.
The Double CNF SAT problem is given a Boolean formula in CNF determine if it
is satisfiable with every claus... |
I am wondering if deciding the decidability of problem is a decidable problem. I am guessing not, but after initial searches I cannot find any literature on this problem.
|
For generating certain hard puzzles, I am trying to model a problem (ultimately) in SAT. I don't know how to do that, so I am starting with CSP because it's more expressive. In CSP, there is a global alldiff constraint, which requires all variables to take on different values from their domains. I have a set of alldiff... |
I have the following assignment:
Prove that $\sum^n_{i=1} i2^i \in \Theta(n2^n)$
My current approach thus far is the following:
Since we need to prove $k_1 \cdot n2^n \le \sum^n_{i=1} i2^i \le k_2 n2^n$ I chose $k_1 = 1$ and $k_2 = 2$. This holds true to my condition. However I'm unsure whether I can just freely deci... |
I'm looking for a regexp matching strategy that supports conjunction and which is based on an NFA-style machine. I know how to handle conjunctions using a DFA, or using Brzozowski's approach, but for various reasons, I can't use Brzozowski's technique and bump into state explosion when using a DFA.
I know about the cr... |
What is the difference between system bus, address bus and data bus?
Are they different wires or they are using same wires but logically different?
|
We all know how to find the shortest path between two vertices, but what if I just want to know the answer to this question - is there a path, (any path), between vertex A and B of length larger than some X?
Should start from the shortest path, and then merge adjacent nodes if its length is less than X? (or extend the ... |
Consider the following adjacency matrix:
0 1 1 0 0 0 0 0 0 0
0 1 1 0 0 1 0 0 0 0
0 0 0 1 1 0 0 0 0 0
1 0 0 1 1 0 0 0 0 0
0 0 0 0 1 1 1 0 1 0
1 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 1 1 1 0
0 0 0 0 0 0 0 1 0 1
0 0 0 0 0 0 0 1 0 1
0 0 0 1 0 0 0 0 0 1
I need to find the number of paths (repeated vertices are allowed) f... |
In a cache with byte addressing, the byte you want to load is selected using the block offset. But what if I execute a LW instruction and don't want a single byte but a full 32 bit word?
Is there some logic that selects whether you don't look at the block offset and just load the whole word (when you use a "load wor... |
I have the following equation
if (x > y) {
if (y < a) {
x:= a
y:= b
} else {
x:= b;
}
}
I was thinking of something like this however I've never done it with actual functions so I'm not quite sure how to proceed.
What are the steps to take in creating a parse tree for something like this?
|
I'm trying to train a neural network using this sort of data (for a homework):
Number of Features : 42,
Target data : 0 or 1,
Number of Samples : 111 Individuals ( 69 Cases + 42 Controls )
However i'm facing an over-learning issue (the learning curve approaches the goal set, however the validation curve shows no improv... |
The problem
Some people are crossing a bridge. Each one takes a different time to pass.
Assume the people are sorted by their passing time increasingly.
These are the conditions of crossing the bridge:
only 1 or 2 people can cross the bridge at the same time in the same direction;
the speed of the two people crossing... |
I have a very simple question.
What is the right standard convention to use for declaring arrays?
I understand that for a simple declaration of a variable as an integer, this is the convention:
DECLARE myVar : INTEGER
What about for an integer array of 10 elements?
DECLARE myVar : ARRAY[1,10] of INT
or
DECLARE myVar... |
I am currently enrolled in a computer organization and design class, which I am struggling mightily with, and I have a final homework in my class that I need to get a perfect score on. The question I have having issues with is:
A program has a parallel section that represents 80% of its execution time when run on one ... |
I am currently enrolled in a computer organization and design class, which I am struggling mightily with, and I have a final homework in my class that I need to get a perfect score on. One of the questions covers cache hit-misses, and the lecture we had on the subject was relatively brief. The question I have having is... |
I've implemented two red-black trees (using the pseudo-code in CLRS) with slightly different flavors:
1) In the first tree, all the data is stored in the leaves.
2) In the second tree, the data is stored in the internal nodes.
In an application I have, I have many insertions and deletions. The performance of the first... |
A BBP algorithm is a formula with the following form where $b \in \mathbb Z$, $b \ge 2$, and $p(k)$ and $q(k)$ are polynomials in $k$
$$\sum_{k=0}^{\infty}\frac{1}{b^k}\frac{p(k)}{q(k)}$$
There are known BBP formulas for many computable numbers and it is easy to prove that any number with a BBP formula is computable.
O... |
Assume you have an infinite language $L$ over alphabet $\Sigma=\{a,b\}$
For example, $L=\{ax \mid x \in \Sigma^*\}$
Can a Turing Machine, $M$ decide this language?
(Generalizing, are all the recursive languages finite?)
In my opinion, it can, since I can enumerate all the strings and say if they are in the language or ... |
I have simple undirected graph. I want to determine a size of minimum vertex cover, a size of maximal independent set and a size of a global minimum cut.
A minimum vertex cover is complementary to a maximum independent set. So, I can find one of this this and get both of them.
Is there any relation with global minimum... |
I'm reading through William Stalling's operating system intrnals and design principles book. Talking about interrupts, it gives the following examples when comparing the speed of a processor and a hard disk:
To give a specific example, consider a PC that operates at 1 GHz, which would
allow roughly 10^9 instructions... |
This is a question from Introduction to Algorithms by CLRS (Exercise 9-1-1).
The approach I thought of is
compare the first two numbers, assign the lower number min and the bigger one to next_min
loop through numbers 3 - n,
if the number is lower than min, set min to that number.
else if the number if lower than next... |
I've been trying to wrap my head around Co-NP, and how it's different to NP, but I am having some trouble.
Co-NP is defined by Wikipedia as this: "A decision problem $\mathcal{X}$ is a member of co-NP if and only if its complement $\overline{\mathcal{X}}$ is in the complexity class NP."
When it was explained to me in c... |
I am trying to redesign my algorithm to run on Hadoop/MapReduce paradigm. I was wondering if there is any holistic approach for measuring time complexity for algorithms on Big Data platforms.
As a simple example, taking average of n (= 1 billion) numbers can be done on O(n) + C (assuming division to be constant time o... |
There is a lot of explanation about big O, but I'm really confused about this part.
Acoording to the definition of Big-O, in this function
$$f (n) \le c g(n), \quad \text{for } n \ge n_0$$
$f (n)$ is $O(g(n))$.
But a description of a function in terms of big O notation usually only provides an upper bound on the g... |
An example given for a relation R where its negation and itself are not semi-decidable was:
$R(x,y)$ holds iff $y = 0$ then $R_{HALT}(x)$ holds, otherwise $y = 1$ and $R_{HALT}(x)$ does not hold.
It's stated with the assumption that the proof is trivial (which for most it probably is), but I am struggling to see why it... |
Curry-Howard correspondence states the equivalence between logic/deduction and types/programs.
The Church-Turing thesis states the equivalence of some models of computation. Specifically, all computable functions can be written both on a Turing Machine and in Lambda Calculus.
Not all logics are equivalent however. 2nd ... |
What do you call an algorithm which is
Deterministic
When an answer is returned, it is correct
For some input, the algorithm returns no answer (fails, in bounded time).
Such algorithms crop up a lot in cryptographic attacks, for instance, where a
cipher is deemed broken when an attack (provably or demonstrably) works... |
In "Rational Set of Commutative Monoid", S. Eilenberg and M.P. Schützenberger define the class of rational subsets of a monoid $M$ as the least class $F$ of subsets of $M$ such that satisfy the following properties:
the empty set is in $F$;
Each single element set is in $F$;
If $X, Y$ are in $F$, then $X \cup Y$ is i... |
I know that:
Binary leaf trees are free magmas.
Non-empty lists are free semigroups.
Lists are free monoids.
The generalized algebraic datatype data FM a where {Return::a->FM a; Bind::FM b -> (b->FM a) -> FM a} is a free monad.
I know also that various abstract datatypes also correspond to free structures—bags are fr... |
How should I go about building a Turing machine for the following language:
$$L = \{ a^ib^j \in (a,b)^* \mid i \le j \le 2i \} $$
I know how to construct a Turing machine for $\{ a^nb^nc^n \mid n \in \mathbb N \}$ but don't really where to start for the one above.
|
Create a pushdown transducer that translates $a^m b^{2m}c^{m+n}$ into $b^{n-m}$, with $n\geq m \geq 0$.
How should I use the stack to remember or to compute how many characters of c to read? And how can I output $b^{n-m}$?
I have also tried to simplify the problem and firstly create a pushdown automata for $a^m b^{2m}c... |
Using pumping lemma, how can I prove that $L=\{a^n b^m c^k \mid n = m \vee m\neq k\}$ is not regular?.
If I choose $w= a^m b^m c^m$ and pump up with $i=2$, if have $a^m=1 b^m c^m$ but the string is still in the language. Any hint?
|
Except for the undecidable unaries I have no idea if there is anything in the gap between $P/poly$ and $P$
|
I was told to built a PDA that recognizes the following language:
$$L = \{x\#y \mid x,y \in \{0,1\}^{\ast} \wedge x \neq y\}$$
My attempt is basically to push $x$ to the stack for every $1$ and $0$ read. And then pop them for the second half. If it finishes and the stack is still not empty, it will be accepted. Or if i... |
Is it better to use comparison or radix sort to sort a long sequences of java int array?
I know that I should probably use mergesort (NlogN) for comparison sort, since it is one of the fastest and compare that to LSD or MSD. I thought about how for extremely large N, the logarithm would be larger than runtime for LSD,... |
When I'm solving a question I usually spent too much time testing whether I should pump or down? Is there any formula to know when to use which?
Also, on proofing non context free grammar we use three pumping lemma, and one that's confused me is $|uvy| \le p$. I mean in the example given in the book I read, it is not... |
Problem
When train my linear chain CRF with annotated observations, I feed it with a number of sequences containing observation values and a "ground-truth" label for each observation. I'm currently using the hCRF Matlab interface. (see 1)
In my case I have 4 continuous observation values (some in the interval [-1,1], s... |
As in the title, is it possible to find a clique with more than 2 nodes in a bipartite graph?
|
I'm reading William Stalling's Operating System Design and internals. Talking about memory, the following tradeoff was introduced:
As might be expected, there is a tradeoff among the three key characteristics
of memory: namely, capacity, access time, and cost. A variety of technologies are
used to implement memory... |
R is a regular language over $\Sigma=\{0,1\}$
$Sub(R)=\{0^i1^j \mid \exists w\in R.|w|=i-j \}$
I need to prove that Sub(R) is context free.
I know that the quotient of a context free language with a regular language is context free
but I can't seem to continue for there..
|
Given a predefined set of phrases, I'd like to perform a search based on user's query. For example, consider the following set of phrases:
index phrase
-----------------------------------------
0 Stack Overflow
1 Math Overflow
2 Super User
3 Webmasters
4 Electrical Engi... |
This seems related to these questions at a glance:
What are some problems which are easily solved by human brain but which would take more time computers?
What would show a human mind is/is not reducible to a Turing machine?
But not quite, I am not asking about "time", but power. Also, I am not interested in the turing... |
I'm reading Wadler's 'Theorems for free'. In section 3.5 he states that $m_{AA}(I_A)$ is a rearranging (i. e. injective) function. $I_A$ is the identity function on the type A.
$$m : \forall X.\forall Y. (X \rightarrow Y) \rightarrow (X^* \rightarrow Y^*)$$
How does he use section 3.4 to prove this without any $\forall... |
I've got these arithmetic expressions
a ::= n | x | a1 + a2 | a1 ? a2 | a1 − a2
which are a part of language.
An undefined element is allowed ⊥ which extends the set of intergers to Z∪{⊥}.
Problem:
I need to define the function
A: Aexp → (State → Z∪{⊥})
by defining equations for each form of the arithmet... |
Suppose $C_1, \ldots, C_m$ are subsets of $\{1, \ldots, n\}$. The goal is to find the smallest subcollection of $C_1, ..., C_m$ such that each element of $\{1, \ldots, n\}$ appears at least $k$ times in this subcollection.
If $k=1$, this is set cover. I would be interested to learn how to prove NP-hardness for $k=2$ a... |
I am trying to see if infinite languages are always decidable. I believe it is not always decidable because there will not be a maximum length of string for the Turing machine to halt. Am I on the right path? I am having difficulty coming up with an example infinite language That is decidable.
|
Question: How many 32 bit integers can be stored in a 16 bit cache line.
Answer: 4
can somebody please explain for me why the answer is 4 i did not understand the reason and i think they should give us more given like the number of blocks in the cache..
|
From Compiling Pattern Matching to Good Decision Trees (Luc Maranget, Proceedings of ML '08, pp. 35–46. ACM, 2008.)
We also consider the usual occurrences. Occurrences are sequences of integers that describe the positions of subterms. More precisely an occurrence is either empty, written $\Lambda$, or is an integer $k... |
Im currently learning about removing left recursion. Ive watched a few youtube clips and understand the basics. For example, i can remove left recursion for the following;
$E \rightarrow E+T \mid T$
Answer
$E \rightarrow TE'$
$E'\rightarrow \varepsilon \mid +TE'$
Ive been given the following question which has sort of ... |
It seems to me that there are two different situations which get called ``PH collapse",
(1) That $\exists i \geq 1$ s.t $\Sigma_i ^p = \Sigma_{i+1}^p$
(2) That $\exists i \geq 1$ s.t $\Sigma_i^p = \Pi_i^p$
Are these two different independent situations?
AFAIK the only natural relation is that $\Sigma_i^p \subseteq... |
The part I want to modify:
B -> F | B A | A
What is the correct way to remove this left recursion?
I was thinking
B -> F R | A R
R -> A R | ε
But I've been told this is incorrect
|
Suppose we have $N$ arrays of pairs, e.g. for $N=3$:
$A_1 = [ [3,2], [4,1], [5,1], [7,1], [7,2], [7,3] ]$,
$A_2 = [ [3,1], [3,2], [4,1], [4,2], [4,3], [5,3], [7,2] ]$ and
$A_3 = [ [4,1], [5,1], [5,2], [7,1] ]$.
We can assume that the pairs in every array are sorted by the first number, and then by the second number. Al... |
How do we solve the weighted interval scheduling problem if given a maximum weight? I understand the solution for the problem when we are simply interested in the maximum weight possible, but how do we solve it when we need to find the maximum weight that cannot exceed a given weight?
Formally:
Given n tasks with start... |
I've got the following definitions:
$$\mathrm{Interleave}\,(x,y) = \{w_1\dots w_n\mid w_i\in\{x_i,y_i\} \text{ for }i=1, \dots, |x|\}$$
when $x$, $y$ and $w$ are words with $|x|=|y|$ and $w_i$ means the $i$-th letter in $w$.
$$\mathrm{Interleave}\,(L_1,L_2)\ \ = \!\!\!\!\bigcup_{\substack{x\in L_1,\ y\in L_2,\\ |x|=|y... |
I am getting ready for my end of year exams and I got stuck on this question.
Consider the following 3-process concurrent program which uses semaphores S1,
Process 1
L1:
P(S3);
print("N");
V(S2);
goto L1;
Process 2
L2:
P(S1)
printf("O");
V(S3);
goto L2;
Process 3
L3:
P(S2);
print("C");
V(S1);
gotoL3;
Are th... |
I'm trying to understand a small proof in an article about computing lumpability on Markov chains. There is a small detail that I cannot understand, i.e. I don't think it follows from the argument.
The article is Simple $O(m\log{n})$ Time Markov Lumping written by Valmari & Franceschinis.
Given a weighted graph they de... |
As a student, back in the day, I was exposed to high level programming languages that not only had a GOTO statement, but on which its use was common. I also did my fair share of programming in assembly code, but always had the impression that my understanding of the semantics of subprograms was enormously facilitated b... |
Intuitively, recall what 3CNF formulas mean:
Its a boolean formula with conjunctive normal form (i.e. formula of ANDs of clauses with ORs) with no more than three variables per conjunct.
I was reading a paper that said:
under a widely believed assumption that refuting random 3CNF formulas is hard, it is impossible to ... |
I have been drawing some binary comparison trees, which correspond to compares made to sort an array, and I was wondering if there is any formula to determine the height of a comparison tree for an array of N values, in Sedgewick's algorithms 4th ed. book for N = 3, the height of a comparison tree is 3.
He draws his c... |
If 'S is a set complement of S, then a set complement of a superset of S' is a subset of S.
Just want to verify that above is true just based on the definition of set complement and superset.
|
Languages like Coq and Agda enforce that their inductive types occur "strictly positively" in their definitions. That is, the type should not occur to the left of an arrow of an argument of a constructor. This is because if no such condition were made the fixed point combinator could be written and the systems would be... |
I am trying to understand the existence of non-recognisable languages. To get this, I need to know why a Turing machine recognises only one language, not multiple. Why is this?
|
Does Kruskal's and Prim's algorithm work on directed graphs? I want the two algorithms to find a minimum spanning tree. For further enlightenment, I would like to know what other problems Kruskal's and Prim's can solve. So far, I only know they can solve minimum spanning trees. If it turns out there are an infinite num... |
This is not an assignment, but it is related to my Data Structures class.
I just wrote this Python code to merge two ordered python lists. I do know that I could do something like this: list1 + list2. I still want to know the answer for my question - it seemed important to my professor that we learn how to write good r... |
Question:
Let $A \subseteq $ {0,1}$^* $ be a language which satisfies $|A \cap ${0,1}$^n|=n^3 $ for all $n\ge 10$ Prove that $A \in NP$ implies $A \in coNP$.
Thoughts
I've been having difficulty with this problem. My idea is somehow showing that each set of $n^3$ words cannot be a verifier for A and therefore A is in ... |
Can a valid Huffman tree be generated if the frequency of words is same for all of them?
Example :
Value | Frequency
--------------------
Google | 2
Yahoo | 2
Microsoft | 2
Amazon | 2
|
I have a problem in algorithm subject.. I have to decide whether 127n^2+n^3−4745n^2 is Ω(n^2) or not. How can I do this? Thanks very much!
|
3 address code is a very common topic in many of the CS theories. I encountered it while studying Compiler Design. According to the Wikipedia article, it says -
Each TAC instruction has at most three operands and is typically a combination of assignment and a binary operator.
Now my query, does that mean I can assig... |
Is the empty set a dominating set?
I don't think it is, because in an empty set there are no vertices to dominate.
Is my reasoning correct?
|
Which algorithm would be suitable for finding or estimating the vector
$$\mathbf{s}_{opt}=\begin{bmatrix}
s_1 & \cdots & s_N
\end{bmatrix}=\arg\max_{\mathbf{s}}\sum_{n=1}^{N}p_{s_n,n}$$
under the constraint
$$\sum_{n=1}^{N}l_{s_n,n}\leq L_{max}$$
given known values for the integer $N$, the vector
$\mathbf{p}_n=\begin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.