instruction stringlengths 35 29.1k |
|---|
Wikipedia here https://en.m.wikipedia.org/wiki/Selection_algorithm shows an algorithm using sort of quicksort.. in order to find Kth largest or smallest element taking O(n) time only on average. The point which is unclear is whether K is required to be constant or at least independent of size of N.
I saw this issue be... |
Assuming that we have the relationship $R(A,B,C,D)$, the tuple $(W,X,Y,NULL)$ and the following functional dependencies:
$$A \to C$$
$$A \to B,D$$
is it possible to insert a tuple with $NULL$ values, without violating the functional dependencies? I understand the definition of functional dependencies but I've never act... |
tl;dr in the analysis for Karger's min-cut, the probability of an edge being in the min-cut in the $j$th iteration, $\frac{k}{0.5k(n-j)}$, neglects the fact that all the edges between the two corresponding supernodes are contracted. What's wrong?
Karger's algorithm for finding the global min-cut in a graph G(V, E), wor... |
I understand that we could draw N * N Omega Network,
But can we draw an Omega Network to connect 6 CPUs to 4 memories? (The number of CPUs does not equal the number of memories)
|
I have encountered a variant of the knapsack problem with shrinking items.
Effectively, it is a 0-1 knapsack problem where the initial weight of each item is $W(n)+V(n)$ and their value is $V(N)$, but immediately after being put into the container the item shrinks by $W(n)$. This means that for every item IN the knapsa... |
I am trying to use the suffix array, and the LCP array to count all distinct substrings of a specified length.
I started with the algorithm for counting ALL distinct substrings. I solved it after this explanation: https://www.geeksforgeeks.org/count-distinct-substrings-string-using-suffix-array/ . The problem right ... |
Offline Problem
I have a graph $\mathcal{G} = (\mathcal{D} \cup \mathcal{A},
\mathcal{E})$. Each edge $e \in \mathcal{E}$ between the two vertex
sets $\mathcal{D}$ and $\mathcal{A}$ has an associated weight $w_e$.
Also, each vertex in $\mathcal{A}$ has a quota $Q$ i.e. each vertex in
$\mathcal{A}$ can match with... |
Lets say there is an reduction in polynomial time from problem A to B, from problem B to C and from problem C to D. Now lets say C is NP hard. Does this mean A,B,D are NP hard as well?
|
I was recently reading an article on Pearson correlation, and OLS coefficients. I came across the following section.
Finally, these are all related to the coefficient in a one-variable
linear regression. For the OLS model yi≈axi with Gaussian noise, whose
MLE is the least-squares problem \begin{align}\arg\min_a \... |
I'm studying sampling techniques in online social networks. The assumption is we don't have full access to the network(i.e, we don’t know the size of the network). However crawling is supported, i.e, starting with any arbitrary node we can access its neighbors. Hence we go for random walk(Markov Chain) based crawling ... |
The problem is to find the typing derivation of a term of the call-by-value STLC extended with reference types. The evaluation and typing rules for this language is given in Types and Programming Languages by Pierce on page 166. The term is
$$
t = (\lambda a:\mathrm{Ref}\mathrm{Bool}. \mathrm{if}\, \mathrm{true}\,\math... |
I have been looking around for a good source to answer the following question.
Have read a few different sources but have not found the answer I was looking for.
The question is:
Give an example of an infinite set of:
a. Regular languages whose union is a regular language
b. Regular languages whose union is a non-reg... |
example:
if we have array of int as 1 2 3
and sum array is given 3,3 we can form this sum as {1,2} and {3}
if the sum array is 5 3 we can not create the sum array, we can for {2,3} but not enough items to form the sum 3.
Can someone help me to understand which algorithm can be used to solve the problem.
|
I'm currently developing an algorithm that solves the vehicle routing problem with time windows and the possibility for clients to be delivered to multiple locations.
Right now, I'm trying to find the shortest path in term of cost for a given order of clients. For the moment, I made an algorithm that labels each locati... |
Why there aren't any famous programming languages that implement what Alan Kay considers to be "real OOP"?
Is it because the "modern OOP" that exists in programming languages like C++ and C# and Java are "better" than "real OOP", or are there other reasons?
|
Is the complement of the following language a regular language?
$$L = \{ x \in \{a,b,c,d\}^* : \exists \text{ prefix }y\text{ of }x\text{ such that }||y|_a - |y|_b|\leq 10 \}$$
My first thought is that it is not a regular language because finite automata can't store the number of $a$ in $x$ and the number of $b$ in $x... |
I think Monte Carlo Tree Search could be used to find the shortest path, but it seems that this method is only used considering win/lose outcomes in the simulation step.
If we consider the path length as the outcome for the simulation step, how would the back propagation work? It seems that one of the nodes along the ... |
For demonstration purposes I was wondering about some very easy to grasp LC abstractions and I came to the idea of a function that simply eats its argument, and nothing more.
If you apply λx. (Yes no lambda term after the point) to an argument the abstraction reduces to nothing.
Although this isn't very useful for com... |
Let $C_h$ be the number of possible heaps for the set of keys $\{1,...,2^h-1\}$. Determine a recurrence relation for $C_h$ via the substitution method and prove it.
Definition
A binary tree is ordered if the key at every node is smaller than the keys at its children.
An ordered binary tree of height $h$ is called a he... |
Prove that the average codeword length in a Huffman tree is $\Omega(\log n)$, where $n$ is the number of characters.
My try:
I think that the worst case is when the tree is full and all the characters are in the highest level.
Therefore: $n=2^h \to h=\log n$, and the average codeword length is $\Omega(\log n)$.
Am I ... |
In a given undirected graph $G(V,E)$, a set of $k$ paths is said to be induced if:
They are vertex-disjoint.
Each one is itself an induced path.
No edge connects two vertices of two different paths.
Given a set of sources $\{s_1,\dots,s_k\}$ and a set of sink $\{t_1,\dots,t_k\}$, a set of $k$ path connecting the give... |
I'm stuck on a problem involving the Gale-Ryser Theorem. The problem's input gives me the row-wise sum of an hv-convex binary matrix(n*m).
e.g. I get {4,3,2,2,1} in the input. It's the row wise sum of the following matrix:
1 1 1 1
1 1 1 0
1 1 0 0
1 1 0 0
1 0 0 0
To solve the problem, I have to fin... |
For a string $w$, $M_w$ denotes the Turing machine whose encoding is $w$.
I want to reduce the language $L=\{w \mid |T(M_w)| \geq 42\}$ to $H_0 = \{w \mid M_w \text{ halts on } \epsilon\}$, but I can't find a way to define an algorithm that halts only if $w \in L$. Either way:
if $w \in L$ I would have to find at lea... |
We are given coordinates of $n$ people and $m$ shops. We should find a matching such that each person is matched with exactly one shop, and one shop is matched with at most one person.The total cost of one matching is sum of all matchings, and for each matching its cost is calculated as Manhattan distance between those... |
I have a complete (every vertex is connected by an edge to every other vertex) undirected positively weighted graph. I want to find vertex-disjoint paths in the graph whose total weight is as large as possible.
To me this sound like a mix of the longest path problem (NP-complete) and minimum spanning tree. Finding th... |
I have a binary mask that originated from a piece-wise smooth curve. Each underlying curve segment is smooth, but connections between segments may or may not be smooth.
The mask is noisy so it might contain several pixels around the underlying curve. Image below shows an example of such input:
I want to estimate a fit... |
"Core language" refers to the exported well-typed terms that can be evaluated (or reduced).
In the core language of MiniAgda, a dependently-typed language, the parameter type of a lambda is not stored anywhere. So does in Mini-TT and Agda.
However, Idris does store lambda parameter type in its core language.
I wonder d... |
$X_{n} = (d^2X_{n-1} + aX_{n-1} + c) \operatorname{mod} m$
Knuth lists out the necessity and sufficiency of 4 conditions (Exercise 8 in page 49 of "The art of computer programming Vol.II"):
$c$ is relatively prime to $m$
$d$ and $a-1$ are both multiples of $p$, for all odd primes $p$ dividing $m$
$d \equiv a-1$(mod 2... |
I was going through binary codes and found out that if the weighted binary code is self complimentary then it's weights addition will be equal to 9. Is the converse true? If not then what are the sufficient conditions for making a weighted binary code self complimentary. My research was in vain. Please help and clear m... |
I have tried to attempt a question where I have to find the number of stages for non-pipelined processor(8085) for below program :-
MOV #40, R00
MOV #50, R01
MOV #60, R02
SUB R02, R01
ADD R02, R01
INC R01
SUB R00, R02
HLT
What will be the no. of stages and there list here?
|
I am trying to write CFG for all strings on {a,b} that contains different numbers of a’s and b’s? After two hours of brainstorming, I came up with this:
S→A|B
A→aE|aA|EA
B→bE|bB|EB
E→aEbE|bEaE|Λ
I tried running few strings on this, it worked, But then I run string "abbab" and it failed.
Kindly someone point out at ... |
It seems pretty obvious that $PSPACE$ is not equal to $DSPACE(2^n) $. Can this be shown using the space hierarchy theorem? Is that the most simple and straight-forward way?
|
I'm looking into the shortest path problem and am wondering how to prove that shortest path with neg. cycles is NP-hard. (Or is it NPC? Is there a way to validate in P time that the path really is shortest?)
How would I reduce the SAT problem into the shortest path problem in polynomial time?
|
How can one describe all languages that are in
$\mathrm{TIME}(n)$?
It can't be all the regular languages only, as for example $L = \{a^n b^nw \mid w \in \Sigma^* \land n \geq 1\}$ is not regular but in $\mathrm{TIME}(n)$. Furthermore there are regular languages (like any modulo languages) that are not in $\mathrm{TIME... |
Please note that I am talking in about theory rather than ''what someone would do in a real, practical situation''.
Given a multi-layer Perceptron with at least 1 hidden layer, and sigmoid (or other non-linearities), and a loss function, let it be a quadratic loss function such as
$L= ||\phi(X,W)-Y_{target} ||_{2}^2$... |
Would this here, a computer sending information directly to another computer, count as 0 hops or 1 hop?
|
Let $$\texttt{EQU}=\{u\#v \mid T(M_u)=T(M_v)\} \\
\texttt{UNI}=\{w \mid T(M_w)= \Sigma^*\}$$
How can you prove $\texttt{EQU} \leq \texttt{UNI}$?
The idea I have so far is, to simulate the TM that decides whether a given $w = u\#v$ is in $\texttt{EQU}$ or not. In case it is, our TM halts and we simply accept everythin... |
I read that breadth-first search has to store (at most) $1+b+b^2+···+b^d$
nodes in memory ---more than depth-first search---, where $d$ is the depth of a solution, and $b$ is the branching factor.
Why isn't it $b^d$?
Why are $1+b+b^2+···+b^{d-1}$ (the previously searched depths) maintained in memory?
If it's a matter ... |
Problem Description:
We consider a 128-byte data cache that is 2-way associative ($E=2$) and can hold 4 doubles in every cache line. A double is assumed to require 8 bytes.
For the below code we assume a cold cache. Further, we consider an array A of 32 doubles that are cache aligned (that is, $A[0]$ is loaded into the... |
Suppose the language is $\{AA^R: A \in \{a,b\}^*\}$.
I know that I can make a context free grammar for it:
$$S\to aSa \mid bSb\mid\epsilon$$
Now if the language was $\{AA^Rcc: A \in \{a,b\}^*\}$, so the same thing but with $cc$ at the end. Would the following context free grammar work?
$$\begin{aligned}
S&\to aS \mid b... |
I've worked through Kadane's and love its elegance. I am worried though, unless asked specifically about arrays and it's obvious that's what's for dinner, I won't know to use it.
What are some real-life problems and applications where this algorithm is key? How would one go about recognizing them in the wild?
|
I am trying to solve the problem to calculate probability to escape the maze and stuck at one use case. Here is the problem statement
The Frog is in an two-dimensional maze represented as a table.
The maze has the following characteristics:
Each cell can be free or can contain an obstacle, an exit, or a
mine.
Any ... |
I need to construct a random code which corrects T errors, has R check bits and has N maximum bits in the transmitting word.
I have researched the topic and found a few theorems about the bounds (The Varshamov-Gilbert bound, for instance). Neither of them suggests an algorithm of how to construct the code.
How do I bu... |
The hash function should be invariant under alpha-renaming. Using de Bruijn notation seems to be possible, but it requires alpha-converting the whole tree when a binding is created, and has the unhappy consequence that a substructure of an abt is not a well-formed abs (since the de Bruijn indices are broken). So, is th... |
Suppose I have two problems: $B$, which is NP-complete, and $A$, of unknown complexity.
Question:
If I show that $B \le A$ I can state that $A$ is also NP-complete because the two required conditions are satisfied: (i) $A$ is in NP; (ii) I reduced a NP-complete problem to $A$.
If I show that $A \le B$ I can say that $... |
Given $L$ and $D$ find $X, \text { such that } X * 10^L + D \equiv 0 \mod M$. Integer $M$ is given and it is the same for all calculations however we need to solve for $X$ for more different numbers. One important thing that we know is that $\gcd(M, 10) = 1$.
I rewrited the equation in this type:
$X * 10^L \equiv M - ... |
I came across an LP with two covering problems, and I wonder how to
find a good approximation. For the relevant part of the LP: We have
a set $E$ , for each $e\in E$ we have a corresponding set $Y_{e}\subseteq E$.
We have some set fixed size sets $U_{k}\subseteq E$ and we look at
this LP
$$
\min\,\sum_{e\in E}x_{e}c(e... |
From my limited understanding, it seems like the structure of problems that multi agent reinforcement learning attempts to attack is quite different from the structure of problems in more traditional areas of machine learning. Is this a correct assessment?
If so, is multi agent reinforcement learning doomed to be releg... |
I am looking for specific applications of the tree decomposition (of a graph), because I want to motivate its existence. What are examples of problems that are more easily solvable using the junction tree of a graph (rather than tackling the problem directly on the graph)? Please, provide also the references to the pap... |
Let $L \subseteq \Sigma^*$ be a regular language. Let $\Sigma' = \Sigma_0 \cup \Sigma_2$ where $\Sigma_0 =\Sigma$ and $\Sigma_2=\{*\}$.
We define $T_L=\{t \in t_{\Sigma'} \mid \text{The leafs from t are from a word in $L$}\}$ as a tree language.
The task is to construct a DTA for $T_L$.
A DTA A over $\Sigma = \Sigma_0 ... |
Given directed graph with non negative weights and vertex s.
I need an algorithm that finds shortest paths from s to all vertices and the paths have to be even.
|
In slide 17 of this lecture note of a course at UC Berkeley, it is said concerning quickselect with median of medians:
If there are repeated elements
We can reduce to the case of no repetitions by considering the
median of the array $a_0'$, $a_1'$, $\cdots$, $a_n'$ where $a_i' = (n + 1)a_i + i$.
The order is preserved... |
Forming a language that is recognizable but not co-recognizable. I'm having trouble coming up with a language with these properties. A recognizable language is a language $A \subseteq \Sigma^*$ iff $A = L(M)$ for some Turing machine $M$.
Co-recognizable is the exact same except the complement of $A$ has to be recogniz... |
I'm having trouble with proving that "Intersection of a recognizable language anda decidable language is decidable.
I assume this is true although I have no idea how to proof it. Can somebody point me in the right direction?
|
We are designing a tournament for a game such as soccer (football) or chess. The tournament is "round robin." By "round robin," we mean that every team gets to play against each other team exactly once. For example, if you are playing, and there are 8 other teams, then you will play exactly 8 matches before the tournam... |
I recently started computer networks with some understanding of algorithms and discrete mathematics. I am completely new. Kindly elaborate following -
data size of ip datagram = 16bits. So with this $2^{16} -1 = 65536$ 16 bit patterns can be generated.
My doubt:
Do we say each 16 bit pattern is 1 IP datagram or all t... |
Consider an undirected graph $G=(V,E)$ and a bijective function $f:V \rightarrow [|V|]$ which orders the vertices by mapping them onto the first $|V|$ natural numbers.
Define the cost of an ordering of a graph to be:
$$\text{cost}(G,f) = \max_{(u,v) \in E} f(u)-f(v)$$
(I refer to $f(u) - f(v)$ in the title as "discrep... |
Could you explain, please, the difference between the nested dissection and kd-tree. For me they look same representing a tree data structure for a distribution of points in a multi-dimensional Euclidean space, but with different labeling of nodes. Is there any more fundamental difference?
I will appreciate a reference... |
A multi-prover interactive proof protocol, as described here, consists of computationally unbound provers $P_1,P_2,\ldots$ which together convince a polynomial-time verifier $V$ of some proposition, under the assumption that the provers can't communicate after some initial setup. Are there practical scenarios in which ... |
It is well-known that an infinite union of regular languages is not necessarily regular, since every language can be written as a union of singletons. What about infinite concatenations?
Let $\{ L_z : z \in \mathbb{Z} \}$ be a family of languages, cofinitely many of which contain $\epsilon$. We can define the infinite ... |
Let each element be an individual. Consider that an individual is defined such that each individual has a time range, weight, and location.
The goal is to group together individuals whose time ranges overlap while ensuring that, within the group, the sum of the weights of the individuals do not exceed a certain thresho... |
Given an array X and array Y both of length n, the pairing algorithm will return the elements of the arrays matched so that the smallest element in X will be matched with the smallest element of Y, the second smallest in X matched with second smallest in Y and so on. i.e the algorithm will yield the pairs: $(x_{1},y_{1... |
A family of binary trees is called balanced if for every tree $t$ in the family the height of $t$ is $O( \log n)$.
Given a family of trees such that for every tree $t$ in the family, for every node $v$ in $t$, the height difference between the right subtree of $v$ and the left subtree of $v$ is at most $c$, where $c$ i... |
Is there an efficient way to compute, given a point, the closest point to it that's on the inside of an intersection of half-spaces?
For example, given the half-spaces a & b, the closest point to p that's "inside" the half-spaces is x. + denotes which side is "inside" the half-spaces a and b.
.p
^
|
... |
My question is similar to this splitting question, but my objective function is different.
Looking for an algorithm to split array of $n$ positive (integer) numbers into $N$ contiguous non-empty subarrays ($N<n$) of approximately same sums:
$$
\min_{\text{splits}} \,(\max_j S_j - \min_j S_j),
$$
where $S_j$ is sum of n... |
How can I solve $$T(n)=T(n-2)+\frac {d}{2}n^2$$
I couldnt find $d$ (dont know if I have to) and after 3 iterations I got to $k= \frac{n-1}{2}$
but had trouble to continue.
|
What are the low level implementation details that make set based operations exponentially faster than iterative processes, like cursors?
At a memory level how does a set operation "touch" the data less than a cursor?
|
I've coded a personal version for the simulated annealing problem, and I was wondering why, (other than by analogy to the physics), the probability is
$$ p = e^{-\dfrac{\Delta \text{length}}{T}}$$ (assuming we're applying to the TSP problem, so the parameter is here the length of the circuit).
Is there any way to expla... |
Wikipedia gives us the following defintion of time complexity:
"In computer science, the time complexity is the computational
complexity that describes the amount of time it takes to run an
algorithm. Time complexity is commonly estimated by counting the
number of elementary operations performed by the algorit... |
I'd like to have a bit more understanding of how, on a circuitry/hardware level, an assembler program works.
I think I have a very broad-brush understanding of how a CPU would process machine code on a hardware level. Please bear with me for this very generalised, hypothetical example:
If you took 00101110 in machine c... |
I need to show this formula is a theorem of propositional calculus. I tried assuming antecedent and proving consequent but didn't work for this proof. Do I need to show it is equivalent to true? How should I start? It's not possible to use truth tables.
$(p \rightarrow q) \rightarrow (p \wedge r \rightarrow q \wedge r)... |
I am facing the most curious situation with [my current information of] transitive closure algorithms. Specifically, is what follows not an algorithm for finding the transitive closure of a graph G(V, E) and is the time complexity not O(|V|+|E|):
Use Kosaraju's to compute SCCs (strongly connected components) -- O(|V| ... |
Assume that $L_1$ is context sensitive language and $L_2$ is context free language, is the language $L_1 * L_2$ context-sensitive or not?
I almost sure that is not, but can't prove it.
|
I am currently working on my Bachelor thesis about Turing Categories (see Introduction to Turing Categories [1]). In this context I got some questions regarding Partial Combinatory Algebras (PCAs), which I want to get out here, as neither of my supervisors could help me.
In Total Maps of Turing Categories [2] necessar... |
Let $T_1,T_2 \subseteq T_\Sigma$ be regular tree languages, f a symbol with arity 2.
To proof: $\{f(t_1,t_2) \mid t_1 \in T_1, t_2 \in T_2\} \subseteq T_{\Sigma \cup \{f\} }$ is regular.
So it's basicaly a tree with f as root and t1 and t2 as left and right children.
My Idea:
I tried to proof regularity by giving a det... |
Given a set of elements $A$ and a probability of noise $p<0.5$. For any two elements $x,y\in A$ we can ask the oracle $O$ to know where $x$ stands w.r.t $y$ (0 means $x$ is smaller than $y$ and 1 means the other way).
The oracle answers correctly with probability $1-p$. The noise is random and independent but persisten... |
I read a comment (I've forgotten the source), "Unification is an implementation of existential quantification." (Emphasis mine.)
If true, this point of view clears up many things.
For instance why omitting the "occurs check" in unification can lead to unsound inference: it would be the same as using the assumption of ... |
I am building a simple interpreter for untyped lambda calculus, currently trying to implement alpha-reduction.
According to this document on LC:
Alpha-reduction is used to modify expressions of the form "λx.M". It renames all the occurrences of x that are free in M to some other variable z that does not occur in M (an... |
Given two numbers, $n$ and $m$, are there some mathematical methods of deducing $m$ from $n$ using limited number of elemantary operations?
Example: 335 can be deduced from 2000 using division by 2, addition of 5 and division by 3: $((2000/2)+5)/3) = 335$.
I need to prove that 1889 can't be derived from 2019 using th... |
Say you have a matrix like this:
[][]int{
{0, 2, 5, 9, 14},
{1, 4, 8, 13, 18},
{3, 7, 12, 17, 21},
{6, 11, 16, 20, 23},
{10, 15, 19, 22, 24},
}
As you can see, it is diagonally ordered
Question:
In Order O(1) if I give you a number N, give me the position i,j.
For example, on a regular ordered mat... |
Related questions:
Can regular languages be Turing complete?
Why are Linearly Bounded Turing Machines more powerful than Finite State Automata?
https://stackoverflow.com/questions/14589346/is-c-context-free-or-context-sensitive
https://softwareengineering.stackexchange.com/questions/132385/what-makes-a-language-turing... |
$L = \{\langle M\rangle\mid \text{M is a TM and }L(M) = \{101\}\}$ meaning M accepts only the string $101$. Which is neither co-recognizable / recognizable. Can be proven easily by $HALT \leq_m L (\text{ or } \bar{L})$ mapping reduction. Reasoning being its very to prove for all TM that none accepts 101 or none rejects... |
Consider an Array $A$ with $n$ values and the following operations:
get(i): Returns the value of $A[i]$
insert (x): Insert the element x into the any free place in A (not necessarily in $A[x]$ or the end of the array)
delete (x) delete the element $A[x]$
What is the best known (amortized) time complexity of all opera... |
Given a set of $n$ people and $m$ friendship relations between those people (relation is between two persons) we need to suggest a data structure that supports the division of those people into maximum groups such that if 2 people are connected, they belong to the same group.
Asking $k$ queries, where each query is ask... |
I've been searching around for definitions of intractability, and I realized that despite being widely used, the concept of intractability (when talking about computing problems of course) is not formally defined.
I'm currently writing a report in which I characterize some problems as intractable (in my context, they... |
I'm debating with a friend whether a particular function I wrote is $O(N^3)$ or $O(N \times M \times X)$
I believe it is the latter since all 3 variables differ in size. $N = 100, M = 50, X = 10000$
for i in range(len(N)):
for j in range(len(M)):
for p in range(len(X)):
if statement:
count += 1
... |
I'm looking for a single or a conjunction of data structures that can find the kth smallest element in constant time, delete the kth smallest element in logarithmic time, and add a new element in logarithmic time. The closest I've found to this is the order statistic tree which achieves logarithmic add and delete opera... |
We are given two permutations: A of size N and B of size M. We need to process Q queries, each query is given by two ranges, one subarray range in permutation A and one in B. We should check if there is at least one same number in those two ranges.
We don't need to answer the queries online, so we can sort them in diff... |
I was working on a problem about geometric medians and I had an idea for a divide and conquer solution, but it would only work if a set of points, when split into two disjoint sets, and those sets respective geometric medians calculated and a line passed between, it holds that the geometric median of the overall set of... |
I am trying to solve this question. The question is a variation of job scheduling. There are n processes given to you with their execution time Ti and individual deadlines Di. A process can be executed anytime before its deadline. A process can not be executed after its deadline is over. So, you have to find the maximu... |
For a hypergraph, I want to know the computational complexity of this step in my algorithm what is the computational complexity of this kind of sorting
Sort the hyperedges in descending order based on the number of common vertices with other hyperedges
I implement this step by calculating the degree of each vertex (the... |
The following problem seems very similar to the $stCON$ decision problem:
{$G, s,t | G = (V, E)$ such as $V$ is a graph, $s,t ∈ V$,
there exists in $G$ a simple path from $s$ to $t$ of length $≥ n/2$}
But from what I've read, it cannot be placed in $NL$. The reason is unclear. Why it cannot be placed in $NL$ using a... |
per this post
$t = x^2$ means the problem is solvable in "Polynomial" time.
per this post
in the form
$$a_{n}x^{n}+a_{n-1}x^{n-1}+\dotsb +a_{2}x^{2}+a_{1}x+a_{0} {
> \boldsymbol{=0}}$$
plug in $n=100000000000$ with $a_n=1$ and $a_k=0$ for all $k \neq n$
then we see that $x^{100000000000}$ is a polynomial
it doesn'... |
Confused about a question regarding flow networks.
Question is: Given the network below, what is the current value of flow in this network?
Does the current flow of a network refer to the maximum flow or something else?
|
I know that the Knapsack problem is weakly NP-complete. I also notice that on Wikipedia:
"A problem is said to be strongly NP-hard if a strongly NP-complete problem has a polynomial reduction to it [...]"
The way I prove the NP-hardness is by a reduction chain: SAT $\leq$ 3SAT $\leq$ Tripartite Matching $\leq$ Exact ... |
Consider that I've a mathematical equation of the form:
$$ (6+4\times x)\text{ } mod\text{ } 22 = 0 $$
How can I solve this modular equation by using a program, efficiently? By trial and error, one can infer that the answer is $x=4,15,26,...$. But how can I solve this programmatically?
I can not use a binary search h... |
I have a graph of nodes that reflect resource allocation. Each node has a weight to reflect this. A well formed graph is disjoint, so there will be no edges, and the weight of the graph is just the sum of the nodes. Any graph that contains edges needs to be reduced by removing one of the two nodes on an edge, until all... |
There's a number of algorithms that operate by maintaining and consuming a priority queue of "events". I'm thinking primarily of geometric algorithms, particularly sweep-line algorithms like Bentley-Ottmann and Fortune's algorithm, but also things like Dijkstra's algorithm and Prim's algorithm.
There's no trivial way ... |
It is shown in the paper: "Classic Nintendo Games are (Computationally) Hard" by Greg Aloupis, Erik D. Demaine, Alan Guo, and Giovanni Viglietta that the Generalized Super Mario Bros. (SMB, for short) video game is NP-hard.
Theorem 3.1. It is NP-hard to decide whether the goal is reachable from the start of a stage i... |
How can I write a regular expression that denotes language on the alphabet {a,b} of the strings that do not present "b" consecutive and the total number of "a" is multiple of three?.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.