instruction stringlengths 35 29.1k |
|---|
I tried watching http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/lecture-videos/lecture-4-heaps-and-heap-sort/ to understand heaps and heapsort but did not find this clear.
I do not understand the function of max-heapify. It seems like a recursive functi... |
I will preface this with the actual question taken from lecture:
An unusual pseudo-random generator outputs integers between 1 and 4, inclusive, in such a way that each value, v, occurs with a probability that is inversely proportional to v. For example, 4 is half as likely to occur as 2, and 1 is three times as likel... |
Given a regular language (by a sparse or dense matrix describing the graph of the NFA) (initially the description was supposed to be a regular expression) and a word, can the problem whether the word belongs to the regular language be decided on a (random access) alternating Turing machine in a logarithmic amount of co... |
I am trying to get around this problem of my own making. I want to generate 0 or 1 with another function(gr0_4()) which generates random number from 0 to 4.
I am wondering if I can approach this way:
a). if gr0_4() = 0 or 1 then I will use 0
b). if gr0_4() = 2 or 3 then I will use 1
c). if gr0_4() = 4 I will repeat the... |
I'm currently working with finding edit distance between two string of unequal length. But I'm sorry to say that I've got only one algorithm using Dynamic programming to find out edit distance. But I'm dealing with some cryptographic measure with edit distance where algorithm with dynamic programming is not suitable. P... |
I've seen that people prove somehow that set of all palindromes isn't regular language by using a pumping lemma, which I am not familiar with.
I've created grammar which can generate all palindromes and that is why I wonder why it's wrong.
A -> e
A -> a | b | ... | z
A -> aAa | bAb | ... | zAz
|
This is for formal-language-style regular expression and not about Unix-style regular expression.
I was trying to find the regular expression that doesn't accept empty string, doesn't accept strings composed of only 0's, and doesn't accept strings composed of only 1's. The regular expression should only accept strings ... |
Assuming $P \neq NP$, I expected that $NP - P \subset NPC$, but from the diagram on Wikipedia it appears to not necessarily be true.
What is an example of a problem that is complex enough to be in $NP - P$, but doesn't allow every $NP$ problem to be reduced to it in polynomial time?
|
I have calculated a running-time function $T(n) = 4 + 4n$, which is $O(n)$.
To determine the constant $C$ given by the relation $|T(n)| < C \cdot g(n)$,
we take
$\qquad\displaystyle \lim_{n \to \infty} T(n)/g(n)$
which gives us
$\qquad\displaystyle \lim_{n \to \infty} (4+4n)/n = 4$.
However, in the answer sheet it... |
this is homework, so PLEASE do not give me the solution(!), but help me get there on my own.
I've got to proof that directed Hamilton Path with fixed stard and ending and undirected Hamilton Path with fixed start and ending are poly-time-equivalent.
I can do that for directed to undirected no problem by adding one reve... |
Consider two possibilities for the P vs. NP problem: P=NP and P$\neq$NP.
Let Q be one of known NP-hard problems.
To prove P=NP, we need to design a single polynomial time algorithm A for Q and
prove that A correctly solves Q.
To prove P$\neq$NP, we need to show that
no polynomial time algorithm solves Q.
In other word... |
I have to do a linear programming exercise but i have some problems regarding the result. I have a graph with N nodes and E edges, that is not acyclic, and each edge is associated to a cost. I have also two nodes (marked as B and E), and I have to find the maximum path cost from B to E. Also, each edge can be used at ... |
For the problem "Find the minimum number of insertions to convert a string $S$ to a palindrome", a recurrence relation usually given is:
$$
c[i,j] = \begin{cases} c[i+1,j-1] & \text{if } S[i] = S[j], \\ \min(c[i+1,j],c[i,j-1]) + 1 & \text{otherwise}. \end{cases}
$$
(where $c[i,j]$ denotes the minimum insertions for the... |
For our assignment we have to implement a solution given to one of the problems in The Art of Computer Programming by D.E. Knuth (Ex24; Chapter 5: Sorting; TAOCP, Vol3, 2nd).
However, I fail to understand the solution given in TAOCP.
Problem:
Three million men with distinct names were laid end-to-end, reaching from... |
How do I derive a regular grammars from this regular expression?
(a or b)*ba(ba)*
I'm stuck with the last part
so
S -> A | B | C
A -> aA | bA
B -> bC
C -> cD
D->bE ?
E->af | ^ ?
Any help would be appreciated thanks!
|
Consider having an integer array $A$ with $n$ elements, in addition to any data structure you like.
The array is initialized to zeros.
The goal to to support two operations:
Update(k,v) - sets $A[k]=v$.
Small() - returns an index in which the element is smaller than or equal to the median.
Assuming that finding a sm... |
Let $L =\{ <M> | $ the amount of words $w\in\Sigma^*$ that $M$ does not halt on is finite $\}$.
I would like to prove that $L\notin RE$.
I can show that $\overline{L}\notin RE $ that is $L\notin CoRE$.
I do this with showing a reduction: $\overline{L_{acc}} \leq \overline{L} $ and since $\overline{L_{acc}}\notin RE$... |
Let's suppose we have propositional variables $x_1 ... x_n$. A valuation is an assignment $v$ s.t. $v(x_i)$ is an element of $\{false, true\}$ for $1 \leq i \leq n$. So, there are $2^n$ possible valuations. The number of sets of valuations is then $2^{2^n}$. If we associate to each formula $\varphi$ the set of valu... |
This is a problem from Sipser's book (marked with an asterisk).
$EQ_{TM} = \{(\langle M \rangle, \langle N \rangle)$ where $M$ and $N$ are Turing machines and $L(M) = L(N)\}$
We know that neither $EQ_{TM}$ nor $\overline{EQ_{TM}}$ are recognizable so unsure how to go about proving there can't be a mapping reduction fr... |
I have a $n \times m$ rectangular grid of cells, and a set $R$ of rectangles within this grid. Each rectangle is a subset of the cells. (Alternatively, you can think of them as axis-aligned rectangles where each of the four corners has integer coordinates.)
I want to find a subset $S$ of rectangles, so that $S \subse... |
I am studying a research paper which is concerned with finding paths from a source nodes to a single sink node keeping in mind 2 things.
1.The security of the path.
2.The optimality of the path.
Research paper transmission cost minimization with vulnerability constraint
The vulnerability model of paper says that the li... |
I came across the following question. Given a 2-approximation for minimum bin packing problem, find a 2d-approximation for d-dimensional bin backing.
To clarify, inputs to the bin packing problem are real numbers $x_1,...,x_n\in [0,1]$, which should be divided into $k$ bins $S_1,...,S_k$ such that for all $i$: $\sum\l... |
I recognize that the subset sum problem is NP-Complete. I have a different, yet similar problem, which I'll call subset below-sum:
Given a set of integers, $S$, and a target number, $n$, what is the number of subsets of $S$ that sum to less than $n$?
For example, if $S$ is $\{1, 2, 3, 7, 7, 15\}$, and $n$ is $20$, th... |
I am well aware of informed graph / tree search strategies for optimal solutions when one has an admissible heuristic - i.e. one that never overestimates the minimum cost from a node to any goal state.
However, what about when one only has a heuristic that never underestimates the minimum cost from a node to any goal s... |
Consider the canonical homogeneous equality type: Eq : (A : Set) -> A -> A -> Set, with constructor refl : (A : Set) -> (z : A) -> Eq A z z.
I could swear I remember reading somewhere that the equality type was essential in some sense: all other datatypes could be built using it. This would be very useful for dealing w... |
Suppose I have a binary tree containing $n$ leaves and whose depth is $d$, where the data is in the leaves (the internal nodes don't hold data values).
I want to delete a consecutive interval of leaves. In other words, suppose we order the leaves from left to right and number them $1,2,\dots,n$. I am given a pair of ... |
This is a homework I'm doing, but I couldn't find an answer, hopefully you guys can shine some light on this.
The problem is this:
You have two unknown sorting algorithms, one is Bubble Sort, the other Insertion Sort.
Identify which is which given that you can only differentiate them via differences in asymptotic time ... |
I would like to find all Euler PATHs in a directed graph.
Counting (instead of finding) all the Euler PATHs is sufficient.
Circuits are not good for me, only Paths.
I am doing a problem, that I have derived to a point, where knowing the number of paths fast would help.
Currently, I have written (in c++) a recursive f... |
A machine has 48-bit virtual addresses and 32-bit physical addresses. Pages are 8K. How many entries are needed for a conventional page table ?
The answer is 2^35 entries
Why not (2^32) / (2^13) = 2^19 entries...?
My doubt here is why does the number of page table entries depend on virtual address space rather than ph... |
The way I see it, it should not be further reducible. I'm thinking λz.zq is like
lambda z: z(q) # Python, not lambda calc
and you do not know z nor q so it is not further reducible.
The below derivation (where I am wondering about the last steps) is from the new Haskell book:
|
Does their exist a program P[m,s] which always halts and for any polytime language exists an m; possibly incomputable; such that P[m,s] accepts only those strings s which are in the language.
|
In order to show that $ \{A^nB^nA^nB^n \mid n \geq 0 \}$ isn't CFL, I was trying to use a pumping lemma this way: At first we assign $w= A^jB^jA^jB^j ,$ $(w^i=uv^ixy^iz), p<|vxy|, p<j.$
if $vy$ contains just $a$s we choose i=0 for $w^i$, so in this case the number of $a$s isn't equal to the $b$s.
if $vy$ contains jus... |
I've been reading this article which tries and explains how the max 2 sat problem is essentially a 3-sat problem and is NP-hard. However, if you see the article, I'm not able to understand why, after ci is satisfied, 7 out of 10 clauses are satisfied and if it is not satisfied, the 6 out of 10 clauses are satisfied.
C... |
I understand that, as the time step is reduced:
Consistency: The local error must approach zero.
Convergence: The global error must approach zero.
But why are both the order of convergence and consistency of explicit Euler = 1, if the global error is $O(h)$ while the local error is $O(h^{2})$?
More details: The Euler m... |
Each of n distinct values is equally likely to be put into pile 1 or in pile 2, independent of each other. These piles are then sorted from smallest to largest. The two sorted piles are then merged into a single sorted pile by comparing the smallest values of each pile, putting the smaller of these two into a new pile... |
This example followed from a Fibonacci algorithm in class. The professor showed us how to compute $T(n) = T(n-1) + T(n-2) + 3$, but left this step for us to prove, so I decided to attempt to prove it! But I am finding it difficult to fully understand how to prove things involving lower and upper-bounds. After looking u... |
I want to determine if
in a given binary tree whose nodes are integers, left subtree's
(let's call it L) nodes are multiples of (at least one) right
subtree's (R) node(s).
I only require that every integer in L must be a divisor of some number in R, but not the reverse (for every number in R, it is a multiple of ... |
Disclaimer: I know there are similar sounding questions already here and on Stackoverflow. But they are all about collisions, which is not what I am asking for.
My question is: why is collision-less lookup O(1) in the first place?
Let's assume I have this hashtable:
Hash Content
-------------
ghdjg Data1
hgdzs Data2
e... |
Consider this sum: for context sake, the summand appears in the counting of the possible ways to have one cigarette box empty and the other having left N cigarettes when both boxes start with N cigarettes in the Banach cigarette problem ; so there is a combinatorial explanation which I do not consider here.
$$ \sum_{i=... |
Could you explain me, how can I check, that the language of first context-free grammar (G1) is a subset of the language of second context-free grammar (G2).
G1 and G2 are two LL(1) grammars with identical alphabets:
{a, b, c, d, f}
Production rules are look like:
A -> αB
or
A -> α
and α is a non-epsilon string (o... |
I have an optimization problem in fuzzy logic that I want to model and solve as a CSP. If I could use only linear inequalities in my encoding, is the resulting CSP solvable in linear time?
Problem statement: Given a set of formulas in CNF in Łukasiewicz logic, I want to find an assignment for the variables in some trut... |
Can someone give me an example of Non Recursively Enumerable language... i.e. A language which no Turing machine can accept ? What makes a language non recursively enumerable ?
|
Does the Context Free Language $\{(1^n2^n)^t \mid t,n\ge0\}$ contain the string $121122$? Does $t$ fix $n$? I think the string belongs to this language.
|
Is the decision problem "Does a given context free grammar generate an infinite number of strings" decidable? In order to test whether a context free grammar generates an infinite number of strings or not, we can write a program that would test this but would not halt. So it should be undecidable. Is this so?
|
A language $L$ is said to have the "no primes" property if:
For every prime $p$ there are no words $w$ in $L$ s.t. $|w|=p$.
For every non-prime $m$ there is at least one word $w\in L$ of length $|w|=m$.
Given a language $L$ that has the no primes property, must $L$ be non-context-free?
Intuitively I believe yes, si... |
I am learning about finite automata for the first time. I am having trouble understanding the purpose of ε-transitions in an NFA, which seem to be crucial to counting the number of states in an NFA and therefore an equivalent DFA.
Here is an example question that confuses me: What is the minimum number of states a DFA... |
The heaviest part of QS is to search for bSmooth numbers.
So far I thought about two algorithms for solving this.
Trial division
calculate $X$ as a product of all the values in the factor base
speed up the trial division with $gcd(X,Y)$ where $Y$ is a potential bSmooth value
|
I am working on dense matching using DSP algorithm.
They have used belief propagation to optimize their energy function?
How do we do it?
I mean how do we assign prior belief?
Link: Deformable Spatial Pyramid Matching for Fast Dense Correspondences
|
I am trying to build a bigram letter model.
I obtain a sequence of words in a form of ['hello','I','am','Johnny'].
Firstly, I lower all the words to obtain : ['hello','i','am','johnny'].
I am capable of building a bigram letter model, but I have read somewhere that you should provide some kind of empty strings / paddin... |
From what I know of analyzing and designing approximation algorithms, we need to find a lower bound on the optimum (in the case of minimization). For example if our solution is greedy ($SOL_G$) and if we find a lower bound $L_B$ on $OPT$ then $$L_B \leq OPT$$
and if we correctly analyze the following $$SOL_G \leq f . L... |
There is a class of DP related problems where you have a set of consecutive steps, say $1 \ldots n$, and two places e.g. $A$ and $B$.
At each step $i$ there are two choices: stay where you are or change. Whatever you choose you pay a cost $A_i$ or $B_i$ depending on where you are, anyway if you change you pay also an a... |
The problem:
To generate a list of size $n$,
Containing unique integers,
Sampled uniformly in the range $\left[0,m\right)$,
In $O(n)$ time, except that:
Assuming $m$ is bounded by some word-size, $\left|m\right|$, the specific time should be $O(n\cdot\left|m\right|)$, as one cannot do better than this.
Apologies i... |
I'm trying to solve the following optimization problem.
A is a rectangular matrix with coefficients in the finite field Z/2Z (size less than 1000 X 1000). I have a system of the form A.X = Y (X and Y are vectors). And I'm looking for X such that the Hamming weight of Y is maximal.
In the best case, there would be a so... |
I have a set of $n$ two-dimensional data points $(x_i,y_i)$. I want to efficiently answer the following query: Given an arbitrary interval of $x$-values, find the highest and lowest points within that interval. In other words, for this query we are given an interval $[\ell,u]$, and we want to find the point $(x_i,y_i... |
Suppose one of the following holds for all x, or all y, or all z:
f(f(x)) = f(x)
f(f(y)) = f(y)
f(f(f(z))) = f(f(z)) = f(z)
... how do you call such a function?
|
I realized that if a language L is recognized by a DFA, then flipping its accept and reject states (aka switching all the accept to reject states and all the reject states to accept) works to recognize the complement of L (which wold be L^c).
I was curious if that worked also with NFAs (flipping the accept and reject s... |
Let's say we have 3 processes:
Process 1 service time 6 arrival time 0
Process 2 service time 2 arrival time 1
Process 3 service time 5 arrival time 3
We know that:
after 1 time, process 2 will come and process 1 will go back having 5 service time left.
then process 3 will come, after process 2 ends, at 3 time.
Now... |
I thought all regular languages could be expressed with regular expressions (if a language is regular, it can be expressed with regex), but
I have been told that you need all three of the regular operations (concatenation, union, and star) for that to hold.
For example, I have been told that if I can only use the union... |
Linear Programming is in polynomial time weakly
(when numbers are encoded in unary).
AFAIK it remains open if it is possible to solve LP
in polynomial time strongly (when numbers are encoded in binary).
My questions is about a special subclass of LP called Packing LP:
Packing LP
Variables: $\vec{x}$
Constraint... |
(there is the possibility that the answer to my question is "Traveling Salesman, dude!". If that is the case, Please just say so and I'll try it again on my own using Traveling Salesman. We have not covered that in the lecture yet.)
again I am facing homework and thus, would appreciate it, if you did not(!) give me the... |
I am a Front-End Developer with several years of experience as well as I have my B.S. in Computer Science. I am doing research and pursuing my MS in Computer Science. However, I am somewhat struggling to word my career objective correctly and in a fashion in which I could be considered for admittance into Grad School. ... |
I've been teaching myself type theory on and off over the past couple years. I've reach large sections of Pierce's Types and Programming Languages and Harper's Practical Foundations for Programming Languages, but there are still sections I need to either read for the first time or really understand.
In Harper's section... |
I have this question as an assignment in my Java Algorithms class, and i'm aware that d(n)+e(n) is the same as O(f(n)+g(n)). I dont know why the same doesnt apply to subtracting. Can someone help me? I'm lost..
|
I've been trying to solve this recurrence: T(n) = T(n-1) + O(2^n)
My approach when writing everything out and solving the geometric series was: T(n) = O(2^n).
T(n) = c2^n * (1 + 1/2 + 1/4 + ...)
= c2^n * (1/2)^i for i from 0 to infinity
T(n) <= d*2^n for some constant d.
|
I'm new to geometric algorithms and computational geometry, so please forgive me if this is an inappropriate question for this forum.
Let $X$ denote the disjoint union of $n$ one-point sets. Let $f:X\rightarrow \mathbb{R}^2$ be a function subject to some set of constraints $C=\{c_1,\cdots,c_m\}$, where $c_i=(x_{i_1},x_... |
There is this example of regular expressions:
$$(\Sigma\Sigma)^*= \{w\mid |w|\text{ is even}\}\,.$$
From that I understand the empty string is valid as a string of even length. Is this true?
|
I know that Process Context is something that is stored when a process is preempted, containing all the necessary info to restart the process at a later time.
I also know that the Process Control Block(PCB) contains all the necessary attributes of the process.
So, does that mean that the Process Context is a part of th... |
Given the following language:
$$L=\left\{\langle\phi, n\rangle \ \middle|\ \begin{array}{l}\phi\text{ is a satisfiable Boolean formula}\\ \text{written as POS (in CNF form)}\\ \text{and $n$ is a prime number}\end{array}\right\},$$
Prove that L is an NPC language.
This is the first time I'm trying to solve this kind ... |
I would like to detect all the cycles(non duplicate) in a given graph, I mean if A-B-C-A is a cycle, then A-C-B-A is a duplicate of previous one and need to be considered.I could use DFS and detect a cycle, but what if i want to continue to find other cycles? how would i make any node to be considered for other cycle?
|
$A$ is a given language so that $A \in NP$.
Assume that $P = NP$.
Is $A'$ necessarily in NP?
What I did:
$A \in NP , P=NP$
$P=coP$ (Can be proven by running a TM $M$ as a decider for P, and building a TM $M'$ and switching 'accept's to 'reject's and vice-versa).
If $P=NP$, then $L \in NP \Rightarrow L \in P$
$P=coP ... |
I am not sure if this is the correct forum for this question, but... After so much time and usage of spreadsheets and data files in general, there is a need to cater for all types of files containing all sorts of characters used as a field separator. Why hasn't a universal separator character evolved so that no-one has... |
$$L = \{\langle M_1 \rangle, \langle M_2 \rangle \mid \text{\(M_1\) and \(M_2\) are TMs and \(\forall X, M_1(X) = M_2(X)\)}\}$$
Is this language decidable, enumerable, or non-enumerable?
And in general, how can I tell if a language is decidable, non-decidable, semi-decidable, enumerable or non-enumerable? I am confused... |
hi i know that the question 5 is true because by definition w ∈ L if and only if δ*(q0,w)∩F ≠ ∅. Consequently, if δ∗ (q0,w)∩F = ∅, then w ∈ L1. "L1 is the complement of L"
but iam really confused about the question 6 our teacher told us that it's false but i think it's true because i don't see any difference betwee... |
in order to solve a DARP problem I created a Python class, that can generate random graphs. I attribute a random number to every edge which represents the cost to travel over that edge.
My current solution for connecting vertices (and so create an edge) looks like this:
def connectVertices(self, vertexA, vertexB):
... |
Given a list (of arbitrary length) of 2-dimensional points, is there some algorithm that I can employ to sort this list of points into an order such that line segments sequentially drawn from $p_0 \rightarrow p_1 \rightarrow \ldots \rightarrow p_{n-1} \rightarrow p_n \rightarrow p_0$ would form a non-self-intersecting ... |
I have implemented group of pictures parallelism for hevc encoding on distributed platform. In this we have to send different video chunks to different machines, these machines encode data in parallel and send data to master node. Here linear improvement in encoding is seen as number of nodes are increased. But now I w... |
Is it known if the problem of finding the maximum number of edge disjoint paths of length k in a DAG is in P? Or has it shown to be NP-Complete? If so, are there approximation algorithms known for it?
I'd be interested if there are FPT algorithms as well, or even run time in O(n^k).
I'm aware that if there are no lengt... |
The outer loop runs $n$ times. The inner loop runs $\lfloor \frac{n}{i} \rfloor$ times. So it would be $O(n \cdot \lfloor \frac{n}{i} \rfloor)$. I do not know how to transform that into a proper expression involving Big Oh and n. Maybe it could be first expressed as a sum:
$\qquad\displaystyle \sum_{i=1}^n \sum_{j=i}^n... |
I have written this solution for finding the Lowest Common Ancestor in a Binary Tree. Now I wanted to find the time complexity of this problem by solving via recurrence relation. Can someone suggest if the approach is correct:
public class Solution {
public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, Tree... |
I have an arbitrary collection of nodes connected by edges. I am trying to find a good way to tell if an edge/vertex is on the border or not.
The red nodes and blue lines are considered on border. Black lines and black nodes are considered interior.
All nodes are fixed to points on the Cartesian plane. It is a planar ... |
Let $A$ be a non-deterministic algorithm computing a binary relation between an input string and possible output strings. Let NX be a (potentially non-deterministic) complexity class. What is a good definition of a Turing reduction to $A$, in the context of the decision problems NX$A$ solvable by an NX Turing reduction... |
Using usual notation we have,
$SDP(G) \geq OPT(G) \geq Alg_{GW}(G) \geq \alpha_{GW} SDP(G) \geq \alpha_{GW} OPT(G)$
where we mean,
$SDP(G)$ = The maximum value that the SDP finds of the objective function $\sum_{(u,v) \in E} w_{uv}( 1-\vec{y_u}.\vec{y_v})/2$ (one unit vector $\vec{y_v}$ in $\mathbb{R}^d$ for each ver... |
So I've found out that a regular expression $n$ symbols long converts to an NFA with $O(n)$ states, it is linear.
Now to go from that NFA to the complement of the NFA, since I can't just flip accept and reject states, this means turning the NFA into a DFA.
If $n$ is the number of states in the NFA, the DFA simulating t... |
I want to prove that the problem described here
Spanning tree with chosen leaves
is NP-Complete.
Of course it is in NP, but what problem would be appropriate to reduce to prove NP-Hardness? And how would that work?
|
I have a similar question to that of Stable Marriage Problem.
This is the criteria1) 1 Student must have 1 Teacher only.2) 1 Teacher ideally should have 3-4 Students.
The spreadsheet is done using Google Apps Script (Javascript).
How do I go about with the system calculation and giving teachers the system-generated res... |
In complexity theory, we do not call a decision problem that is not in NP "NP-complete".
But in computability, do we call a machine model "Turing complete" if it can compute functions which Turing machines can not?
The definition from Wikipedia didn't address this problem explicitly, and likely assumed yes:
A computat... |
Q: What are those events (system level and architecture level) that can cause an application to take longer to terminate and complete the job?
My question is purely in the context of Worst Case Execution Time (WCET) analysis.
I have gathered a short list of events, which I think are the contributors to WCET of an app... |
I am solving the following problem, motived by combinatorial optimization sampling proces.
I have restriction (0,1) matrix to restrict which item (column index) can be on current position (row index) at permutations. For example: 4x4 case (4 position permutations)
1 1 1 0
1 1 0 1
1 0 ... |
I've been reading around the area of complexity and arithmetic operations using logic gates; one thing that is confusing me is that
\begin{equation}
\Theta (n^{2})
\end{equation}
is quoted as being the complexity for multiplication for iterative adition. But addition of a number requires \begin{equation}
log_2(n)
\end... |
Given two languages $A$ and $B$ I have been asked to show that, if $B \in L$ and we have a logspace reduction $f$ from $A$ to $B$ then $A \in L$.
I read the proof that $L$ is closed under logspace reductions in Arora-Barak's textbook. The idea of the proof is, if I'm not getting wrong, to simulate the Turing Machine $M... |
Consider the following scenario. There are N localities in a town where population for locality $L_i$ is denoted by $P_i$, $i \in {1,\ldots,n}$. We need to place K hospitals around the town in a way that the cost of accessing the hospital is minimized.
We are basically trying to
$$\min_O(\sum_{i=1}^N P_i \times C(d(L... |
I have to write an essay about shortest path calculation with Viterbi algorithm. Since I am interested in finding the path with the least weight on the network graph, I am a little bit confused how to model the network since Viterbi works only on trellis graphs. Does Viterbi require directed acyclic graph or it could b... |
Prove each languages decidable or undecidable.
{ <M> | L(M) is not recognizable}
I am not able to understand how this works. And what is recognizable language? What are the angle brackets? And of course how is language undecidable?
|
For Example when we consider a DFA that allows the strings having neither sub strings 00 or 11 I can produce the following two DFAs:
|
I've been trying to figure out if the halting problem is decidable for 3-symbol one-dimensional cellular automata.
Definition Let $f(w,i)$ denote the configuration of the system at time step $i$. More formally $f:A^*\times \mathbb{N} \to A^*$, where $A$ is the alphabet.
Definition. A cellular automaton has halted in co... |
I want to know if this problem is polynomial-time solvable or not?
The problem is: Given a nonnegative integer-valued matrix of size $2\times n$ and two nonnegative integer numbers $b<n$ and $c$.
The question is: Find a subset of the columns of cardinality at most $b$ such that the sum of each row over the subset of t... |
I've read in different sources that the amortized cost of a red-black tree rebalancing is constant (at least during the tree creation using only insertions).
How can it be proven?
|
So I'm using this method to find the min and max value of an array simultaneously where I split the array into n/2 and n/2 parts. I then keep splitting each part until I have either a pair of numbers or a single number.
What I'm trying to do now is the same thing but I'm trying to come up with a method that will always... |
Consider the following dynamic card game with a regular deck of 26 red cards and 26 black cards. A dealer draws the unturned cards one by one, and we can ask him to stop at any time. For every red card drawn, we get 1 dollar and lose 1 dollar for every black card drawn. The problem consists in finding an algorithm whic... |
Im a bit confused about the particle filter.
I understand the generic particle filter algorithm but in some literature say particle filter has predictor stage which is not mentioned in the generic particle filter.
I thought it weighed the particle based on observation. What's the predictor stage used for?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.