instruction stringlengths 35 29.1k |
|---|
Let's say I have a set of non-repeating arcs, e.g. (0,1), (3,0), (0,3), (1,2), (2,3), ("set" because they don't repeat).
Here's an example of a graph for which this series of arcs would form a valid path:
And a valid path would be (0,1), (1,2), (2,3), (3,0), (0,3).
Note that the path might not be unique (and that's ... |
The combinatorial number system shows that there is a bijection between the natural numbers less than $n \choose k$ and $n\choose k$ combinations. There is a greedy algorithm for unranking combinations, which one may calculate the worst-case run time for. I'm curious: is this the fastest algorithm in terms of asymptoti... |
In the counting number of islands problem, I noticed that one of the solution from internet is as follows
def visitIslandDFS(grid, i, j):
if (i < 0 or i >= len(grid) or j < 0 or j >= len(grid[0])):
return # return, if it is not a valid cell
if (grid[i][j] == '0'):
return # return, if it is a... |
As far as I understand, when doing this operation, we first need to identify the subnormal value, normalise it, adjust the exponent, and then multiply the significands. Wouldn't it be advantageous to just multiply the significands and use a leading-zero counter on the result? It seems like removing some steps could spe... |
I am new to optimization methods. What is the meaning of "crossover probability" in optimization methods? I was reading the following lines from an article that this question came into my mind:
In unmodified differential
evolution (DE) algorithm, crossover probability is constant and remains unchanged during the whole... |
Chaitin’s version of Gödel’s theorem roughly states that there exists a constant c such that for each string of one’s and zeroes x, the sentence “the algorithmic information complexity (Kolmogorov complexity) of x is greater than c” is unprovable, even though there are an infinite number of x’s in which the sentence is... |
Consider the following string:
stryng = "{\"Jordi\", \"Jordy\", \"Jorde\", \"Jordie\", \"Jordee\", \"Joardi\", \"Joardy\", \"Joarde\", \"Joardie\", \"Joardee\"}"
That string represents a mathematical set of strings.
$\begin{Bmatrix} \mathtt{Jordi}, \mathtt{Jordy}, \mathtt{Jorde}, \mathtt{Jordie}, \mathtt{Jordee}, \mat... |
Does anyone know of the data structure/algorithm for this use case?
Given 300k words, -> find all words with some letters present (letters could be in any order)?
For example find all words with letters a,a,d? (so for example "academics" and "captained" are some of the matches)
I initially looked into GADDAG, but it's ... |
Given two regular languages (fx given by it's accepting regular expression), is there an algorithm to determine if one is a subset of the other?
|
Prove that for $A, B \in \mathbb{Z}$, $A + B = (A \operatorname{\&} B) + (A \mid B) = (A \oplus B) + 2(A \operatorname{\&} B)$ where $\&$ is bitwise AND, $|$ is bitwise OR and $\oplus$ is bitwise XOR. (It is reasonable to assume that the bit representation of integers is two's complements.)
The statement above appears ... |
BDDs are a way of representing Boolean formulas.
DPLL is an algorithm to determine satisfiability of Boolean formulas.
My understanding is that the two are used for SAT solving.
How are they combined?
|
How do we quantify the size of a regular expression?
A problem in computer science which sometimes arises is converting a regular expression into a tree.
What rules can we use to ensure that the tree will have a predictable number of nodes?
I know what to do for simple character classes such as [0-9] and [A-Z].
Howeve... |
We seek an algorithm.
Inputs to the algorithm are a set of strings $A$ and the output of the algorithm $A$ is a regular expression $r$ such that:
The size of regular expression $r$ is minimized.
If $A^{\prime}$ is set of strings described by regular expression $r$, then $A \subseteq A^{\prime}$. In other words, the ... |
Consider the following problem: You are given two integer arrays $A$ and $B$ of size $N$ and $M$, respectively. You are guaranteed that $1 <= A[i] <= M$ and $1 <= B[i] <= N$ for all $i$ (so each array's elements is at most the other array's size). The sizes of the arrays, $N$ and $M$, may be up to $100,000$. Construct ... |
Let $C_1, ..., C_m \in \mathbb{R}^n$ Is there a polynomial algorithm in $n,m$ which finds the Minimum Enclosing Ball (MEB) for these points?
My research
I see mentions of algorithms like Megido, Waltz etc. which are known to solve the problem in linear time in $m$, the number of points, but these seem to be exponential... |
From Chapter 35 of Introduction to Algorithms by Cormen et al.
EXACT-SUBSET-SUM is an exponential-time algorithm in general, although it is a polynomial-time algorithm in the special cases in which $t$ is polynomial in $|S|$ or all the numbers in $S$ are bounded by a polynomial in $|S|$.
I fail to see the reason here... |
In chapter 8 of the book "Introduction to Algorithms" by Cormen, Leiserson, Rivest, and Stein, lemma 8.4 is proved. (my question is after the proof of the lemma)
Given $n$ $b$-bit numbers and any positive integer $r≤b$, RADIX-SORT correctly sorts
these numbers in $Θ((b/r)(n+2^r))$ time if the stable sort it uses takes... |
Recently I came across a problem I don't get may hands on:
Given p binary positions.
Let s be the number of "set-bits" (1 < s < p * 2^(p-1) - 1).
I need the maximal set of assigments that alltogether set s bits.
Example:
p = 3, s = 8.
==> A "maximal" set: {(0,0,1), (0,1,0), (1,1,0), (0,1,1), (1,0,1)}
At the whole 8 bit... |
So I have 2 sorted arrays which will have the same length and what I need to do is sort the union array (the union of the two sorted arrays) and then find two median values, I need to do this in O(log n). I was able to come up with finding the median in log(n) but that is without sorting the arrays, I could use one of ... |
Suppose we have a problem, $A$, and a machine $T_A$ that solves $A$.
Now, let's say we have a problem $B$ that is solvable with a polynomial number of calls to $T_A$, and we call $T_B$ the machine that solves $B$ by calling $T_A$. But $T_B$ solves $B$ with probability $\frac{2}{3}$.
Does $B$ still reduce to $A$ in this... |
Assume the pipeline is initially empty and the processor is given 8 instructions to execute. However, the 4th instruction is an instruction whose operands depend on the result of the previous instruction. The remaining instructions are independent of each other. Given the instructions are not re-ordered, how long does ... |
I have a digraph D on n vertices formed in the following manner:
I start with k ordered (not sorted) lists of integers, with each integer from 1-n in at least one list. Integers do not show up more than once in a given list.
I create a node for each integer, with an arc from node x to y if x appears before y in at lea... |
Given a set of weighted permutations of numbers, an operation can be performed to combine multiple permutations that share numbers into a single rolled up permutation. What is the optimal algorithm to bucket the values into the minimal number of combined permutations?
Examples
permutation (weight)
1 2 4 (1)
1 2 5 (1) ... |
With the Circuit-SAT problem, I often see the "split" gate (I don't know the official name of it). This gate has a truth table of:
$$
\begin{array}{|c |c c|}
0 & 0 & 0\\
1 & 1 & 1\\
\end{array}
$$
And it has a symbol of this:
This gate allows us to use variable names more than once when we translate circuits to CNF.
I... |
I do recall having found a book on software design patterns with a foreword by Christopher Alexander. Now, as is well known Alexander is credited as the creator of the concept of design patterns and design languages. In this particular text, he also described how he first came to know his work was being used in compute... |
A round of Salsa20 is done as follows:
b ^= (a + d) <<< 7;
c ^= (b + a) <<< 9;
d ^= (c + b) <<< 13;
a ^= (d + c) <<< 18;
The Salsa20 variant called ChaCha20 has its round function like this:
a += b; d ^= a; d <<<= 16;
c += d; b ^= c; b <<<= 12;
a += b; d ^= a; d <<<= 8;
c += d; b ^= c; b <<<= 7;
ChaCha20 has 8 mo... |
Given a bipartite graph $G=(V,E)$ and an integer $l$, how many edge subsets ($E'\subseteq E$) of size $l$ are there such that the degree of each vertex in the resulting subgraph $G'=(V,E')$ is odd?
I have not been able to come up with anything smarter than explicitly enumerating all possible subsets and checking whethe... |
NP-complete problems are the "hardest problems" in NP. This means that all other problems in NP reduce (in polytime) to these problems. A consequence of this is if we were to find some polynomial time algorithm to solve one of these problems, we could prove $P = NP$. And if we could prove that no polynomial time algori... |
I am trying to understand which combinatorial problem best fits the one I have. I am mostly asking from the perspective of being pointed towards relevant literature. I will explain the problem with an example.
Consider the set $S = \lbrace{a^1, a^2, a^3, b^1, b^2, b^3, b^4, c^1, d^1, d^2, d^3, d^4 \rbrace}$. So note th... |
Modify Turing’s proof of the undecidability of the halting problem to show there is no Turing machine P with the following two properties:
For all Turing machines M, if M() accepts then P(⟨M⟩) accepts, while if M() rejects
then P(⟨M⟩) rejects.
P(x) halts for every input x. (In other words, if M() runs forever, then P(... |
I am familiar with the polish notation when it comes to algorithmically reading phrases, but I am having a hard time proving the following exercise:
K is a function so that 1) $K(*)$ is an integer if $*$ is a symbol of a language, 2) if $\sigma = \sigma_1 \sigma_2 \dots \sigma_n$ is a phrase of the language, then $K(\... |
To prove this, Introduction to Algorithms by Cormen et al., makes the assumption that the node has two children.
For the inductive step, consider a node $x$ that has positive height and is an internal node with two children. Each child has a black-height of either $bh(x)$ or $bh(x) - 1$, depending on whether its color... |
I'm trying to calculate the main memory size, and the only information given is the size of the cache, which is 256 KB, and the number of tag bits, which is 8. Cache is a 4-way set associative memory.
I'm wondering why block size information is missing in this question, because without it, I'm not able to calculate the... |
Let the universe be the set $U$ and a set of subsets $S$ be such that $\cup_{s \in S} s = U$. I am interested in computing the longest sequence of sets $s_1, ..., s_k$ such that:
$s_i \in S$ $\forall i \in [k]$
$s_i \not\subseteq \cup_{j=1}^{i-1} s_j$ (so each $s_i$ adds at least one new element on top of the existin... |
My Professor for my Computer Organization class gave us a few questions about caches on an assignment. I'm completely stumped by most of them. I've watched a few videos on caches on YouTube by Intermation, read the textbook, and even asked my friend (the Professor's office hours are not today). The textbook our Profess... |
Link: https://dl.acm.org/doi/pdf/10.1145/3149.214121
In the proof for Lemma 2, the authors define two initial states to be adjacent if the only difference between them is the value in the input register $x_p$ for a single process $p$. Then, they claim that any two initial configurations can be joined by a chain of init... |
How do you believe prominent deep learning ASIC makers such as Nvidia and Google will alter their hardware design over the next decade to meet the exponentially expanding need for extra computing to train and execute machine learning models?
For example, since the beginning of the current machine learning boom, the ind... |
The options are:
(a) $L \cap a^{\ast}b^{\ast}$
(b) $(L \cap a^{\ast}b^{\ast}) \cup a^{\ast}b^{\ast}$
(c) $L \cup a^{\ast}b^{\ast}$
(d) $(L \cap a^{\ast}b^{\ast}) \cup b^{\ast}a^{\ast}$
My doubt is: We don't know what exactly $L$ is, it could be $a^{n}b^{n}$ or $b^{n}a^{n}$, we for sure know that $L$ is either of the tw... |
Basically what i am trying to prove is this :
$f(n),g(n) \neq 0\quad , n>0 \ \ \ \ and f(n)=Ω(g(n)) \ \ \ , \ then \frac{1}{f(n)}=O(\frac{1}{g(n)}) $
I guess that if we take the definition of $f(n) = Ω (g(n))$ , which means that $f(n) \ge cg(n) $ for every $ n \ge n0$ and then flip the relation so that it becomes $... |
I have a matrix (input):
--
c1
c2
c3
r1
AA
BB
CC
r2
CC
RR
BB
r3
EE
DD
FF
r4
KK
DD
EE
r5
DD
GG
KK
r6
PP
QQ
KK
Let's call each matrix cell a namespace. If two rows begin from the same namespace, then such a namespace is called a reused namespace. A reused namespace does not need to be a prefix. In ... |
I have encountered at my work currently a problem where I want to find an efficient algorithm for, although I suspect this might be hard problem. Maybe you can help me to tell if this is a NP hard problem or hint me to an algorithm.
When looking for similar problems, I found the hitting set problem. But my problem is a... |
Suppose that there is a set of strings such that for each n there is at most one string |w| = n. For any given n there is a 50:50 chance that such a string exists. These string can be arranged in a lookup table such that the binary value of the string is interpreted as an index, the table entry indicates yes/no i.e. th... |
On page 103 of Mike Sisper's Introdution to Theory of Computation, it says that the grammar has 27 terminals (26 being the letters of the English Alphabet and 1 being the space character) but in the rules above, I don't see those 27 terminals. I only see 10 which are "a", "the", "boy", "girl", "flower", "touches", "lik... |
in the step where you have to remove the epsilons, would you need to remove something like this:
A -> Bε
Or would you simply remove the ones that have epsilon by itself like this:
A -> ε
|
I am writing this CFG to solve the problem:
$S \to ASBSC$
$A \to aAe ~|~ ε$
$B \to aBd ~|~ ε$
$C \to bcC ~|~ ε$
Is this correct or not?
|
I've recently learnt the execution of MIPS instruction set using single cycle processor. However I'm not getting one thing. Since one clock cycle is needed for the complete instruction we only have one positive clock edge. When the clock is made high on the first time in this rising PC value is written but we may have ... |
The operation of shuffle takes two words and merges their symbols, keeping the symbols of each of the strings in the right order. It can be recursively defined by $x \parallel \varepsilon = \varepsilon \parallel x = x$ and $ax \parallel by = a (x \parallel by) \cup b (ax \parallel y)$. Here $a,b\in \Sigma$ and $x,y\in ... |
Why is it that a Turing machine can perform all kinds of calculations and procedures?
As a test, I tried to perform a four-quadratic calculation using a Turing machine myself.
However, although I found that it can perform the four arithmetic operations as a result, I do not understand the principle of why it can do so.... |
given this information of a language I need to determine if the language is regular or not:
I thought to Assume by way of contradiction that L6 satisfies the conditions of the pumping lemma. Let p be the pumping constant. Consider the word w = 0^(P-1)1...
Clearly w ∈ L6. Thus, by the pumping lemma, there exist x, y, z... |
In my algorithms class, my professor presented the problem of finding the largest sum of non-adjacent elements in an array. For example, if we have $[1,4,3,8,5]$ the largest sum of non-adjacent elements is $4 + 8 = 12$. My professor said we can solve this problem via dynamic programming since it exhibits optimal substr... |
The sequences are made up of only digits. A displacement is defined as pair $(i, j)$ such that $i > j$ and $A[i] < A[j]$. For example, 423 has 2 displacements.
The question is to find the number of sequences of length $N$ such that number of displacements is less than a given $k$ in $O(n^2)$.
The only given hint is tha... |
Suppose I have $n$ i.i.d. copies of some channel $W_{Y|X}$ for some finite $n$. I wish to send the maximum number of messages over these $n$ copies such that the error in decoding the message is at most $\varepsilon$. There is some encoder and decoder that I use. Let such an encoder result in some input distribution $p... |
You are all familiar with the halting problem so I won't repeat it.
Suppose $H$ is a Turing machine which takes as input an encoding of another Turing machine $M$, then searches all possible proof strings until it finds a proof that $M$ halts or a proof that $M$ does not halt. Of course, if there is no such proof then ... |
NP has several complete problems, which reduce to one another. In this sense, they are all "equal" in terms of hardness.
There are other problems in NP that are also "equal" to one another; for example, all the languages containing only a single string are equal. All of these are in P as they are finite.
Let's define a... |
the question is as follows:
"Generalize MATRIX-MULTIPLY-RECURSIVE to multiply n × n matrices for which n is not necessarily an exact power of 2. Give a recurrence describing its running time. Argue that it runs in Θ(n^3) time in the worst case."
how do you go about solving this?
my solution to the first part of the que... |
Before I introduce my problem I need to define a couple of things. Suppose we have two sets $S_1=\{1,2,3\}$ and $S_2=\{2,3,4\}$. A compression tree for $S_1$ and $S_2$ is
{2,3}
/ \
/ \
{1} {4}
i.e. the left leaf is associated with $S_1$ and has the property that the union of the sets in a leaf-to-root p... |
The following is a dublicate of the question presented here:
Let $G$ and $H$ be simple graphs. We build the graph $G\times H$ such that every vertex $(u,v) \in V(G\times H)$ is an ordered pair of one vertex from G(the first) and another from H(the latter). Additionally, two vertices $(u_1,v_1),(u_2,v_2)$ are connected... |
Say there are 5 candidates, A, B, C, D, and E. An election is held using a ranked voting method. That is to say, each voter submits a preference list (the order in which they prefer candidates). E.g. A > B > C > D > E could be my preference list.
For most election schemes, a voter is allowed exclude candidates from the... |
Is the clique decision problem in co-NP?
Definitions:
"In the clique decision problem, the input is an undirected graph and a number k, and the output is a Boolean value: true if the graph contains a k-clique, and false otherwise." (https://en.wikipedia.org/wiki/Clique_problem)
"A decision problem is in co-NP precisely... |
Let's say that we have a decision problem $P$. Let's also say that $I_n$ is the set of all instances of size $n$ that exist for this problem, and that its cardinality is finite.
There is a sequence of bits that uniquely represents each instance (of that size) of the problem. Each of these sequences has $b(n)$ bits (for... |
Assume that I have a bunch of bitsets (strings on $\{0,1\}$) of the same length, e.g.:
101110001
001001101
010101010
101001001
101010101
I want to find the largest set of bits (indices, not necessarily consecutive) that takes all possible values in these bitsets. In the example above:
101|11|0001
001|00|1101
010|10|10... |
I don't really understand why promise problems are classified differently than decision problems.
Consider this problem as an example. Given some real number between $0$ and $1$, determine if it greater than $\frac{1}{2}$ or not.
In this problem, that the real number is between $0$ and $1$. Let's say our alphabet is $\... |
In the Louvain algorithm, a super node is created in the second phase with self-loops from the sum of intra-community edges. According to the original paper and the lecture CS224W, self-loop edges are counted with a factor of 1, while edges between different nodes of the same community are counted with a factor of 2, a... |
Consider small instance of GAP involving 5 items and 2 resources with capacities 5 and 12 respectively. If we have cost matrix Cij and also consumption matrix bij with jobs vs resources, how can we calculate the objective function value using modified greedy heuristic algorithm when we have dual multiplier values alpha... |
I want to know the minimum number of elements needed to create a tree with the longest path having n edges. How can I approach this problem using the forest implementation of disjoint sets with union by rank and path compression? Would it just be n+1 elements? Or am I missing something? I feel as though n+1 would be to... |
Given two types, T1 and T2, how does structural equivalence work when they're self-referential? Further, how do we go about proving it?
T1: struct { a: int, b: pointer to T2 }
T2: struct { a: int, b: pointer to T1 }
I was attempting to create a directed graph, and by proving the directed graphs are equivalent, we can ... |
I'm trying to prepare for mock exam, could you please help me with possible solutions?
Design and analyze an efficient algorithm that, given n distinct integers, returns
an element which is neither the smallest nor the largest
|
I am conducting a stateful search of a large graph in an effort to find some solutions of minimal cost. With an admissible heuristic for estimated time to completion from a given state (as in A*), I would be able to drop states out of the search queue to improve runtime, otherwise I need a good heuristic that can advan... |
What's the proper way to declare an object in pseudocode.
For example:
const car = {type:"Fiat", model:"500", color:"white"};
Would it be correct to write
object car {
type: "Fiat"
model: "500"
color: "white"
}
Or should a different format be used?
Thanks in advance.
|
A walk is a finite or infinite sequence of edges which joins a sequence of vertices. A trail is a walk in which all edges are distinct.
A cycle in a graph is a non-empty trail in which only the first and last vertices are equal.
We know that determining whether two vertices (or two edges) fall on a triangle is relative... |
I'm working on problem 19.4-1 from the CLRS book, which asks to show that the height of an n-node Fibonacci heap can be greater than O(lg n) by exhibiting a sequence of operations that creates a Fibonacci heap consisting of just one tree that is a linear chain of n nodes.
I'm not sure if by "linear chain" the problem m... |
I have some troubles in understanding of the Brzozowski's algorithm for NFA to minimized DFA transformation. Or maybe I'm doing a mistake in the NFA to DFA transformation steps.
The Algorithm, as described in Wikipedia, is as follows:
Reverse the NFA.
Transform to DFA.
Reverse DFA.
Transform to DFA again.
Let's assum... |
I have been asked to describe through an FSA a system where some inputs do not determine any state transitions, but that provide outputs. There is no self-transition, and the input is not rejected: the state literally does not change, while an output is produced. I started with NFSAs, but it does not seem to suit the r... |
If P = NP, then is it the case that there exists a total recursive function from the set of polynomial-time nondeterministic Turing machines to the set of polynomial-time deterministic Turing machines such that it sends every nondeterministic machine to an equivalent deterministic machine?
|
My question is pretty much just the title.
It is pretty easy to see that any finite language can be solved in $O(1)$ time. For this reason, every finite languages is in $P$, $L$, and $DTIME(O(1))$.
But are finite languages the only languages that can be decided in constant time?
|
I am studying the complexity of SAT resolution refutation. There is a useful tool named weakening rule
The weakening rule:
B -->B ∨ C
says that from a clause B we can derive the weaker clause B ∨ C for an arbitrary C. We say
that B ∨ C is a weakening of B.
We can add this extra rule without loss of generality, since a... |
One big problem in complexity theory is $P$ vs $L$. I was just thinking about why this isn't trivial, and I came up with the following example. Of course, it cannot work as a proof as it seems too easy. So what is wrong in the below "proof?"
Let $\Sigma = \{0, 1\}$. $L \subset \Sigma^*$ where
$$
l \in L \iff \text{the ... |
The usual many-one reduction involves Turing machines transforming an input, $w$, of some language to an input, $f(w)$, of some other language in polynomial time. (Where $w \in L_1 \iff f(w) \in L_2$).
But for $P$-completeness, logspace or NC reductions are often used instead (taken from wikipedia), as using polynomial... |
What component and mechanism determines which DMA transfer mode is used?
How can be identified what DMA mode is used by a device, let's say on Linux?
Let's consider a contemporary AMD or Intel x86-64 system with two DMA PCIe devices.
Device 1 is an input device that regularly DMA writes for 300 microseconds (I'm guessi... |
In this question I need your help researching time complexity of a dynamic array with insert-last(x) and delete-last() operations:
We define a data structure and call it dynamic array, we define the operations inseet-last(x) and delete-last(), we also define a set of rules for this data structure:
Insert-last(x): inser... |
I often hear NP-completeness as problems such that, if they were in $P$ all problems in $NP$ are in $P$. The true definition, though, is that NP-complete is a set of languages in NP that all languages in NP reduce to in polynomial time.
But is this idea that NP-completeness implies all problems are in P if they are in ... |
I know that, T(n,m) = T(n-1,m) + T(n,m-1) + c it's the recurrence equation of Longest Common Subsequence algorithm. And the time complexity of the LCS in case of recursive method is O(2^n+m).
The base condition is: when m or n = 0, T(m,n) = 1 i.e., T(0,n)=1 and T(m,0)=1.
But, how do I derive the time complexity from th... |
I have formulated an instance of a 0-1 Integer Program (IP), which I am trying to determine the complexity of (can this instance be solved in polynomial time or not). As we know, the 0-1 IP is NP-complete, but I suspect my instance can be solved in polynomial time; which of course does not contradict the hardness of th... |
I am trying to optimize a building layout in a game, and it seems like the problem could be solved by a computer much quicker than by my own trial and error. However, I only have a cursory understanding of programming (mostly JavaScript), so I'm hoping some software exists which can do most of the work for me, or some ... |
It is given that the language is not decidable.
Is this language Turing-recognizable?
|
My understanding is that this statement regarding the halting problem is proven:
There does not exist any TM C that can, given a Turing machine A and input B as inputs, determine in a finite number of steps whether A halts on input B, and that works correctly for all A and B.
What I want to know is whether this relat... |
Got inspiration while reading history book. Inspired by: China, the cake of kings and emperors, Le Petit Journal 1898
Background:
After the Second Opium War, United Kingdom(UK), France, Russia, Germany and Japan have a meeting to dividing China the cake.
The cake have fixed size but can be break down into many small ... |
When speaking about many-one Karp reductions, the definition is stated below:
$$
A \leq_P B \iff \exists f \colon \: \Sigma^* \mapsto \Gamma^* \: \text{such that} \: (w \in A \iff f(w) \in B)
$$
where $f$ is a polynomial time total computable function. But I think this raises a bit of an issue.
I have an ongoing questi... |
I have a network of 1,000 computers that are sharing processing jobs. There are a few constraints:
Each computer has a maximum ratio of jobs it can perform
Can be higher than an equal share
Computers are not obligated to do work
Not all of these computers will be online at any given time
Jobs should be processed qu... |
I am solving a problem where I got an observation that, the vertices of the graph has an outdegree of atmost one, but My questions is using this observation ,Can it be proved that graph has either a cycle or a sink vertex in its components?
|
Hey I had this question and am stuck on part (b).
I don't see how its possible to find a graph with 7 vertices and 15 edges that does not have the half-clique problem. If there is a way, could someone share their thought process rather than the answer as I would like to figure it out on my own.
Thanks a lot!
|
Could You please recommend ordered data structures with the complexity of reading/writing/deleting not slower than O(Log2(n)), traversing O(n*Log2(n))? SkipList, Red-Black Tree, what else?
|
Let $L$ be a regular language over the alphabet $\sum$, prove that the language defined by $\hat{L} = \{uv \in \sum^* | u^Rv \in L \}$ is regular.
There is guidance in the exercise that instructs us to define for every $p \in Q$ the language:
$L_p = \{uv\in\sum^* | \delta(q_0,u^R) = p \space\space and \space\space \del... |
Why is sorting numbers Omega(nlogn)? I'm thinking of an reduction algorithm where:
For all the numbers x_i, we create a point (x_i, 0) on a 2d graph.
Fit a line directly to the right starting from the leftmost point.
Sorted numbers are the order in which we encounter the points.
Would this not be an O(n) number sorti... |
I am using past materials to review for an upcoming assignment and came across this question:
Disjoint Subset Sum:
Input: A set of integers S and a goal g(in the set of natural numbers)
Output: YES if there are at least two disjoint(non-overlapping) subsets of S where the elements of each subset sum to exactly to g oth... |
I'm studying finite state machines and trying to make this table but i don't know where to start. Isn't it necessary to know what happens when for example both inputs A and B from state s1 are active? The exercise in question doesn't say more, it just says to not consider the outputs, encode the states and inputs in bi... |
In the following discussion, we use the term old programming language to refer to programming languages which had their first release prior to the year 1990.
In old programming languages, there was a strong distinction between:
run-time functions.
compile-time macros.
In a running example, suppose that a computer p... |
Here's what Wiki says:
And here's what Mike Sipser says in his Introduction to Theory of Computation:
The problem arises when you try to read the two definitions - Mike Sipser seems to be suggesting that for a grammar to be in Chomsky's normal form, it should have all of those forms while Wiki explicitly says that it... |
This is a simple variation on precedence parsing for which I haven't been able to prove the existence of an efficient algorithm. Is this a known problem?
The setup is as follows: we are given $n$ operator nodes $x\ast_1 x\ast_2\dots\ast_n x$ connecting $n+1$ leaves (whose identity is not important, here denoted by $x$)... |
Check if these 2 regular expressions are equivalent:
$R_1 = (a+b)^*(aa+bb)$
$R_2 = (a+b)^*aa+a^*bb+b^+b$
My approach:
We check if both of these expressions generate the same set of strings. Meaning that any string that can be generated by $R_1$ can also be generated by $R_2$, and vice versa.
$R_1$ can generate strings ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.