instruction stringlengths 35 29.1k |
|---|
In books, I have read that FCFS suffers from convoy effect. I think that even SJF and priority(both preemptive and non preemptive) can suffer from convoy effect.
In SJF, if a process with large burst time arrives first then no other process can preempt it causing convoy effect.
In preemptive and non preemptive priority... |
$\mathsf{DFS(G, u) \text{}}$, $G = (V,E)$
Input : A Directed graph $G$ and a source vertex $u$.
Find : Is $v$ reachable from vertex $u$ for all $v \in V$ ?
Model of computation : Word RAM , one can represent a vector $A[1,\cdots ,n]$ of elements from a finite alphabet $\Sigma$ using $n \lg |\Sigma| + O(\lg^2 n)$ bits... |
I tried to solve this exercise:
Discuss the normal forms (CNF or GNF) of a grammar with productions:
$S\rightarrow BC | CB$
$B\rightarrow cB | c$
$C\rightarrow cC | \epsilon$
Same request with the following grammar:
$S\rightarrow BC | CB$
$B\rightarrow cB | c$
$C\rightarrow cC | c$
I applied the rules to convert a gra... |
PIVT cache is indexed physically so address translation using TLB is needed to get into cache and we use virtual address as the tag for comparison .
I read that homonym is a problem which is caused when same VA maps to 2 different physical addresses and PIVT suffers from homonym.
Source :- https://stackoverflow.com/qu... |
So merge sort is a divide and conquer algorithm. While I was looking at the above diagram, I was thinking if it was possible to basically bypass all the divide steps.
If you iterated over the original array while jumping by two, you could get the elements at at index i and i+1 and put them into their own sorted arrays... |
I'm reading side by side my class notes and Papadimitrious' Computational Complexity book. At this point they are talking about space complexity. They give rules for computing space employed in an algorithm that runs on a multi-tape Turing machine:
We count the cells used.
If we don't write in the input, this cells do... |
Input: amount of variables (with minimum of $10$ since otherwise problem is unsolvable).
Output: unsatisfiable formula.
Restrictions:
Every clause contains exactly 3 variables.
Every clause differs by at least one variable. For example, a pair of clauses $(x\lor y\lor z)\land(x\lor \overline y\lor\overline z)$ is for... |
I am trying to implement a fast SVD algorithm for obtaining the first $k$ singular values/vectors of an $M\times N$ matrix ($k < \min(M,N)$) using the following 2-step process:
1) bidiagonalize the matrix using Lanczos bidiagonalization (e.g. R. M. Larsen, 1998)
2) diagonalize the bidiagonal matrix via QR decomposition... |
An elegant program for a bitstring is the shortest program on a universal Turing machine that outputs this bitstring. According to Kolmogorov complexity, the length of the elegant program is independent of the Turing machine implementation.
Solomonoff induction uses the elegant program for a bitstring to predict the n... |
Is the language $A$ decidable ? Please help me get the proof right !!
$A = \{ \langle M \rangle | M \text{ is } TM \text{ such that } L(M) \neq \Sigma^* \}$
My proof is by contradiction. Assume $A$ is decidable and let $R$ be decider for it. I will construct decider $S$ for $A_{tm}$, using $R$ as a subroutine.
S = ... |
Using three valued logic one can define a multitude of ternary operations. When dealing with 5:3:1[1] operations, its very easy to see how OR and AND work, but I'm confused as to how ternary BUT is supposed to be useful. As mentioned here in TriINTERCAL's[4] docs the truth table for ternary BUT is as follows:
BUT(True... |
I have implemented three algorithms codes, in Swift:
1- Polynomial coefficient:
// create polynomial
func arrangePoly(ofTerms term: Int, toLength len: Int) -> [Int] {
var a = Array(repeating: 0, count: len+1)
for i in stride(from: 0, to: a.count, by: term) {
a[i] = 1
}
return a
}
// polynomial... |
For words of the same length $u = u_1..u_n, v = v_1..v_n$ over an alphabet $A$ let $$u \circ v = u_1v_1...u_nv_n$$
Prove that if $L$ over $A \times A$ in in LOGSPACE then $$L' = \{uv : u \circ v \in L\}$$
is also in LOGSPACE
My solution:
We try to log-reduce $L'$ to $L$. So, I mean when a machine $M_L$ tries to read an... |
Prove that following problem is complete in NP in sense of Karp.
Given: context free grammar $G$
Check if $G$ generates word containing
all symbols from alphabet
Remark
Above problem should be encoded as langauge over finite alphabet, although alphabet of $G$ can be arbitrarily big. You can assume that symbols of thi... |
From my understanding a problem is considered to be in NP time if it can be solved in polynomial time with a non-deterministic Turing machine and verified in polynomial time with a certificate.
My question is whether or not creating an algorithm to determine values accepted by a certificate for an NP problem can itself... |
Let $a\uparrow^{n} b $ denote the indexed version of Knuth's up-arrow notation ($a \uparrow\uparrow \dots \uparrow b$ with $n$ arrows), with $a, b, n$ positive integers.
Is there a generalized algorithm to compute $a\uparrow^{n} b$ modulo a prime efficiently? How does the complexity of such an algorithm depend on $n$? ... |
Formally show that $0.1n + 10\sqrt{n}$ is not $O(\sqrt{n})$ using the definition of $O$ only.
I cannot find much on how to solve a problem like this, nor do i know how. Am I supposed to show some contradiction by trying to prove it is $O(\sqrt{n})$? Any help on how to answer this would be appreciated.
This is about me... |
Apologies for this edit (8.13). I encourage those interested in the math side of this variant to view the MathOverflow post mentioned below, and contact me at that forum. This version is an attempt to find a CS reference.
I am researching mathematical properties of a variant of the sieve of Eratosthenes. Has anyone ... |
I have some issue but I can't identify a way to solve it. I wanted to ask you what kind of problem it is?
We have a resource - contiguous computer memory. Also we have users which require some contiguous piece of memory during a period of deterministic time.
In example,
User1 uses 2 bytes from 3rd to 5th iterations (i... |
Resolution allows to generate new clauses for an existing set of clauses.
In many cases, the rule is simple:
{ a, b } { -a, b }
----------------------
{ b }
But what if the clauses contain multiple literals suitable for resolution?
{ a, b } { -a, -b }
-----------------------
{ ? }
If we choose... |
A minimal unsatisfiable partial assignment for 3-CNF is a partial assignment that:
There exists a clause where all variables are unsatisfied.
Unfixing any variable makes every clause contain at least one free variable.
Particularly for 2-SAT and 3-SAT is their number bounded by polynomial?
If yes, then how can the nu... |
Dynamic Programming C/C++ implementation of LIS(Longest Increasing Subsequence) problem
/* lis() returns the length of the longest increasing
subsequence in arr[] of size n */
int lis( int arr[], int n )
{
int *lis, i, j, max = 0;
lis = (int*) malloc ( sizeof( int ) * n );
/* Initialize LIS values for all indexes */
... |
I read an example that said explain what "$f(n)$ is $n^{O(1)}$" means.
I can't interpret the $n^{O(1)}$ syntax. I know what Big $O$ notation is, its just that this example looks odd to me.
|
I just learned about Gibbs Sampling which is an MCMC method. Given a distribution $\pi$, we want to sample an item according to $\pi$.
Maybe my alternative suggestion would sound somewhat naive (even stupid) but why can't we just draw a number in random from $[0,M]$ for some sufficiently large enough $M$. Then, we divi... |
Classical computer always requires no matter what $\Theta(n)$ time to compute the sum of $n$ natural numbers, but can quantum computer do that in $\Theta(\log n)$ time?
Given that $a$ is an infinite sequence of natural numbers defined either iteratively or recursively by some math formula and $a_i$ is an arbitrary natu... |
If the complexity of an arbitrary algorithm to solve any NP problem after analysis is $\Theta(2^\sqrt{n})$ then is this algorithm considered as "good" and practical algorithm?
I know that in algorithm analysis and computational complexity theory every algorithm with any polynomial complexity is considered as "good" and... |
I have $n$ points that form a grid with empty space and I need to find an algorithm that would calculate the total distance of those points with time complexity lower than $O(n^2)$.
An example of a grid with $n=5$ would be the following set of points:
$(1,0)$, $(0,1)$, $(2,0)$, $(2,1)$, $(2,2)$. As you can see their $x... |
Prove that problem $A$ is complete in $P$ due to reductions
computed in logarythmic space
How to understand this statement ? What should be shown ? For me:
1. $A$ is in $P$.
2. Each problem in $P$ can be reduced in logspace to $A$
Can I use transitivity of logspace in this exercise ?
|
Given a large graph $G=(V,E)$, a set of nodes $S\subseteq V$, the problem is finding the $k$-nearest nodes in $V$ to the nodes in $S$.
Given a pair of nodes $(u,v)$, the distance $d(u,v)$ between $u$ and $v$ is defined as the length of the shortest path between them. Hence, the lower the distance is, the closer two nod... |
Consider two algorithms; we analysis their run time only by counting the number of comparisons
TwoMax1(A):
S = negative infinite
L = negative infinite
loop through the array A
if A[i] > L:
S = L
L = A[i]
else
if A[i] > S
S = A[i]
... |
Let $X,Y$ be two random variables over a discrete probability space, such that $X \in [0,1]$ and $Y \in [0,1]$. I want to prove that $$ |\text{Cov}[X,Y]| \leq \sqrt{0.5 \; I[X,Y]}$$ where $I[]$ is the mutual information of the variables. Is there an "elegant" way to prove that? Some smart argument rather than techni... |
Some programm should allow users to identify the word language probability. All i have is some statistics - the frequency of using bigrams and trigrams in most of texts of some languages.
Totally i have
Top English bigrams Top Spanish bigrams ...
th de ...
he ... |
In his famous paper, Turing briefly describes his machine and then states (p. 232) (emphasis mine):
It is my contention that these operations include all those which are
used in the computation of a number. The defence of this contention
will be easier when the theory of the machines is familiar to the
reader.... |
My professor asked this question in his lecture class and I can't figure out the answer.
My guess is BCD because you can't use up all the numbers (10 to 15), so you eat up space?
|
I am reading CPDAG, can anyone please explain why G1 and G3 are not equivalence classes as in the picture below?
Thank you very much!
according to https://www.cs.cmu.edu/afs/cs/project/jair/pub/volume18/acid03a-html/node2.html .
"Theorem 1 [59] Two DAGs are equivalent if and only if they have the
same skeleton and t... |
I recently came across an issue where my compiler was not able to eliminate some "obviously" dead code - it was a function that returned nothing, with no side effects, and a cursory analysis of the code revealed that it would obviously terminate.
Investigating this further, I found it was extremely easy to write very s... |
Theorem. Let none of the assignments of length $\log n$ make a set of unsatisfiable 2-clauses. Then formula is satisfiable.
$n$ is input length here.
Let we name an assignment that make the formula to contain unsatisfiable 2-SAT contradictive.
This allows us to find all minimal contradictive assignments in $O(n^{\log n... |
I am studying for my exam in Distributed Systems course. And i have one question that i do not really understand. This is the question:
Is sequential consistency compositional? if yes explain why, if no give an example.
Now this is the only two slides that we have that explains why it is not composable.
And i am havin... |
I conisder a problem:
It is given a graph $G$, vertices $s,t$, $k$- length of the graph. Prove that decision whether there is a path between $s$ and $t$ of length $k$ is NP-complete.
Please note that in our problem we have a path, not a **simple path* **
*It is trivial when we have a simple path (define as sequence o... |
I wanted to know something about selection and Time complexity,
for example if I had the f.f.g java code:
public List<String> sort(int n, List<String> ob){
if(n == 1){
return binarySort(ob)
else{
return selectionSort(ob)
}
I know this is a weird example but I feel it should help me understand what to do when... |
Assume I have a word document, the contents in it are stored on the disk as bits. Nothing so complex here. When the word processor reads those bits, it just knows how to display on screen.
But what about binary trees. They are just not data, they have route node, child nodes. How are they actually represented on disk?
... |
A procedure by induction to get maximum spanning bipartite graph (same vertex set as $G$ and the maximum possible number of edges) from given graph $G$:
Given a planar graph $G$, we need two disjoint sets $V_1$ and $V_2$. We define $V_2=V \setminus V_1$ where $V = V(G)$. In the following, $H$ is the bipartite subgraph ... |
Many inapproximability factors are $2^{n^\epsilon}$. I don't know why this is 2 instead of 3, 4, ..., etc.
To be precise, given a problem,
theorem 1 says: It's NP-hard to approximate the problem to $2^{n^\epsilon}$ for any $0 \leq \epsilon < 1$;
theorem 2 says: It's NP-hard to approximate the problem to $3^{n^\delta}$... |
I'm reading the book Introduction to Algorithms and in Chapter 3 it is said that if $f(n)$ and $g(n)$ are asymptotically positive then
$$
f(n) = O(g(n)) \text{ and } g(n) = O(h(n)) \text{ implies } f(n) = O(h(n))
$$
However, I don't see why this wouldn't also be valid if you just required $f(n)$ and $g(n)$ to be asympt... |
How to find the minimum (or close to minimum) cost path that visits a subset of nodes within a graph? What algorithms can I use?
I googled and found: http://lcm.csa.iisc.ernet.in/dsa/node181.html
But the problem doesn't look like a minimum-cost spanning trees.
This is because the subset of nodes that I want to visit is... |
I am interested in algorithms that construct continuous curves between two points in such a way that minimizes an energy functional of the curve. What sort of algorithms are most used for such tasks?
More formally, given two points $a$ and $b$, and energy functional $E(C)$, where $C$ is a curve such that $C(0)=a$ and $... |
I have this dataset, and I am using y = (a * x^n) / (b + x^n) Hill function as the model, where a is the limit of the Hill curve, b is the point at which a/2 is reached (for n = 1) and n is the cooperativity or steepness of the curve.
Currently, I am storing all x,y values and computing the parameters a,b,n using black... |
Currently, i working with LDPC for FPGA implementation. I have formed H matrix of size 102X204 (N=204,K=102,M=102,R=0.5). Doubt in Error detection and correction for bigger matrix.
I know that code's error detecting and correcting capability depends on its DISTANCE. For example distance is say 10, then i can correct m... |
I'm rather new to computers and how they work in the microscopic scale, but here's the little bit that I know.
Computers have lots of transistors in them, both in memory and processor, and each transistor has two states, on and off. They are translated to binary equivalents 0 and 1. All data is stored in computers as ... |
For language $M \subset \{0, 1\}^*$ lets denote $And(M) = \#(M\#)^*$ and
$Or(M)=\#\{0,1,\#\}^*\#M\#\{0,1,\#\}^*\#$. We can say that language
has $AND$ ($OR$) property with respect to polynomial
reductions if there exists polynomial reduction from $AND(M)$$(OR(M))$ to
$M$.
Show that each language in $P$ has both prop... |
For $f : V → V$ which is authomorphism of directed graph $G = (V, E)$,
$$\#f = |\{v : f(v) \neq v\}|$$ For graph $G$ we denote: $$\#G =
\max\{\#f : \text{$f$ is isomorphism $G$} \}$$
Prove that if $P = NP$ then function $G\to\#G$ is polynomially
computable.
My problem is that I can't think about isomorphisms.... |
I am trying to calculate the speedup of this, but I am getting the wrong answer:
Assuming that we have a program where we have two execution phases. One phase takes 1 time unit to execute and can only execute sequentially. The other phase takes 3 times units to execute sequentially but can be perfectly parallelized. W... |
This is a problem from a MOOC on computer networking:
We wish to send a message of size $150,000$ bytes over the network. There are four hops, each of length $20$ km and running at $100$ Mb/s. However, before sending we split the message into $1500$ byte packets. What is the end-to-end delay of the message? Use speed ... |
I am using Kruskal's algorithm to build minimum-spanning-trees. I would like to know, given that my total set of edges has size N, if there is a bounding number of edges in the resulting MST, i.e. a size M smaller than N that determines the maximum number of edges in the MST. Or otherwise, if in general no such bounds ... |
I am trying to solve the following recurrence relation :-
$T(n) = T(\sqrt{n}) + n$ using masters theorem.
We can substitute $n = 2 ^ m$
$T(2^m) = T(2 ^ {\frac{m}{2}}) + 2^m$
Now we can rewrite it as
$S(m) = S(\frac{m}{2}) + m$
The big $O$-notation for $S(m)$ will be $O(m)$.
Hence, $T(n) = T(2^m) = S(m) = O(m)$.
So we c... |
Suppose the round trip propagation delay for a 10 Mbps Ethernet having 48-bit jamming signal is 46.4 μs. The minimum frame size is:
a) 94
b) 416
c) 464
d) 512
My approach:- I have read in the book that minimum frame transmission time is atleast twice the round trip time.So by that logic i can say that the answer will b... |
I am referring to this video https://www.youtube.com/watch?v=vgELyZ9LXX4 at 1:08:39 .
$n$ : number of nodes in the tree
$Z_{n,k}$ : Indicator random variable that activates when rank of the root is k
$X_n$ : random variable denoting height of BST
$Y_n$ : random variable denoting $2^{X_n}$
In the video, it is said tha... |
Let $f(n) = (\log n)^n$
and $g(n) = n^2$
By taking a large value, I could make out that $f(n) > g(n)$ .
I want to know if $f(n) \in \Theta(n^2)$ . For proving this, I need to find out the value of $c$ such that
$f(n) \le c \cdot g(n)$ .
How do I find the value of $c$ ? By seeing the function it seems like no $c$ e... |
There is a non-regular language that exists the pumping lemma for regular language?
I didn't find one.
Edit:
From what i understood the pumping lemma does not prove that it is a regular language becuse there are non regular languages that "support" the pumping lemma.
Thanks.
|
Here we see a very interesting attempt to show that $\mathrm{P} \ne \mathrm{NP}$ by Norbert Blum.
Here we see 116 previous attempts at solving P vs. NP.
Here we see the P vs NP problem defined as:
The informal term quickly, used above, means the existence of an algorithm solving the task that runs in polynomial time... |
According to this description of Python's method resolution order (mro), a.k.a. C3 linearization, the algorithm can be described recursively as follows:
L(O) = <O>
L(C) = <C> + merge(L(B1),..., L(Bn), <B1,...,Bn>)
where
O is the class from which every class inherits.
C is a class that inherits directly from B1, ..., ... |
How can I prove this. what is the way? im up to the second last line. and i dont actually know how can x * (1 + y) then the y just disappears into x * 1.
x + x * y = x
x + x * y = (x * 1) + (x * y)
= x * (1 + y)
= x * 1 [THIS LINE]
= x
thanks
|
It is listed as such in wiki, however my literature never refers to it as such.
My gut tells me to follow papers and monographs on the matter, but my concern is that I will make an easily avoidable mistake, or that I simply misunderstood the text.
|
Prove that for each arbitrary set of natural numbers $A$ we have:
$$\{bin(n) | n\in A\} \in BPP \to \{0^n|n\in A\}\in QP$$ where $bin
(n)$ is binary representation of $n$ $$QP = \bigcup_{c\in \mathbb{N}}
DTIME\left(2^{(\log n)^c}\right) $$
I have no idea how to move from probablistic machines to non-probablisiti... |
Ok, the proof is clear. But, if we prove that $BPP \subseteq EXP$ we should show that for every machin in $BPP$ there exists equivalent machine in $EXP$. I cannot see how the $EXP$-machine is equivalent.
If we run machine $A$ on $x$ it can accept a word $x$ with probability $0.5$. Now we can run our $EXP$-machine. I... |
I'm looking to shuffle a list of the elements $a_1,\dots, a_6, \dots, e_1, \dots, e_6$
while keeping two rules:
if I loop though the list and filter out a specific letter or number it should be in order:
$a_1, a_2, a_3 \dots$ or $a_1, b_1, c_1 \dots$
How can I shuffle the list keeping these rules? I'm using python, so ... |
Imagine the following sets :
A = Set( sortedSet(1,2,3), sortedSet(4,8))
B = Set( sortedSet(3,4), sortedSet(5,6,7) )
Where each inner list represent a cluster composed by indexed dots (1,2,3...).
I want to gather cluster sharing the dots sharing the same index into one to get :
Set( sortedSet(1,2,3,4,8), sortedSet(5,6,... |
I have a brief proof about QBF being $\in$ APTIME, which claims that you can use the additional input of the alternation as values for your QBF formula.
And therefore you can accept, if the quantifier less formula $\psi$ is true, given the additional input.
That makes sense, but if you assume $\psi$ in 3-CNF. I could m... |
I am unable to understand why unbalanced partitions in quicksort is actually worse than balanced partitions.
After reading this document it shows that worse case partitions are of the type $(0,(n-1)), (0,(n-2)), (0,(n-3))$ and so on. So the work on every step is $Cn, C(n-1), C(n-2)$ , it actually decreases since $C(n) ... |
I have a question regarding no-regret algorithms (of online learning). As far as I can see, such algorithms allow the absolute regret up to round $n$, which is $R_n$, to grow by $\sqrt{n}$. So, in the limit, the per round regret ($R_n/n$) approximates $0$. Which makes it a no-regret algorithm. The problem is that I can... |
I am a Computer Science student and I study Data Compression now. I read many methods but Golomb-Rice Encoding was not clear for me. I understand the method how it works but in the algorithm there is 'Tunable parameter $M$' that operates with the number that you want to encode. My question is how can I decide what val... |
This question is purely theoretical as I've not been able to find anyone who's done such a thing, so my question is - is it possible, and if not why?
Say you have a short video (CCTV) of a face, or number (car licence) plate, and that video is of too poor quality to discern who that person is or what the number plate s... |
I am interested in data structures that support efficient searching of various kinds.
When I read the Wikipedia page of "search data structure", it says "Useful search data structures allow faster retrieval; however, they are limited to queries of some specific kind". So, obviously, there exists a correlation of one s... |
I've read several sources of information that describe the process of Bayesian Monte Carlo Quadrature but am just not understanding the details enough to be able to implement it.
For instance two sources:
http://mlg.eng.cam.ac.uk/zoubin/papers/RasGha03.pdf
https://www.cs.toronto.edu/~duvenaud/talks/intro_bq.pdf
I get... |
This is a real situation (I hope it's ok that I post this here. If not, please suggest a better home). I have little knowledge of algorithms, but I know I can use one to solve this problem.
I'm looking for an answer, or an online resource that can help, or an algorithm I should research to help me find the route with t... |
Prove that $L$ is closed under Kleene star iff $L=NL$
Hi,
I am trying to solve this exercise, but it is quiet difficult.
Of course first part is very easy:
Let assume that $L=NL$. Lets consider language $A\in L$. We show that also $A^*\in L$. It is easy because we can guess partition of word $w=w_1w_2..w_k$ and lau... |
Could someone explain to me what component(s) are responsible for translating binary into ASCII/UNICODE? For example, is it an assembly program that sets up a 1-1 correspondence between characters and their binary equivalents, which is then loaded into ROM during manufacturing?
|
All tutorials on algorithms show the complexity for the linear search in the unsorted array in the average case as N/2. I understand that the average case means the items in the list are randomly distributed.
Can anyone show how I would arrive at N/2 if I have items randomly distributed? Or does it come out of randoml... |
This solution comes from https://people.eecs.berkeley.edu/~luca/cs172-07/solutions/practicefinal-sol.pdf
Consider the language
$$ EQ_{NFA} = \{ \langle N, N^\prime \rangle \mid N, N^\prime \text{ are NFA's with the same alphabet and } L(N) = L(N^\prime) \} $$ show
that $EQ_{NFA} \in \textbf{PSPACE}$.
(hint: Can you ... |
I am running several machine learning classifiers to predict something from my data. If I visualized the precision and recall tables as a result, is it enough to get clear idea about the proposed mdel? or do I have to consider the accuracy table in order to cover the issue?
I am running 3 different classifiers (svm, pe... |
A set $S$ of natural numbers is Recursively Enumerable if there exists a Turing machine which enumerates them, i.e. given no input, outputs the elements of $S$ in increasing order (never halting if $S$ is infinite).
Now, suppose my set has a different kind of machine: Instead of enumerating the set, it takes an intege... |
There are given:
alphabet $Σ$ with some symbols $a,b$.
list of forbidden patterns
Result: Is there exists word of form $a\Sigma^*b$ such that it doesn't contains (as subword) any of word from
list (list contains many words, expressed by patterns). Show that
this problem is in $PSPACE$.
Example to better understa... |
From what I understand, natural language are too complicated to be generated by a context-free grammar, yet parsing a context-sensitive grammar is too computationally demanding for our brain to be continuously performing. So it seems that if our brain indeed has a "syntax" module to parse sentences as Chomsky claims it... |
I have a set of items. For each item, there is a list of buyers I can sell it to and a corresponding price they will pay me. For example:
item1: item2: item3: item4:
john: 17 john: 19 bob: 42 ...
bob: 23 mick: 22 mick: 44
sue: 19 liz: 24 sue: 38
liz: 20... |
I have a directed graph created in matlab. I am trying to print all paths from root to leaves. I used stack to implement my algorithm but it seems very slow when I have large number of nodes and edges.
Is it possible to solve this problem in O(nlogn) time ?
%This is my graph:
output =
edges: {[0 1] [0 2] [1 3] [... |
Fiorini, Massar, Pokutta, Tiwary and De Wolf (Exponential Lower Bounds for Polytopes in Combinatorial
Optimization, Journal of the ACM 62(2):article 17, 2015; PDF, ArXiv) show any linear program that solves travelling salesman needs super-polynomially many constraints.
Suppose $P=NP$ by 'some' method then we can solve ... |
Let us assume I have a Program P running on remote computer generating output O. Without trusting the remote environment and not having to verify the output O, is there is a way to validate that Program P has indeed been executed and resulted in output O ?
Let me know if the question is too vague. I will clarify.
|
Please help me to prove:
If $f, g ∶ \mathbb{N} \rightarrow \mathbb{N}$ and $f$ and $g$ are increasing $(f(n+1)>f(n),g(n+1)>g(n)$).
Need to prove $g=O(f)$ or $f=O(g)$.
Thanks
|
I need to do a weighted matching between two sets (say students and professors). The set of students is much larger than set of professors. So multiple students can be matched to professors. However, each professor also has a minimum number of students he needs. So even though all students maybe matched best with one p... |
I have a graph $G=(V,E)$ that consists of many disconnected directed subgraphs, some of them may be cyclic. (Basically a "forest" consisting of directed trees and some directed disconnected cyclic graphs added into it).
I want to find all of these disconnected subgraphs and turn them into stars given by the key of the... |
Theorem states that every problem in $\mathsf{NP}$ can be reduced to another $\mathsf{NP}$-complete problem in polynomial time. Also you can only make a problem polynomially longer using polynomial time.
Thus SAT of length $n$ can be reduced to knapsack with length $n^k$ for some fixed $k\in\mathbb{R}^+$. We don't need... |
Does every 3CNF propositional formula has an equivalent 2CNF propositional formula?
Definitions:
3CNF propositional formula is conjunctive normal form propositional formula, which is just conjunction $\land$ of clauses, where each clause is disjunction $\lor$ of at most 3 literals, where each literal is just boolean va... |
Are out there, any programming languages that are not defined algorithmically so that we can call them "constructed languages" but not "formal languages"? Are there any discussions or papers on that topic? It seems pretty hard to develop a compiler for this kind of languages.
|
In the best case of quicksort the depth of the call stack is measured by $\lceil\log_2 n\rceil$ if I am not wrong. What would be the formula for calculating the depth of the call stack in case of an average case of quick sort, for lets say the partitions are always broken using the ration 1:9 or 1:4 every time.
How wo... |
$$L=\{\langle G\rangle \#\langle H\rangle : H, G \text{ are directed isomorphic graphs }\}$$
$\langle G\rangle$ is adjacency matrix written row by row.
Show that if $L\in BPP$ then also $L\in RP$.
Can you help me ?
I have no idea how to do it.
|
Let $G = (V, E)$ be a digraph, and consider the set $\left\{ v \in V \; \middle| \; \left(\{v\} \times V \right) \cap E \neq \varnothing \right\}$, the set of vertices which form edges with other vertices; or if you will, the set of "heads of edges".
Is there a commonly-used term for this set?
|
I use a very simple neural network to make classification between classes. Once my ANN is trained I'm able to present new and unknown data, and get a good classification.
Is there a simple way to reverse the process and create an artificial data, knowing at which class it should belong ?
What would be the method name... |
This is related to the issue asked about in this other question.
For the sake of this question, let's assume that we have a variable v that can have any value from the set of values
"a", "b", "c", ..., "z"
In this case then the programmers wants to have specific code executed when the value of v is not "x", "y", or "... |
What is the relation of complexity class $L^L$ to other complexity classes?
(Here $L^L$ is the complexity class of decision problems solvable by a TM in logspace with an oracle for a language in logspace.)
|
Does every 3CNF propositional formula has an equisatisfiable 2CNF propositional formula?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.