instruction stringlengths 35 29.1k |
|---|
I'm considering the planar BSP problem, where we are required to partition a set of disjoint line segments in the plane, such that every region in the partition contains at most one line segment or a portion of one line segment.
My question is: is there a way of partition these line segments such that no line segment i... |
I'm trying to understand the example showing disadvantages of a long time quantum in Tanenbaum's book in Section 2.4.3 “Scheduling in Interactive Systems”.
To improve the CPU efficiency, we could set the quantum to, say, 100
msec. Now the wasted time is only 1%. But consider what happens on a
server system if 50 reque... |
Let's assume I have array which I need to parse into binary tree
[10, 15, 8, 12, 94, 81, 5, 2, 11]:
10
/ \
8 15
/ / \
5 12 94
/ / /
2 11 81
or slightly modified arrays with the same elements generate the same binary tree above: [10, 8, 5, 15, 2, 12, 11,... |
You are given x,a. Find a polynomial p(y) with the leading coafficent 1 such that p(x)=a. How to write an algorithem to solve this efficently? I have no idea where to start
|
We know that a recurrence relation without initial condition(s) might specify more than one solution (if it has any), but if we set some initial condition(s) the solution becomes unique. Now The book CLRS claims for a recurrence like this:
$ T(n) = 2T(\lfloor n / 2\rfloor) + n$
or other divide-and-conquer-related recur... |
You are given a list of prices (non-negative integers) $$ P=<P_1, P_2, ..., P_n> $$, where the prices $P_i$ appear in non-decreasing order.
Moreover, you have access to an oracle that can be queried with an integer $a$ and returns "yes" if and only if $a \le k$ for some unknown integer $k$. Each query to the oracle req... |
Let $F$ be a family of sets of consecutive integers in $\{1,…,k\}$ that is closed under taking subintervals, i.e. for any $a≤b≤c≤d$, if $\{a,…,d\} \in F$, then $\{b,…,c\} \in F$ also. Find a minimum number of intervals in $F$ that covers $\{1,…,k\}$.
Is this a known problem? after some trial and error I do have the fee... |
I have a simple connected undirected graph $G=(V, E)$ and I would like to enumerate all possible connected components that arise from removing $k$ edges in $E$. A naive way is to remove each $k$-tuple of edges (of which there are $\binom{|E|}{k}$ total) and then run a connected components algorithm, but this feels incr... |
For simplicity, and I think without loss of generality, we can consider a binary tree. Suppose that we want to find the path between the root node and some node in the tree (we don't know where it is and only that it exists in the tree).
Worst case scenario is if the node was a leaf node at the largest depth.
If we wan... |
The excerpt below is from the OS text by Galvin et. al.
When we use a paging scheme, we have no external fragmentation: any free frame can be allocated to a process that needs it. However, we may have some internal fragmentation. Notice that frames are allocated as units. If the memory requirements of a process do not... |
Disjoint Lite Feedback Vertex Set. given an undirected graph G and k ∈ N, and a Lite Feedback Vertex Set(LFVS) X of G of size ≤k+1 the objective is to decide whether there exists a subset S ⊆ V (G) of size at most k that is disjoint from X and that every connected component in G − S is either a tree or a simple cycle.
... |
/// is an esoteric language, and I thought of posting a code-golf problem related to it.
A /// program of the form /p/q/r where p, q, and r are strings that do not contain / or \ does:
If the string p is a substring of r, go to step 2; otherwise step 5.
Replace the leftmost occurrence of p in r with q.
Let the result... |
Should the $a$ and $b$ in Master theorem be integers or they can be rational numbers? I think $a$ must be an integer but $b$ can be rational.
|
the problem:
In Almost Feedback Vertex Set, we are given an undirected graph G and k ∈ N, and the
objective is to decide whether there exists a subset S ⊆ V (G) of size at most k such that every
connected component in G − S is either a tree or a cycle.
Design a (4^k)*n^O(1)-time algorithm for Almost Feedback Vertex Se... |
Calculate the CC (Cyclomatic Complexity) of the following code snippets.
I am not sure if I have drawn the Control Flow Graph correctly and furthermore if my calculation for the Cyclomatic Complexity is correct. And as for the formula M = E - N + 2P, the P is defined as "P = number of nodes that have exit points". Am I... |
Can anyone help to prove that
$\sum\limits_{i=0}^{k-2}\log_2\left(\frac{n-i}{k-i-1}\right) > cn$ for some constant $c>0$?
Here $k=\Big[\frac{n}{2\log_2 n}\Big]$ and $[x]$ denotes the integer part of $x$, for example, x=5.2999, then $[x]=5$.
|
Many sources (including Wolfram's MathWorld) say that NP problem is defined as a decision problem "verifiable in nondeterministic polynomial time" (check Google to see more sources).
But accordingly Wikipedia tells that NP are problems that can be solved in non-determnistic polynomial time.
From conjunction of these tw... |
Several (tutoring) students have asked me for a formal definition of amortized time and I've never been able to find one online. All the literature I've found usually outlines the three most common methods for doing the actual analysis and no more. In a few places there are explanations of why the amortized time for $o... |
I just finished watching the 1986 SICP lectures, and the concepts are rolling around in my head.
My question: why is "finite-state controller with datapath" the implementation of computer programs we use?
I can think of a few of types of answers, which have different emphases:
We don't use it: there are various impl... |
L={⟨M⟩: M is a DFA and for each string in L(M) the number of 1s is more than or equal to the number of 0s }
T = "On input where M is encoded DFA"
1. Construct another DFA D such that L(D)={x|x has more or equal 1s than 0s}
2. For each input x
a. if( x is accepted by DFA M){
if(accepted by D){
... |
The question is: "Prove that we can also express the total cost of a tree for a code as the sum, over all internal nodes, of the combined frequencies of the two children of the node."
I found an answer here (16.3-4): https://walkccc.me/CLRS/Chap16/16.3/, but I'm confused about one part of it.
Specifically I'm confused ... |
and
$L_{\leq k} = \{\langle M \rangle : |L(M)|\leq k\}$
The solution that I saw is:
Proof by contradiction, assume such $M$ exists.
So reduction $f$ from $\overline{HP}$ to $L(M)$,
when $\overline{HP}=\{(\langle M\rangle,x ) | M $ doesn't halt on $ x\}$
$f(\langle M'\rangle,x ) = \langle M_x\rangle$
When $M_x$ on input... |
Is there a way that I can use If $L=\big\{\langle M_1,M_2\rangle\mid M_1, M_2\text{ are TM and } L(M_1)\cup L(M_1)=\Sigma^* \big\}$ is in $RE$ or $coRE$ or not in $RE\cup coRE$? to prove that $L=\big\{\langle M_1,M_2\rangle\mid M_1, M_2\text{ are TM and } L(M_1)\cup L(M_2)\neq\emptyset \big\}$ is undecidable and recogn... |
Fallowing are some definitions from book "introduction to theory of computation" by sipser.
a nondeterministic turing machine is a decider if all its computation
branches halt on all input.
$NTIME(t(n)) = \{L | L \text{ is a language decided by an $O(t(n))$ time nondeterministic turing machine } \}$
What is the dif... |
I think that Alan Turing's solution for the "halting" problem might be wrong.
Turing's main premise is wrong, he assumed the only way to check whether a program halts is to run it. He didn't consider that it's possible to determine whether any given program will ever halt by parsing and analyzing its code without runni... |
I have been studying NP-Complete problems and I saw the Dense Subgraph problem. Then I saw that they are trying to show that the problem is NP (see below quote), but I can't understand how it verifies that time is polynomial.
Problem: Dense Subgraph
Input: A graph $G$, and integers $k$ and $y$.
Output: Does $G$ contai... |
I don't know if I should have posted this on StackOverflow or here but what's the difference between these terms? Are the definitions of these dependent on the programming languages or they're things independent of them?
|
I'm new to the area, and we don't have a course on graph neural networks at our university. However, I will still like to know the main theoretical results when considering convergence of graph neural networks. Where can I learn more about the topic? Thanks.
|
I am revising operating systems theory (I'm Italian, forgive me for bad English) and there is a slide that states:
If page size is small then we avoid internal fragmentation (I get that) but
we have larger size of page table and therefore larger cost of managing this page table".
If page size is large then we have a l... |
I am studying Compiler Design. The instructor told us that when a program is given to lexical analyzer it find all tokens then a symbol table is created and it is updated at every phase accordingly, but I read this online notes and here is the statement
The lexical analyzer produces a single tokens each time it is cal... |
So a few days ago my lecturer told us that for every nondeterministic polynomial time oracle
machine $M$, there is a nondeterministic polynomial time oracle machine $N$ that gives us $L(N^{3-SAT}) = L(M^{3-SAT})$ and $N$ makes a single query to its oracle. He didn't give us a clear explanation for why this is true.
My ... |
I mean if $L'$ defined as $L'=\overline{L}$, when $L\notin RE,coRE$.
From the logic point of view it should be $L'\in RE \cup coRE$, isn't?
But it's not make sense for me, where am I wrong?
|
I have the following algorithm runtime:
$T(1) = b $ for some positive constant.
Otherwise, $T(n)=8T(\frac n 2) + 100n^2$
I am trying to prove that it is $\Theta(n^3)$ by induction.
I proved that it is $\Omega(n^3)$ using constant $c=\frac b 2$ and $n_0=1$.
I am trying to prove that it is $O(n^3)$ by induction (without ... |
I need a polynomial algorithm that finds the minimal length cycle in a directed graph containing a specific edge (u,v), or prove that this is NP-hard.
All edges weigh the same.
Thanks
|
What is if we have
f(n) = 15n^2logn +500n^2,5 ,
g(n) = n^3 + 1000 ,
h(n) = 21n^3logn ,
x(n) = 50n^2,5 + n*log(n)
How to check " is f(n) O(g(n) or O(h(n)) , or O(x(n)) and why? and other examples?
like is h(n) O(g(n)) or is f(n) O(n^2logn)
|
If we have a string rewriting system within the alphabet $\{X,Y\}^*$ and the rule $XY\to YX$. How can we prove by induction that on every string input the system terminates?
|
I think that everyone will agree that the following class achieves data abstraction (hiding of its internal representation):
class A {
private List x = new ArrayList();
public List getX() {
return this.x;
}
public void setX(List x) {
this.x = x;
}
}
But could we say the same about... |
I am currently working on some analyses of the Berlin road network, and I am using OSMNX to get a relevant graph representation. I noticed that - if with drawbacks - many authors use planar representations when working with road networks. Geoff Boeing, the author of osmnx, has concerned himself with the issue, too (htt... |
The problem I'm trying to solve reads as follows:
Given a graph $G=(V,E)$ ,a parameter $k$ and two values $U^\star, P^\star \in \mathbb N$, where every vertex $v\in V$ has a utility and a pollution $u_v,p_v \in \mathbb N $, we define $U(v)=\sum_{w\in N(v)} u_w$ and $P(v)=\sum_{w\in N(v)} p_w$. The goal is to find a ve... |
I have to test if $ \sum_{n=0}^\infty \frac{n^2}{2^n} = O(1)$.
To show: $ \sum_{n=0}^\infty \frac{n^2}{2^n} \le c \cdot 1$
So my attempt was:
$ \sum_{n=0}^\infty \frac{n^2}{2^n} = \sum_{n=0}^\infty n^2\frac{1}{2^n} $ then split the sum to $ \sum_{n=0}^\infty 2^n \cdot \sum_{n=0}^\infty \frac{1}{2^n} $
With: $ \su... |
Is there a substitution, so that the following recurrence relation can be solved using the given version of the master theorem?
$$ T(n) = 2T(n/2) + \log n $$
Let $a,b \in \mathbb{N}$, where $b > 1$, let $g\colon \mathbb{N} \to \mathbb{N}$ belong to $\Theta(n^c)$, and suppose that
$t(1) = g(1)$.
$t(n) = at(n/b) + g(b)... |
I am currently learning complexity theory and wasn't able to find a tightest lower bound to BigOmega(n!), I am quite certain it isn't n^n and so wasn't able to reach to a tightest lower bound, can log(n)^n be the one, of course lose lower bounds are possible, but can you please help me understand the tightest lower bou... |
The exact definition of $3SAT$ and $MSAT$ are as follows:
$3SAT :=$ each clause has exactly 3 literals
$MSAT :=$ At least half of the literals of every clause are True
My intuition was, as we know that for $3SAT$ we have clauses with $3$ literals, we might just add $2$ new variables, wich are always True. This ensure, ... |
I have the following problem statement:
Is G well-defined here? I am unsure of this since there's no production rule for $X, Y, Z$, and this confuses me a bit.
And secondly, how do I prove $L$ is regular? I was thinking the grammar might be right-linear, but I'm not sure if this is the case. Do you have any ideas on h... |
I want to sort a list of n items with a comparison sort. However, one of the comparisons made by the algorithm will be flipped from what it's supposed to be. Specifically, there is one pair of items for which the comparator function consistently gives the wrong result.
What is a efficient n*log(n) sorting algorithm tha... |
I don't have a strong CS background so apologies if the question is trivially simple:
So I am working on an algorithm, say $A(n)$ , which runs over all integer partitions of $n$. Now the algorithm calls a sub-routine $S(\pi)$ for each of the partition $\pi$ (and does nothing else). The time-complexity of running the su... |
I have an algorithmic question. Suppose there is a ground truth binary tree of N nodes and there is an oracle which answers queries of the form: given any user specified pair of nodes a and b, do a and b have a ancestor-descendant relationship and if yes, which of them is the direct ancestor of the other?". Now assumin... |
I want to find the answer for $$\sum_{i=0}^{\log_3 n-1}i\times 3^i$$
Can you please explain?
I this a geometric series?
|
I was reflecting on what I learned about demand paging and I have a question:
In demand paging, we have entries in the page table only for frames that are present in physical memory. So I was wondering how could a page fault (not because of a bug , occur in such a state).
In my class we where shown an image :
My confu... |
I want to sort a list of n items from pairwise comparisons. Each round, I receive k comparisons, one each from k different "arbiters".
The arbiters cannot coordinate, and must choose their comparisons independently from myself and each other. How should they choose their comparisons so that I can sort the list of items... |
As I am headed into a Computer Science major wishing to eventually become a software developer, I wonder this: should I immerse myself in computer science theory and knowledge (data structures, algorithms, how computers work).
I think today many developers can just get by knowing their own tools and technologies depend... |
You have n items x[0], ..., x[n-1]. Beforehand, you're given a list of several comparisons c[0], ..., c[k] for those items (e.g. c[0] = (x[0] < x[4]), c[1] = (x[3] > x[7]), etc.).
The objective is to sort the items by requesting as few additional comparisons as possible.
For example, if c contains all the pairwise comp... |
I'm not sure if my solution to the following problem (adapted from Exercise 20, Chapter 4 of Algorithm Design by Jon Kleinberg and Éva Tardos) is correct. I would appreciate it if anyone could point out any logical flaws in it.
The problem:
Let $G=(V,E)$ be a connected graph on $n$ nodes. Suppose each edge $e$ in the g... |
Variant of 0-1 Knapsack Problem is when you can choose exactly $k$ items from $n$ items, and $k$ is positive integer parameter that came in the input.
Is there an algorithm with running time complexity $f(k) \cdot n^{O(1)}$ when $f$ is some function of $k$ only without $n$ that solve the Variant of 0-1 Knapsack Problem... |
When I started doing programming I wondered that why the variable names can't start with integer. Back then I accepted that , may be this is how the compiler designers have decided to go with. But now I am studying Compiler Design and they say that lexical analyzer produces token and it is easy / fast if we use identif... |
There are $3$ red socks, $4$ green socks and $3$ blue socks.You choose $2$ socks. The probability that they are of the same color is
Answer:
$\dfrac{^{3}C_{2}+^{4}C_{2}+^{3}C_{2}}{^{10}C_{2}}=\dfrac{4}{15}$
But my approach was to $1-$all unfavorable cases
$i.e.$
$1-\dfrac{RED*GREEN + GREEN*BLUE + RED*BLUE}{^{10}C_{2}}$... |
First definition:
$A_{TM}$ = $\{ <M,w> | $M is a TM and M on w accepts$ \}$
Second definition:
$E_{TM} = \{ <M> |$ M is a TM and L(M) = $\phi \}$
Let $T^{A_{TM}}$ be an oracle Turing machine with an oracle $A_{TM}$. We want to show that $E_{TM}$ is Turing reducible to $A_{TM}$.
$T^{A_{TM}}$ = "On input $<M>$, where... |
It is a very standard construction in most complexity theory courses to turn a turing machine into a circuit. I thought this was due to Cook, but it looks like he did the reduction to SAT not through circuits and so now I am unsure. Is there a paper that originally established the well-known circuit simulation that ha... |
Context
In a program I am writing, the user is allowed to define user-defined functions in a file. These functions have the particularity that must be of type [T -> T] for a given type T, i.e. they are endofunctions over T. These functions are always applied over the type T so I defined an identity function which is th... |
I am trying to find a Turing Machine for the above language. I am trying to do it with one tape, to start with. However, I am not quite sure about how to keep track of the number of a's in the string. Any help is appreciated.
|
I need to devise a data structure $S$ with the following functions:
BUILD($S$) - build the data structure from a series of $n$ elements in time $O(n \lg{n})$
INSERT($S$, $k$) - insert a new element with the key $k$ to $S$ in time $O(\lg{n})$
DELETE($S$, $p$) - delete the element $p$ from $S$ in time $O(\lg{n})$
D-SUCC... |
In the proof of Master theorem in Dasgupta's Algorithms the author says that the total work done at a recursion tree level is
$$a^k \times O\left(\frac{n}{b^k}\right)^d$$
where $a$ is the branching factor, $k$ is the tree level, $n$ is the size of the overall problem of course, $\frac{n}{b^k}$ is the size of the subpro... |
I am trying to sort square matrix of size $N$ by $\textbf{only permuting}$ rows and columns, such that row appear in increasing (left to right) while columns appear in decreasing order (top to bottom).
Edit: all elements are distinct positive integers.
My approach was to find smallest and put it at $A_{11}$, then secon... |
I was watching a video on Reinforcement Learning by Andrew Ng, and at about minute 23 of the video he mentions that we can represent the Bellman equation as a linear system of equations. I am talking about the Hamilton-Jacobi-Bellman equation, used for discrete control problems or discrete reinforcement learning proble... |
Let $L_1 \in REG$ and $L_2 \notin REG$ prove or disprove:
$\forall L_1 ,L_2 \text{ } $ $\text{ }L_1^C \cup L_2\in REG \lor L_2\setminus L_1\in REG$
I think that it may be disproved,
but I found it very hard to disprove,
because:
if $L_2 \subseteq L_1$ then $L_2\setminus L_1 = \emptyset$
and if $L_1 \subseteq L_2$ th... |
We define theta notation as follows: $\Theta(g(n))$ = {f(n): there are exist $c_1, c_2$ > 0 and $n_0$ such that 0 $\leq$ $c_1$g(n) $\leq$ f(n) $\leq$ $c_2$g(n) for all n > $n_0$}.
I found an illustration of this statement on Wikipedia, but I cannot figure out what exactly point $n_0$ means. How should we choose $n_0$ i... |
I would like to sample $n$ integers (of some fixed length, say $k$ bits) uniformly at random, and have them partitioned into two sets of equal sum. Since finding such a perfect partition (even if it exists) is NP-hard, I would like to sample them in advance such that they are partitioned into two sets of equal sum. A n... |
I don't understand the $T(2n / 3)$ part in the recurrence relation for MAX-HEAPIFY in the book CLRS. There is another post that explains it but I can't realize it.
|
I have a job shop scheduling problem with the following characteristics. How would I write that in alpha|beta|gamma notation (see 1,2)? I know some of the parts, but not all. I add my suggestions in code blocks.
alpha:
Job shop J
number of machines is part of the input m
beta:
batch processing b with job compatibili... |
When hashing a (key, value) pair where the key is a string, I have seen the following hash function in use:
E.g. $c_n + 256c_{n-1}+ 256^2c_{n-2}+...256^{n-1}c_1$, where this represents the string $c_1c_2..c_n$.
I understand the equation above can be written as:
$c_n + 256(c_{n-1} + 256(c_{n-2}+...256c_1))$, could someo... |
What concepts or technologies can help me with the following problem?
You have a finite inventory of resources and a list of recipes to convert a set of resources into another resource (IE "crafting" in a video game). Given that data I would like to compute an optimal path to a goal of a set of resources. For example, ... |
Let's say that I am interested in discovering the smallest 5 numbers in a set of numbers.
In SQL, this would work:
select number
from (
select number,
row_number() over(order by number asc) as order_
from my_table
) ranking
where order_ <= 5;
Alternatively, I could use the Quickselect algorithm (in my... |
Let $\mathcal{P},\mathcal{Q}$ denote two convex polyhedra in $\mathbb{R}^d$, which can be represented by a set of linear inequalities. Let $A \subset \mathbb{R}^d$ be a finite set of vectors.
The problem is to determine whether there is a sum of vectors, where each term in the sum is an element of $A$, so that the sum... |
I'm looking for a data structure to perform nearest-neighbor searches in 3D Euclidean space. I have used kd- and balltrees for this purpose before, but my problem is more sophisticated this time. I'd like to be able to insert and delete points from my dataset dynamically. I don't see any reason why either of these two ... |
I have a doubt about HDD and SSD addressing. Could someone explain me what is the minimum addressable unity for HDD and SSD?
In the case of RAM, we can address the single byte. But I presume that HDD and SSD have a a different behavior.
Thank you
|
I currently have a long timestamp measured in units of 100ns elapsed since January 1st, 1900. I need to convert it to milliseconds.
I have the choice of either multiplying by 0.0001 or dividing by 10_000. Although at first glance they sound the same, the former would actually cause an implicit cast to a double - the la... |
The concept of precedence and associativity seems straightforward.
The operator precedence is a collection of rules that reflect conventions about which procedures to perform first in order to evaluate a given mathematical expression.
The associativity of an operator is a property that determines how operators of th... |
Recently, I encountered the following problem:
Given an array $A$ of length $n$ $(0\le n\le 2^{17})$. Let $f(l, r, x)$ denotes the number of occurrences of $x$ in the subarray $a[l\ldots r]$. Find the number of pairs $(i, j)$ such that $i<j$ and $f(1, i, a[i]) > f(j, n, a[j])$.
My idea is to mimic the divide and conq... |
Given a Binary Search Tree(BST) I would like to understand can absolute minimum difference between any two nodes of a BST is always between adjacent nodes. If Yes or No can we generalize it ? Assume there are atleast two nodes.
Here is my approach
Case 1 : Assume only positive real numbers
Assume the absolute differenc... |
I read the following post. Now i encountered this question, what is codeword length of a character
with frequency more than $\frac{2}{5}$ huffman coding? I think it can 2bit or 1bit, but i can't prove it. Any help for proving that appreciated.
|
There is a permutation (more precisely a derangement) $\sigma$ of the set $\{0,1,\dots,n-1\}$ with cardinality $n$.
I want to compute the following counts (a kind of inversion):
$$K(\sigma )_{i}=\#\{j>i:\sigma _{j}>i\}$$
for each $0 \le i \lt n$.
Obviously a $O(n^2)$ straight-forward algorithm computes these counts. Bu... |
Say you are given a matrix $M (A \cdot B)$ when $A$ is the number of rows and $B$ is the number of columns. Now we are free to pick one element from each column. Lets say these elements are $E = \{ e_1,e_2,e_3,\dots,e_b \}$ and $f(E) = \max(E) - \min(E)$. Find the minimum value of $f(E)$.
I tried multiple but I can't ... |
Following the issue from Faster algorithm for a specific inversion:
We have a permutation (a derangement actually) $\sigma$ of the set $\{0,1,\dots,n-1\}$ with cardinality $n$.
I want to compute certain counts (a kind of inversion):
$$K'(\sigma )_{i}=\#\{j<i:\sigma _{j}>i\}$$
for each $0 \le i \lt n$.
With the restrict... |
There is a big 1024-bits number A that was obtained by multiplying two numbers B and C.Are there any ways to get first numerical digits of these numbers?
How example:
A(4.65467...e+1024) = B(2.25351...e+512) x C(2.62568...e+256)
I want to receive 2.25 and 2.62 accordingly.
|
I'm trying to come up with a list of rules that return an equivalent instance to the following problem, while eliminating all vertices of degree 2 or less from the graph:
Given a graph $G=(V,E)$, the goal is to know if there's a set $S\subseteq V$ of size at most $k$ such that $G-S$ is an Almost Forest.
An almost for... |
For reference, I am trying to solve this CSES Problem.
The problem basically states that given up to $10^5$ positive integers in the range $[1, 10^6]$, find the number of pairs of those positive integers that are coprime.
After some thought, I've come up with the following 3 ideas that I think may be on the right track... |
CFDG is described as a language for context free grammars which can generate images. It allows rules to have parameters, but places restrictions on them to ensure the grammar is context free rather than an indexed grammar.
In what sense can a CFDG grammar be interpreted as a context-free grammar, and how would this fai... |
I am confused between $n^3\log n$ and $n^3$. Normally $n\log n$ is better than $n^3$ but what's about $n^3\log n$
|
Let's for the sake of simplicity only focus on tuple relational calculus.
Every relational algebra query can be broken down into the 5 atomic operations - projection, selection, set union, set difference, cartesian product (I'm excluding renaming as it is not possible to do in relational calculus).
Let $P(x)$ be an arb... |
I'm read Randomized Algorithms book by Motwani, the part about Yao's min-max technique:
Consider a problem where the number of distinct inputs of a fixed size is
finite, as is the number of distinct (deterministic, terminating, and always correct)
algorithms for solving that problem.
Let $\Pi$ be a problem with a fi... |
The following is the statement of the problem:
There are 40 packets to be delivered in a day. Each packet needs to be delivered to a
particular location. Apart from this, there are constraints also that some packets need to be
delivered before a certain time. And some packets need to be delivered together
There are t... |
For $L_S=\{\langle M\rangle : L(M)\in S \}$ what is known about $S$ in case of:
$L_S\in RE$
$L_S\in R$
|
About Random Access Memory (SRAM and DRAM), if multiple read or write operation take place, many books calculate the average access time of those operations. Given the definition of access time, I think that it is wrong to talk about access time. If multiple operation take place, I think that would be better to talk ab... |
It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order.
Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, contain the same digits.
I took this to mean find the smallest x for which 2x, 3x, 4x, 5x, and 6x are all doubles, that ... |
Savitch provided an algorithm which places NL in L^2 and hence the runtime of the algorithm is bound by $2^{O(\log^2n)}$. The runtime of the algorithm is not in P as NL is not known to be in SC.
Is there a runtime analysis of the algorithm anywhere which provides worst and average case behavior of the time complexity?
|
I have a very simple question and wanted to check whether my answer is correct.
Suppose we are given a list of comparisons $x_1>x_2,..,x_k>x_i$ then consider the decision problem asks whether the ordering $>$ can be made transitive and complete over all the X.
My impression is that such a decision problem is NP-complet... |
Given directed graph $G=(V,E,\omega,s,t)$ that $\omega:E\to \mathbb{R}$ is the weight function on $E$, and we want to find shortest path from $s$ to $t$. First, we run the Bellman-Ford algorithm to finding the shortest path from $s$ to $t$, but after the termination of the algorithm, I know that if the distance of a ... |
Greetings all and thank you. I'm a Ph.D. candidate working on a force structure's 3D tessellation project and get stuck.
I've simplified the system into a set of lines linked together which formed a Line-Framework (points connectivity list). Now I want to get the tessellation of this Line-Framework in a set of minimal ... |
I need to prove\disprove that if $L_1, L_2\in RE$ then $L_1-\ L_2, L_1 - \bar{L_2}\in RE$.
Trying to prove those statements I thought about using the turing machines $M_1, M_2$ of $L_1, L_2$ respectively, but I can't simulate input on $M_1$ and $M_2$ since they might run forever.
How can I prove (or disprove) those two... |
I'm trying the following question from my homework:
We're given a graph $G$ and parameters $k,\hat{P}, \hat{W}\in \mathbb{N}$. Additionally, each $v \in V(G)$ has a profit and weight: $p_v, w_v\in \mathbb{N}$.
Suppose you're given an $f(k) \cdot n^{O(1)}$-time algorithm $\mathcal{A}$ which finds whether there is a vert... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.