instruction stringlengths 35 29.1k |
|---|
In section 3.5.4 , i saw this block:
(define (integral delayed-integrand initial-value dt)
(define int
(cons-stream initial-value
(let ((integrand (force delayed-integrand)))
(add-streams (scale-stream integrand dt)
int))))
int)
Normally if this was something... |
I was going through the "write-ahead logging (WAL) rule" from the Database System Concepts text by Korth et. al, where I came across the following excerpt:
Strictly speaking, the WAL rule requires only that the undo information in the log have been output to stable storage, and permits the redo information to be writt... |
I was going through the concept of database buffering from the Database System Concepts text by Korth et. al where I came across the excerpt below.
The rules for the output of log records limit the freedom of the system to output blocks of data. If the input of block $B_2$ causes block $B_1$ to be chosen for output, a... |
As I did not find any definition of the term "appearance checking" although it is widely used, I am eager to ask as what it can be defined.
Perfect would be an example using a context free grammar.
|
Show that every Deterministic context free grammar is an unambiguous context free grammar
How can I show this ? can anyone give a proof?
|
I've got the next problem, where I have two, instead of one, knapsacks. Formally, we have items $1, \ldots , n$ and each item $i$ has a positive integer weight $w_i \in \mathbb{N}$ and a positive value $v_i > 0$. Further, we have two knapsacks of capacities $W_1$ and $W_2$. We need to pack the items into the knapsacks ... |
We use notation A determines BC in a database for functional dependency. Same way we use equations in mathematics which shows dependency of variables. We have inference rules in logics, functions in mathematics, set theoritic notations and functional dependency in DBMS.
We have relational algebra, tuple calculus. We u... |
I’m looking for a data structure that supports that store the salaries of it’s employees.
Insert(e) – Insert employee e into the data structure.
AvgDecile(k) – Returns the average salary of the k’th decile.
MedianDecile(k) – Returns the median of the k’th decile of the
salaries. The ten deciles of a data set divide it... |
Do all covariant type constructors (using scala notation) F[+A] form a functor? If so, is there a proof of that? If not, what is a counterexample?
The related Are there any type constructors which are *not* functors? is about all type constructors, not just covariant ones.
|
I have $N$ available sensors and $M$ devices. Each device needs $a$ sensors. One sensor cannot be used on multiple devices. Each sensor has two properties defined by $H$ and $R$.
Let $\sigma_{i\_H}$ be the standard deviation of property $H$ for sensors on device $i$. Similarly, $\sigma_{i\_R}$ is the standard deviation... |
I have this question: prove that the problem of testing whether a Context free grammar generates some string in $1^*$ is decidable.
I know one way to prove it. But I saw a different way of its proof which says that-
Convert the context free grammar to chomsky normal form. Then compute all derivations of length less th... |
I am taking an intermmediate course related to programming and analysis of system. I have a teacher that give us two tasks during the semester that are somewhat beyound the purpose of the course that is more toward the basics. The tasks that I am asked is
"Dissert about the analysis of complexity of algorithm. In... |
Could an application be built such that it could track a user's actions on a particular software and log them?
For example, could an application track a user's actions on MS Word, noting down when the user clicked a particular button?
The question is asked assuming, our application has no access to the code of the 3rd ... |
From a complete random graph (ER graph) after deleting an edge randomly with some probability (p) in each step how many edge deletion occurs to make the graph disconnected or break the giant component? What will be the value of p to make minimum no. of edge deletion?
Can we delay this phase transition by varying the va... |
"A string is a subsequence of a given string, that is generated by deleting some(possibly zero) character of a given string without changing its order."
Suppose we have string s="aabca" and k=3. ( I will refer the three as as a1,a2 and a3 just to distinguish them).
So number of subsequence with 3 distinct characters ar... |
long shot question but I am super stuck.
Donald Knuth has proven (p. 8 here, equation 12) that the probability that the maximum value in uniform hashing is smaller than $n/2$ is equal to 0.288. I wonder if with this information I can recover what is the expectation of the maximum value? Simulation strongly suggest 0.63... |
With a CRCW (Concurrent Read, Concurrent Write) PRAM model, it is possible to find the maximum in an array containing $n$ elements with $n$ processors in $O(\log \log n)$ time. The algorithm is:
If $n = O(1)$, solve the problem trivially;
Split the array into $\sqrt n$ parts of equal sizes. Give each part $\sqrt n$ p... |
We have the following task:
Take as input a finite set of string pairs. Each pair represents a substitution. Replace exactly one instance of the left with the right. A substitution can only be performed on x if the left is a substring of x. For example $01\rightarrow 10$ means replace one 01 with 10, and can only... |
Given grammar
$$L(G) = \{ 0^n1^m | n \ge m + 2 \}$$
What is the grammar for this?
I know the grammar for the following language:
$$ L(A) = \{ 0^n1^m | n = m + 2 \} $$
We can divide any string in $L(A)$ in the following substrings:
prefix $00$
the suffix $0^n1^n$
hence one of the grammars is :
$$S \rightarrow 00A \\ A ... |
After searching the internet for a bit, I found that the same proof came up over and over again.
The thing is, it seems like the proof is incomplete. Here's the proof:
However, the recursive languages are not closed under homomorphism. To see why, consider
the particular language L consisting of strings of the form (M... |
I'm currently working on problem in which a set of graphs $T=\{t_1,\dots,t_n\}$ is given and fixed.
Given a graph $m$ I want to check which of the $t_i$ are subgraphs of it, as quick as possible.
Is there any way to organize the graphs in $T$ beforehand to speed up this procedure?
I found that using a substructure scre... |
I'm studying for a computer vision module and I'm on the deep learning topic, in one past paper we have the following question:
Given that a convolutional neural network has five convolution layers (all the convolution layers are composed of 3×3 convolution filters with stride 1 and no pooling layers), calculate how ma... |
I know that in the Internet layer, the source ip and mac address and destination ip and mac address are added to the header. Is this the ip and mac address of the next router we take to get to the end router or just the ip and mac address of the computer we are sending the data too.
|
Let $T$ be an arbitrary data structure for a dynamic set. For every state T of $T$, let $d_t \in \mathbb{N}$. Observe two Operations $O_1, O_2$ on $T$ whose runtimes are proportional to $d_t$ and $O_1$ does not change the structure of $T$. Let $f\colon \mathbb{N} \mapsto \mathbb{N} $. Suppose there exists a potential ... |
I am trying to find an efficient algorithm for the following problem:
Input:
weighted directed graph G=(V, E) in which all edges are weigthed either 1 or 2
s,t ∈ V
n ∈ N
Output
shortest path from s to t that contains exactly n edges of weight 2
I have been experimenting with different modifications of Bellman-Ford,... |
I've been tasked with figuring out the best way to implement record linkage between multiple data sources. My suspicion is that supervised approaches will increase accuracy over unsupervised approaches as long as we are willing to do a clerical review to create a training data set that is large enough to be representat... |
in the base case of the inductive definition of the operations of the relational algebra there is also the so called "constant relation" (as for example found in the definition here https://www2.cs.sfu.ca/CourseCentral/354/zaiane/material/notes/Chapter3/node9.html). However, until now I have not understood the followin... |
In Types and Programming Language's constraint typing rules (Figure 22-1), is it possible for any part of the typing derivation to contain free type variables that aren’t part of the fresh variables? Because the typing rules are based on the simply-typed lambda calculus with an infinite number of base types, a naïve re... |
I try to delete a node, $z$, with 2 children in binary search tree by exchanging $z$'s right child and $z$'s predecessor, $y$, right child, which is NULL because $y$ has no right child, if it had then that child would have been the predecessor. Now $z$ has only 1 child and can be removed in the same way a node with 1 c... |
If $A \le_p B$ and $B\in NP$, does it necessarily follow that $A\in NP$?
($\le_p$ is a polynomial many-one reduction)
A quick yes/no comment is enough, a proof would be nice :-)
|
In a splay tree, doing $m$ sequential search operations for the same key that is in the tree has a time complexity in $O(n+m)$ where n is the number of nodes in the tree. Since the first search has a worst-case complexity of $O(n)$ and afterwards the node we're looking for is the new root, so further search operations ... |
L = {0^p
|p is a prime}. So was looking at the explanation at the bottom of page 5 of the following website: https://www.ics.uci.edu/~goodrich/teach/cs162/hw/HW5Sols.pdf
I want to make sure that I understand every component of the problem.
Why do they choose at least n + 2 when deciding k?
Does the statement |vx| = m... |
We define a new model: A "100-PDA" is a pushdown automaton with at most 100 states and with at most 100 symbols in the stack alphabet. Prove or disprove the following statement: "There exist infinitely many context-free languages on the alphabet {a,b} which cannot be recognized by any 100-PDA."
I haven't been able to c... |
Let $C$ be an uniform complexity class for example $NL$ or $NP$. Is there distinction between $(C/poly)\cap(coC/poly)$ and $(C\cap coC)/poly$?
|
hello I have written the sequence of configurations for the following Turing machine for input 00 but my answer has been marked wrong and I'm not sure where I have gone wrong I have fried it 3 times.
this is the turning machine
|
I am trying to convert the following CFG to CNF:
S -> ABS | ε
A -> BSBa | a
B -> Ba | a
The finally result looks like this:
S -> AS’ | AB
S’ -> BS
A -> S’B’ |BB’ | X
B’ -> BX
X -> a
Y -> b
B -> BX | XY
I am fairly new to chomsky normal form, so can anyone verify that I did this right?
Thank you in advance!
|
Let $P$ be a polygon. For each point $x$ on the boundary of $P$, denote by $N_P(x)$ the set of points in $P$, that are nearer to $x$ than to any other point on the boundary of $P$.
Given a subset $X$ of the boundary (e.g. an interval contained in one of the sides of $P$), what is an algorithm for computing $N_P(X)$?
He... |
Given alphabet $\{0,1\}$, we want to uniformly sample $x,y \in \{0,1\}^n$ such that $ed(x,y)=k$, where $ed$ denotes the Levenstein distance, i.e., the minimum number of edit operations (insert, delete, substitute) that can transform $x$ to $y$.
Clearly, this can be done by brute force over all pairs of strings, which i... |
$$
L=\{a^ib^jc^k \;| \;i, j, k \in \mathbb{N} \; \text{and} \; i <k<j\}
$$
I need to show that this language is not context-free with the help of the Pumping Lemma.
My first intuition is, that there exist 5 different cases, i.e. the middle part, let's call it vwx, consists of
only $a$'s
only $b$'s
only $c$'s
$a$'s and... |
Hopefully, this question is fine.
I'm referring to the NP-complete problems regarding hamiltonian graphs.
I suppose the C in HC is from Cycle or Circuit. It seems like Circuit is more popular.
HL (called HAMPATH sometimes) is a bit more difficult. HL deals with hamiltonian paths (HP is already in use, of course). My b... |
The question says:
Design a sequence detector that searches for a series of binary inputs to satisfy
the pattern 01[0*]1, where [0*] is any number of consecutive zeroes. The
output (Z) should become true every time the sequence is found.
The answer to this example in the document I am reading is this:
My question is... |
That the presence of voltage across a switch encodes 12 is purely arbitrary... Jeff Duntemann's book mentions:
We could as well have said that the lack of voltage indicates a binary
1 and vice versa (and computers have been built this way for obscure
reasons)
I find this (italicized part) interesting. It would be gre... |
This video shows a grid maze with a type of tile that I'd call turnstiles.
The mechanics of those tiles are described below.
A turnstile tile has two bars on adjacent sides of the tile.
You cannot step into a turnstile tile if it would mean crossing a bar.
You can exit a turnstile tile in any direction.
If you exit th... |
I have implemented Suurballe's and Bhandari's algorithms into a project I am currently doing based on this:
http://www.macfreek.nl/memory/Disjoint_Path_Finding
And it seems to work really well. However, what I am doing now is having a start and end node, from which the disjoint paths are calculated.
The extension is, t... |
We are given an array of $n$ Strings with total Length $K$, and we are asked to find an alphabetical order (if one exists) with respect to which the array become lexicographically sorted. The time complexity should be $O(K)$.
I think we should use some data structure like a trie, but I can't find a way to solve the pro... |
Let us consider a Directed Acyclic Graph $G(V,E)$ such that all edges have unit weight. Let $s$ be a source node, $s\in V$ and a set of destination nodes, $D\in V\backslash s$. My problem is to find a node $d\in D$ such that $d$ has a path of unique length $l>0$ from source node, $s$ to destination node, $d$ (i.e no ot... |
Given two integer arrays a and b and a map m which for each element e of the array a returns an array p of possible mappings, map every e of a to an element k of b so that m[e] contains k, no element of a or b is mapped twice and the number of non-mapped integers in a is minimal. Note that both a and b may have repetit... |
Check whether the following language is context-free. If yes, a suitable grammar should be given; if no, the pumping lemma should be used as a tool.
$$L=\{a^ib^jc^k \mid i, j, k \in N \text{ and } i <k<j\} $$
Can I choose (since N includes 0)
$$ L=\{b^jc^k \mid j,k >= 1 \text{ and } j > k\} $$
and provide a grammar for... |
The Wikipedia page for strong and weak typing says:
"Strong typing" generally refers to use of programming language types in order to both capture invariants of the code
What is "invariants of the code"? There is no link for that
|
I am struggling to wrap my head around using $\Omega$-notation to describe worst-case running time of an algorithm, or $O$-notation to describe the best-case running time. Specifically, I struggle to understand how a given function $f(n)$ can have a worst-case lower-bound of $\Omega(g(n))$ without also having $O(g(n))$... |
Swarm intelligence and Multiagent systems are both a part of Distributed AI. Multiagent systems describe a system with agents, which communicate with each other.
Swarm intelligence describes systems, which coordinate through decentralized control and self-organization.
However, I am unable to name an example for a Mult... |
I am new in complexity theory and I am trying as part of an assignment to prove or disprove this.
I am thinking this is a true statement but I am not sure how to prove or disprove it or what the implications of $NP \neq coNP$ are to randomized complexity classes.
|
Is it true that if $S\in\left(NP\bigcup coNP\right)$ then $\overline{S}\in NP\bigcap coNP$?
I couldn't find any answer to that question.
My attempt at proving it:
If $S\in\left(NP\bigcup coNP\right)$, then, by set theory, $S=A\bigcup B$ for some $A\in NP\wedge B\in coNP$.
Therefore the complement of $S$ is $\overline{S... |
A key breakthrough is that the author of the best selling book on the
theory of computation MIT professor Michael Sipser has agreed that the
following verbatim paragraph is correct:
If simulating halt decider H correctly simulates its input D until H
correctly determines that its simulated D would never stop running
u... |
You are given a list of days numbered 0 to 365 in the calendar year where you need to be in a hotel. You need to book in advance for the year and need not necessarily be there when you have a booking. You can also book only in fixed intervals of 1, 7, 15, or 30 days. You have to be find the minimum cost of booking to s... |
A proper prefix of a string $s$ that is also equal to a suffix of $s$ is called a PS (prefix-suffix).
Given a string $s$ of length $n$ is there an algorithm listing the lengths of all the PSs in $O(n^{1+\epsilon})$ time?
KMP can find the longest PS in linear time. Then we can note that the second longest PS is the long... |
I'm looking for some problems that have higher degree of unsolvalbilty in term of arithmetical hierarchy that requires more than 2 quantifiers like $\Pi^0_3$ ,$\Pi^0_4$ etc.
|
I've been looking through research papers and the internet and found many claims that "compiler optimizations can cause irreducible control flow". However, I was not able to find a single example of how that can happen. In particular, in [1], there is written that tail recursion elimination in combination with inlining... |
Given a decimal number N (which has at most, 10^6 digits, actually we should look at it as a string!) and another decimal number M (which has K digits, 1 <= K <= 10^6 ), we are asked to find all number in range (1, N) where K first digits and k last digits of that number looks like M.
I try the following method (on pap... |
Question: Find an algorithm which returns the weight of a lightest path between all paths with a weight divided by three in a graph with natural weights of the edges.
My instructor has given me a hint of doing calculations modulo three and creating a new graph and applying Dijkstra's algorithm on it.
I have no idea how... |
I'm solving problem 13.17 of What can be computed?, which is asking to prove $\text{SubsetSum} \equiv_{P} \text{SubsetSumWithFives}$.
Here is the definition of SubsetSumWithFives.
SUBSETSUMWITHFIVES: it is identical to the decision variant of SUBSETSUM, except that we may use up to 10 extra packages with weight 5 when... |
Right now I am learning about Fibonacci heaps for the first time.
After the minimum Node of a Fibonacci heap is extracted you consolidate it, to give it a better structure and execute future operations faster.
But why don't you consolidate the Heap more often, like after the insertion of 10 nodes with no consolidation ... |
I'm solving Problem 14.4 of What can be computed?.
14.4 Define the decision problem SAT-5CLAUSES as follows. The input is a Boolean formula B in CNF. The solution is “yes” if it is possible to simultaneously satisfy at least 5 of B’s clauses. Is SAT-5CLAUSES NP-complete? Give a rigorous proof of your answer.
Is there... |
Please Note: I forgot a small detail which caused the algorithm to be incorrect, please read the new version and thanks for pointing that.
I am stuck on this question for a week and hope to get some help:
Algorithm:
Given 2 sided Graph ie bipartite graph G(L,R,E), a weight function and a root vertex s:
Define E1 as ... |
Any directed graph (including a directed cyclic graph or DCG) has a complexity measure. We know that NOR is a universal logic gate, in the sense that a DCG whose nodes are n-input NOR gates can represent any computable number. We also know that Pi is computable. Hence there are an infinite number of NOR DCGs that co... |
For 3CNF-SAT problems exists a lot of algorithms that still have exponential complexity, but work faster than brute force. The complexity of this algorithm based on a number of variables or the number of clauses (they can't differ a lot because polynomially bounded to each other in 3CNF).
But for CIRCUIT-SAT size of th... |
I have a red black tree, $T$, and I need to write an algorithm to find 2 nodes $x$ and $y$ so that $key[x] + key[y] = 2 \cdot key[p(x, y)]$, where $p(x, y)$ is the lowest common ancestor of $x$ and $y$, i.e $x$ is a node on $p(x, y)$'s left subtree and $y$ a node on the right subtree (or the other way around)
My origin... |
My case is a directed graph with $n$ nodes with $(n-1)^2+1$ edges. I have done the following till now.
We know that the maximum number of edges for a directed graph $K_n$ on $n$ nodes is $n(n-1)$ edges. The graph in my problem statement is $G(V,E)$ with $|V| = n$ and $|E|$ = $(n-1)^2+1$.
Now, $n(n-1) - ((n-1)^2 + 1) = ... |
I'm trying to separate people from a pool into several smaller groups. The group-size should always remain the same. People can be part of several groups - but no two people can be part of more than one group.
members = [A,B,C,D,E]
group1 = [A,B,C]
group2 = [A,D,E]
There aren't anymore valid groups possible.
A can't ... |
Lets say I have 6 point name A, B, C, D, E, F.
Distance between a point and it's nearest 3-4 points are known i.e the displacement.
Now I want to assign x and y coordinates to them assuming one point as (0, 0).
The origin point can be taken as input from the user. But nothing more than that.
Sample input :
Distance bet... |
I want to show that $Primes \in NP$ an I've seen multiple proofs that use facts from number theory, like this one.
But isn't it much easier to proof
$$Composites=\{x\in \mathbb{N}\cup\{0\}:x=1 \vee\exists p,q>1: x=pq\} \in NP$$
first and then doing a polynomial reduction on $Primes$?
Because I can make a simple Turin-M... |
The maximization problem of the 3-way number partitioning reads as follows:
given $n$ positive integers, partition them into 3 subsets such that the smallest sum is as large as possible. It is known to be NP-hard, but does it have an FPTAS?
I found answers for some related problems:
There is no FPTAS for MSSP (Multipl... |
// Linz Turing machine H --- H applied to ⟨H⟩
H.q0 ⟨H⟩ ⟨H⟩ ⊢* H.qy // H applied to ⟨H⟩ halts
H.q0 ⟨H⟩ ⟨H⟩ ⊢* H.qn // H applied to ⟨H⟩ does not halt
Do you halt on your own Turing Machine description ?
Of the infinite set of implementations of H every one that transitions to H.qy derives an answer consistent with ... |
Consider the following operation on strings: pick a (not necessarily contiguous) subsequence, remove it and then append all the characters in the same order at the end. This operation preserves the length of the string.
For example starting with $S=abc$ this operation can get you all the permutations of $a, b, c$ excep... |
After a bit of surfing, I have found that Schönhage–Strassen (without taking in consideration recent optimizations) seems to be the base algorithm to perform the requested operation. Anyways, this algorithm is focused on "raw" multiplication of two integers $a$ and $b$, if a sufficiently large $N$ is chosen (the multip... |
Imagine you have a noise-free NOT gate, and an AND gate with the usual truth table
00 0
01 0
10 0 (*)
11 1
but such that the case (*) is wrong 1/3 of the time, i.e. it gives 1 with probability 1/3, and 0 with probability 2/3.
Is this gate family universal, in the sense that one can write a logic formula with these ... |
Given an integer $d$, I need to devise a data structure $S$ with the following actions:
BUILD(S): build the data structure $S$ from $n$ elements in $\Theta(n\lg{n})$
INSERT(S, k): insert a new element to $S$ with the key $k$ in $\Theta(\lg{n} + d)$
DELETE(S, k): delete the element in $S$ with the key $k$ in $\Theta(\l... |
I cannot think of a PTIME algorithm to find a rejecting input of an NFA. While it is possible to efficiently find a rejecting input for a DFA, converting an NFA to DFA is too expensive.
The algorithm should have the following behavior: Given an NFA $A = (Q, \Sigma, \Delta, q_0, F)$, if $L(A) = \Sigma^*$, then return th... |
The task is to make data structure with the following operations:
query: takes two arguments s and t and returns true if they are in the same set and false otherwise.
union: takes two arguments s and t and creates a union of the two sets that contain s and t such that if s is in S and t is in T it removes S and T and r... |
What is the relations between $\mathsf{DTIME}(2^{O(n)})$ and $\mathsf{DTIME}(n^{O(\log n)})$? Is one contained in the other?
|
I have a regex $R=\epsilon+1+(\epsilon+1)(\epsilon+1)^*(\epsilon+1)$ which has to be simplified by algebraic operations. As we can do,
$\epsilon+1+(\epsilon+1)(\epsilon+1)^*(\epsilon+1)=\epsilon+1+(\epsilon+1)^+=(\epsilon+1)^+$ but the answer is $1^*$.
Can anyone please help me to find this with step by step solution?
|
Suppose one has a large sparse symmetric positive definite matrix $A$ and wants to multiply it by a vector $x$. Only the lower triangular part of matrix A is stored/known. The multiplication $Ax$ should be as efficient as possible, as it has to be performed many times and $A$ is large (millions of rows and columns). Is... |
I am trying to think of an algorithm such that giving a graph $G(V,E)$, and a weight function $w\colon E \to \mathbb{N}_+$ (which means giving every edge in the graph a positive weight), and a source vertex $S$, the algorithm finds the shortest path between each $v \in V$ and $S$, such that the weight of the path is di... |
I am considering the following problem $\mathcal{P}$.
$\mathcal{P}$: Given an undirected graph $G$, and an integer $k$, find a set of vertices $S \subseteq V(G)$, with $|S| = k$, such that the number of edges in the subgraph induced by $S$ is minimized.
which is clearly NP-hard, as the answer is 0 iff there is an indep... |
In the following paper :
Czopik, J. (2019) An Application of the Hungarian Algorithm to Solve Traveling Salesman Problem. American Journal of Computational Mathematics,9, 61-67.
In the Introduction, the author claims that the problem is NP-hard. They proceed to give a exact solution in polynomial time.
My problem is ... |
There is an exam and the marking pattern is -
0 marks - Unattempted
4 marks - Correct Answer
-1 marks - Incorrect Answer
And total number of question is 30. Find the total marks ( in integer ) which are not possible to obtain in the exam. eg.,119 , 118 , 117 etc are the marks that I can think of. Is there any way t... |
I designed a program to create a map in my 2D game program. And I have three questions...
algorithm:
step1:
create a cell in (0,0), and select it as first cell, and mark the step1 is round 0
step2:
in round i (start from 1), for every cell created in i - 1 round :
for adjacent index in up, down, left, and right:
... |
I created a grammar which accepts all arithmetic expressions consisting of $+,-,*,/, (, )$.
I created the following grammar:
$S \rightarrow M+-M$
$+-M \rightarrow +M+-M$
$+-M \rightarrow -M+-M$
$+-M \rightarrow \epsilon $
$M \rightarrow E*/E$
$*/E \rightarrow *E*/E$
$*/E \rightarrow /E*/E$
$*/E \rightarrow \epsilon$
$... |
The question is:
The language L contains $DFAs$ which can accept languages equal to $\Sigma$*
prove this language is decidable.
I'm new to the Decidability topic and I don't know where should I start proving this?
reduce? Rice theorem? or we don't need things like reducing and...I would appreciate it if someone teache... |
Given $n$ images placed in indexes $x_1 < x_2 < ... < x_n$ and an endless number of guards, where each guard if placed in index $y$ can protect $[y-0.5,y+1]$. I want to protect all images with minimum possible number of guards.
My suggestion for an algorithm:
Place a guard at $x_1+0.5$ then loop from $i=2$ to $i=n$, ... |
I wondered about the following quote from NC (Wikipedia):
$NC^i$ is the class of decision problems decidable by uniform boolean circuits with a polynomial number of gates of at most two inputs and depth $O(\log^i n)$, or the class of decision problems solvable in time $O(\log^i n)$ on a parallel computer with a polyno... |
I'm taking the Design and Algorithms Part -II course in Coursera by professor Tim Roughgarden. In one of the classes, he mentioned that the running time for Dijkstra is $O(m \log n )$ using the heap data structure where $m$ is the number of edges and $n$ is the number of vertices. Also, he mentioned that using an exoti... |
Suppose a rectangle $R$ is partitioned into more than one smaller rectangles of positive area. What is the fastest algorithm to find the largest rectangle strictly within the all-enclosing rectangle $R$ that is a union of the partitioning rectangles? Of course the dumbest algorithm is simply taking all distinct pairs o... |
I'm interested to know what is the biggest known $0\le \epsilon\le 1$ such that the $gap-EQUALITY$ problem that is defined by:
$$f_\text{GEQ}(x,y)=\cases{1&$x=y$\\0 & $x$ and $y$ differ in at least $\epsilon\cdot n$ positions\\\text{undefined}&otherwise}$$
Still requires $\Omega(n)$ communication bits?
Thanks!
|
Assume we have weighted DAG (directed-acycle-graph), source s and target t.
Define the number of edges as $E$.
Given $0<\alpha<1$:
Choose $\alpha*E$ edges to cut their weight by half so that the longest path from s to t is minimized.
Personal note:
We've been asked this question by our professor.
I assume the problem i... |
Stable matching problem and $STCONN$ can be solved using comparator circuits (refer https://arxiv.org/abs/1208.2721).
What is the depth of the $CC$ circuit necessary for stable matching? Is it in $CC^1$ or in other words $O(\log (n))$ depth comparator circuit?
What is the depth of the $CC$ circuit necessary for $NL$?... |
The standard circuits $AC^i$, $NC^i$ are constructed using $AND$, $OR$ and $NOT$ of various fan-ins, fan-outs and depths.
What is the comparator gate constituted from?
Structurally why is it believed $NC^i$ is not in any $CC^j$ if $i\geq 1$ and why is it believed $CC^i$ is not in any $NC^j$ if $i\geq 1$ (refer https://... |
Given two arrays of integers, please write a function that returns all elements present in one of the two arrays but not both. E.g. f([ 1, 3, 5 ], [ 1, 2, 4, 5 ]) -> [ 2, 3, 4 ]
I know I can do this with two for loops that is O(n^2) but is there any better way ? Please help
|
There are n cities [1, 2, 3, .... n] and k available hospitals. k < n. We need to place hospitals into the cities. How to place these hospitals to minimize the average distance from each cities to the closest hospitals.?
Right now my thought is using dynamic programming with a 2D array of size n * k. Then I know optima... |
Given a rectilinear polygon, what is an run-time efficient algorithm that finds the largest inscribed rectangle the sides of which either parallel or perpendicular to the sides of the rectilinear polygon? A dumb algorithm to form all the rectangles formed from unordered 4-tuples of the edges, for each of the rectangle ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.