instruction stringlengths 35 29.1k |
|---|
Speaking of context-free (and maybe regular? or just any?) languages, what do you call a function defined as follows:
Let $\Sigma$ be the alphabet of $L$, $\forall \sigma \in \Sigma: f(\sigma) = L'$, where $L'$ is some language. I also met this definition: $f:\Sigma \to 2^{\Delta^*}$.
The reason I'm asking this is beca... |
Let $G=(V,E)$ be a DAG. For each $v\in V$ you have a color $c(v): V \rightarrow \left\{c_1 \ldots c_k \right\}$ where $k$ is a fixed number, and a weight $p(v)$. For every $v \in V$ you have to find its descendant that has the same color and the lowest weight.
The problem requires an algorithm that runs in linear time.... |
I understand how the layer works to an extent, but cannot seem to figure out if the data link handles big frames more efficiently due to error detection or small frames better.
I am assuming from my understanding that the data link works better with small frames as it can save time by not having to keep retransmitting ... |
I have this java function:
public int foo(ArrayList l, int n)
{
if(n <= 1)
return l.get(0);
if(l.get(0) < l.get(1))
l.remove(1);
else
l.remove(0);
foo(l, n-1);
}
So I figure to show that the algorithm is correct I would use an induction proof. However what I am not so sure about is how to go abou... |
I am trying to find any datastructure/algorithm suitable to index & retrieve domain names & its associated documents.
The records that need indexing will typically be like:
www.facebook.com, 123
stackoverflow.com, 1231
www.facebook.com, 124
stackoverflow.com, 3456
cdn.facebook.com, 4566
google.com, 903002
google.co.nz,... |
I'm trying to show the set of all recursively enumerable sets is closed under concatenation. I'm trying to use the definition of recursively enumerable sets to construct the argument. I believe that I must consider the Cartesian product $S_1\times S_2$ of two recursively enumerable sets $S_1$ and $S_2$. Then I constru... |
I'm looking for an online algorithm that takes a stream of elements and preserves the elements that are on the Pareto frontier (e.g. all non-dominated elements).
For instance. Given the following inputs, the retained Pareto frontier set would evolved as follows:
(3,7)
insert element b/c it's the first element
pareto... |
A program can have finite output, yet still not halt. Example:
1: output "Yolo"
2: output ""
3: go to step 2
This only ever outputs "Yolo", despite never halting.
Is there some way, with a halting oracle, to determine whether a program will have infinite output or not?
Bonus: If not, what would be the Turing Degree of... |
I am aware that there is a considerable amount of interest in computational mechanics for simulation of cloth, hair and other elastica, particularly for animation films. The methods developed by groups in computational mechanics (that I am aware of) are typically far from real time.
My question is if there are any dep... |
In NLP, rule-based/linguistic approaches are usually said to provide relatively high precision but low recall compared to for example machine learning approaches. I think this is often true for almost any classification task in NLP. However, I couldn't find a paper which specifically examines this phenomena. Can someon... |
I'm currently reading about algorithms and big O notation.
I have come across som examples which for instance says the following:
n is O(n^2)
3n^2 + 7n is O(2n^2 + n)
5n^7 is O(2^n)
3^n is not O(n^4)
(1/n)^2 is not O((1/n)^3)
n^2 is not Ω(n^3)
Can somebody explain to me what is meant with these sentences?
I know wha... |
I have been trying to solve the following recurrence:
$$T(n)=T(n-1)*T(n-2)$$
The initial conditions are $n \ge 2$ and $T(0) = 2$ and $T(1) = 4$.
I started by taking the $\log_{2}$ of both sides to get
$$\log(T(n)) = \log(T(n-1)) + \log(T(n-2))$$
which looks an awful lot like a Fibonacci recurrence.
So if I set $S(k)... |
I have been researching on finding optimal solutions to generating University Time Table using Genetic Algorithm. I am searching for a Academic Paper, that properly defines the University Time Table design problem and proves it is NPC.
|
I am trying to implement k-shortest paths algorithm in NS-3 for IPv4GlobalRoutingProtocol. I am concerned about how to avoid looping of packets. My implementation calculates k-shortest paths from every node to every other node in the network and accordingly I store the possible nexthops (to which the packet may be forw... |
Let $c\in \mathbb{N}$. Denote: $L _c= \{ \langle M \rangle \mid \exists _{U \subseteq \Sigma ^* }$ s.t. $|U| $ is infinite and for each $w\in U $ the TM $M$ accepts $w$ within no more than $c$ steps $\} $.
I would like to prove that for any given $c$ the language $L_c \notin R $.
I would like to find a language $L \no... |
A semaphore is a variable that, apart from initialization is accessed through only two standard atomic operations wait(s) and signal(s).
wait(S){
while S <= 0
; //no-op
s--;
}
signal(S){
s++;
}
The function $wait()$ is an atomic operation which means that either it is executed in its entirety or it is... |
Question: Given $n$ points in metric space, find a pair of points with the largest distance between them.
If we restrict ourselves to $d$-dimensional Euclidean space then, a naive algorithm of finding distances between all pairs of points in a space of dimension $d$ and selecting the maximum requires $O(dn^2)$ time.
... |
I've been unable to find what class of languages is recognized by PEGs. The original paper [1] only conjectures that there are some Context-Free Grammars that are unrecognizable by PEGs. It also demonstrates how to construct a Top-Down Parsing Language grammar from PEG, but I've been unable to find what language is rec... |
Diameter of the tree is defined as a long path or route, between any two nodes in a tree. The path may or may not goes through the ROOT.
Print the Longest leaf to leaf path in a binary tree and its length
I worth an algorithm that calculates the diameter in Swift:
func diameter() -> Int {
return diameterHelper(root).D... |
I am trying to solve the following equation using master's theorem.
$T(n) = 3^n T(\frac{n} 3) + O(1)$
Extracting the b and $f(n)$ values makes sense they are $b=3$ and $f(n)=1$. I am not sure what my $a$ value is I don't think its just 3.
|
I have the following problem, and I try to prove that it is semi-decidable, but I have a hard time arguing about it.
I know that if a problem $\mathcal{P}$ is semi-decidable, then we can build a program $\Pi$, such that $\Pi$ takes as input instance $I$ of $\mathcal{P}$, and if we have a positive instance, then $\Pi$ ... |
A typical HDD would represent information as either 1 (e.g. spin up) or 0 (e.g. spin down). Let's assume you want to represent the information physically in a hex system with 16 states, and assume this is possible with using some physical form (maybe the same spin).
What is the minimum physical size of a memory element... |
Let $L_{NTF} = \{ \langle M \rangle \mid $ for every $x\in\Sigma^* $ the machine $M$ does not reach the $|x|+10$'th cell during its calculation on $x$. $ \}$.
I would like to prove or disprove $L_{NTF} \in RE$.
I know how to easily prove that $L_{NTF} \in Co$-$RE$, because it is enough to find one word $x$ such that $M... |
I am reading a computer theory book and came across the following example converting a NFA to a DFA:
My question is, would you not need an edge labeled $b$ going from the $x_4$ node on the right to the null collection state?
|
I am trying to find Big O of this formula: $T(n)=T(n-1)+2n$ by using iteration however I am stuck on a step.
$T(n)=T(n-1)+2n$ I then plugged $T(n-1)$ into the equation so $T(n-1)=T(n-1-1)+2(n-1)$ which then I got $T(n)=T(n-2)+2(n-1)+2n$. $T(n-2)$ gives $T(n-3)+2(n-3)$ which plugging it back in gives $T(n)=T(n-3)+2(n-3)... |
Considering the top answer to the question “If xor-ing a one way function with different input, is it still a one way function?”…
The function is no longer one-way.
we build a counter example in the following way. Assume $g$ is a one-way function that preserves size, and define $f$ on input $w=bx_1x_2$ in the followi... |
I know that Insertion Sort is faster when size $N$ is a small number, hence by modifying Merge Sort to use Insertion Sort when size $N$ reaches $K$, can help improve the performance.
How do I analyze this and prove that the running time of Merge Sort, $O(N \log N)$ is turned into $O(NK + N\log N(\frac{N}{K}))$?
I wou... |
In CPU scheduling HRRN(Highest Response Ratio Next) algorithm chooses the next process to be scheduled using the formula (W+S)/S where W-> waiting time &
S->Service Time. Can someone share their intuition behind this formula? How does this calculate Highest Response Ratio?
|
I am trying to write a program to recognize if a given lambda calculus expression is primitive recursive. I believe that a general algorithm to do this does not exist, but I am interested in the most general algorithm. This is a subset of the primitive recursive functions in the LC.
Primitive recursion is built up fro... |
I was reading Application of DFS from here where I came to a statement which I cannot really understand. Would anybody mind explaining this to me.
For an unweighted graph, DFS traversal of the graph produces the minimum spanning tree and all pair shortest path tree.
My doubt: Is there anything "Minimum spanning tree... |
Given an N sized array A of unsorted integers and an integer K, derive a square matrix M of order N where $ M_{ij} = A_i * A_j $, and return the number of sub matrices of M where the sum of all of its elements is K.
Example:
$A = \begin{Bmatrix}1&-1\end{Bmatrix}$
$K = 0$
Thus:
$M = \begin{Bmatrix}1 & -1\\-1 & 1\\\end{B... |
I am looking for a formula for determining the expected number of independent sets of size $k$ (for arbitrary $k$) in a random graph $G(n,p)$. Here $n$ is the number of vertices and each edge is included with independent probability $p$. I would like to be able to calculate this for arbitrary $p$ if possible.
I have co... |
A process running on CTSS (Compatible Time Sharing System) needs 30 quanta to complete. How
many times must it be swapped in, including the very first time (before it has run at all)?
•
Answer : The first time it gets 1 quantum. On succeeding runs it gets 2, 4, 8, and 15, so it must be swapped
in 5 times.
why does it g... |
Let $P$ be a problem that you need to study its difficulty, i.e., NP-hard, Polynomial-time solvable, etc.
My question is: If I reduce a known polynomial time problem (say,
maximum matching in bipartite graph) to $P$, why I can say that $P$ is an
easy problem?
My guess is: No, we cannot say that.
Why? Because f... |
Let $A$ be an arbitrary set in PH. Suppose PH$^A$ collapses.
I am now asked to show that PH itself must collapse.
I have remarked that, since $A$ is in PH, $A$ must in particular be in one of the $\Sigma_i$'s, say $A\in\Sigma_n$ for $n\in\Bbb N$. Also, PH$^A$ collapses, so PH$^A = (\Sigma_m)^A$ for some $m\in\Bbb N$.
B... |
Is is more accurate to say that in complexity theory:
$$\text{exponentiation} \leq_p \text{multiplication}$$
or
$$\text{multiplication} \leq_p \text{exponentiation}$$
I understand that if we know how to do multiplication, then we can run multiplication in a loop in polynomial time to get the answer to the exponentiatio... |
Let:
f be a decidable decision problem.
g be an undecidable decision problem.
I refered to those rules:
If $f$ reduces to $g$ and $g$ is decidable $\implies$ $f$ will be decidable.
If $f$ reduces to $g$ and $f$ is not decidable $\implies$ $g$ will be not decidable.
Questions:
1) It may be possible to reduce $f$ to... |
I'm struggling to find how to calculate the channel capacity from a binary symmetric channel, given
alpha(mean error) = 0.25
p(x1) = 0.25, p(x2) = 0.75 r = 1.25MBits/sec
I found this in the course:
C = r . { 1 - omega(alpha) }
So I'd have
C = 1.25Mbits/sec * { 1 - omega(0.25) }
However, I'm stuck on how to calc... |
The minimum zap problem below is Exercise 11 in Jeff Erickson's lecture on "Greedy Algorithm".
The minimum zap problem can be stated more formally as follows. Given a set $C$ of $n$ circles in the plane, each specified by its radius and the $(x, y)$ coordinates of its center, compute the minimum number of rays from th... |
I know the procedure to apply the Ackermann's reduction to a formula that doesn't involve uninterpreted predicates. But, how do we treat the uninterpreted boolean predicates? Nearly all the examples I have seen, usually just assume there are no uninterpreted predicates, and give examples of simpler reductions, but if w... |
I am trying to understand the definition / meaning of reduction.
Is it correct to say that the statement "Problem $A$ reduces to Problem $B$ in $x$-time" is the same as writing $A \leq_{x} B$? For example $\text{SAT} \leq_{polynomial} \text{3-SAT}$.
If we are reducing problem $A$ to $B$ in $x$-time, does it mean that ... |
Assume you have a binary tree of additions, where each two nodes are added together until the root is the sum of all the nodes. For example:
3 2 1 3
\ / \ /
5 4
\ /
9
To minimize the depth of this tree is easy: I can just run DSW on it for instance. The reason I can do this is... |
I have written a recurrence relation to describe a recursive algorithm finding the maximum element in an array. The algorthim has an overlap, meaning both of the subarrays that are recurred on contain the middle element of the array.
$T(n) = 2T((n+1)/2) + c$
However, I want to simplify this recurrence relation more.
Si... |
I came across someone else's old post here
Designing a DFA that accepts strings such that nth character from last satisfies condition
And decided to try it. Apparently it was a homework problem but it was from 2013 so I assume it is okay to discuss it openly by now.
The problem is:
Design a DFA that accepts strings h... |
I got this question:
Let $A \oplus B = (A\cap \bar{B})\cup(\bar{A}\cap B)$.
Proof that $NP = coNP$ if and only if $A,B\in NP$ and $A \oplus B\in NP$.
But I don't know how to proof the direction that if $A,B\in NP$ and $A \oplus B\in NP$ then $NP = coNP$.
I have tried to build the non-deterministic machines for $\bar{... |
Does the conviction "L-uniform NC1 != NP is incredibly hard to prove!" express the core of "P != NP is incredibly hard to prove!" in a similar spirit as the conviction "The polynomial hierarchy doesn't collapse!" expresses the core of "P is not equal to NP!" ? Let me try to elaborate:
The P vs NP problem implicitly inv... |
Problem:
There are two types of balls, big (B) and small (S), which need to packed into boxes. One box can contain either:
nothing, or
1 S, or
1 B, or
2 S, or
2 B, or
1 B and 2 S
We are given the weight (float not integer) of each ball (in array $w$). There are some constraints on the weights of the boxes and balls:
... |
I have a video that record the drawing sequence with a pencil by a painter.
I want to reconstruction the sequence from the video.
And I have google some keywords like "drawing sequence reconstruction", "sketch reconstruction", and have searched like "moving object detection" but cannot found what I want to find.
I wan... |
I'm struggling to understand the purpose of universal and existential quantification of types. I'm playing around with writing a toy language based on the calculus of constructions. I've been reading about Morte and Henk to help me get a better understanding.
I don't understand why the CoC has both lambda and forall ab... |
When I was working with finite automata, I figured out that we can put together two FA two build a new one that is the intersection between the two. This is possible because regular languages are closed under intersection. Now, I am having many difficulties in drawing PDAs especially the ones that are apparently the in... |
Let us say that I have a problem $P(n)$ that I need to solve (where $n$ is the size of the input of problem $P$). I used a polynomial-time reduction from a known NP-hard problem $Q(m)$ (where $m$ is the size of the input of problem $Q$) to $P(n)$ and showed that $P(n)$ is NP-hard. The time complexity of the reduction i... |
Is there a reduction from ATM to ATM-complement?
(ATM denotes the language $\{\langle M,w \rangle \mid \text{TM $M$ accepts $w$}\}$)
I have been thinking about it too much and couldn't find the answer.
I know that reduction from ATM-complement to ATM is not possible becouse if it was, ATM would not be in RE. But how ca... |
I wish to find the CFG for a language on two symbols (say a and b) whose words begin and terminate with the same symbol, and have equal quantities of a's and b's. What is the thought process I should use for finding such a grammar? What is the most natural or simplest grammar for this language? I hope you'll explain... |
I have this question:
$L = \{\langle M \rangle | M$ is TM that accepts every palindrome over
its alphabet $\}$
Proof that $L$ is not Turing-recognizable by showing reduction from other non Turing-recognizable language.
What I have tried to do is to show reduction from $A_{TM}$ (Accept problem) to $\bar L$, and I di... |
I have been studying deductive verification of software lately, with weakest precondition, strongest postcondition, annotation calculus, and etc.
I came across the following rules for the while sentence:
But, my problem is when should I use which rule? I mean the second and third one that includes $t$, which is the va... |
I'm trying to understand how oblivious RAM works, specifically
path oblivious RAM. While I understand how this technique offers protection when reading data - multiple randomly distributed reads obfuscate the access pattern of the data actually requested - I can't tell how that helps protect against an attacker who is ... |
I stumbled across this question and answer (source):
Question: Suppose someone presents you with a solution to a max-flow problem on some network. Give a linear
time algorithm to determine whether the solution does indeed give a maximum flow.
Answer: First, verify that the solution is a valid flow by comparing the f... |
I'm comparing several methods for building inverted indexes (n-grams, hash boundaries, etc.).
Given a set of queries, these indexes perform differently.
On one hand, I get performances metrics (efficiency) such as the time needed to execute the query.
On the other hand, I get metrics such as precision and recall (eff... |
I have to find an example of a model where the LTL-formula $F G p \wedge F q$ is valid and the CTL-formula $EF AG p \wedge AF q$ is not valid. I found this example, but I'm not completely sure whether it's correct:
|
I have a problem with following task: $4COL \in PTIME \Rightarrow 3COL \in PTIME$.
Is there any elementary proof to do it?
|
The density of a Subset Sum instance $S = \{ s_1, \dots, s_n \}$ of size $n$ is defined as
$\qquad\displaystyle d(S) = \frac{|S|}{\log_2(\max_{s \in S} |s|)}$.
Why is the hardness of Subset-Sum dependent on its density?
|
Here is an example of table with 32 bit addresses and their respective indexes and tags. The cache has a total of 8 blocks and 2-word blocks.
So since we have 2 word blocks, that means that the offset is 1 and we use the least most significant bit as the offset. So in the first row, it not only brings 3 but it also br... |
I'm trying to make sense of regular languages, operations on them, and Kleene operations.
Let's say I define a language with the alphabet {x, y}. Let's further say that I place the restriction that there can be no string in the language that contains the substring 'xx'. Thus, my language could be expressed as L = {y, ... |
There is are two esoteric languages with minimally functionally complete operators, iota and jot, that are closely related to SK combinators. I'm attempting to understand the relationship between these languages and propositional calculus.
We know $K := P → (Q → P)$ and $S := (P → (Q → R)) → ((P → Q) → (P → R))$
My que... |
I am reading one of Guido van Rossum's essays on optimization in Python.
We are interested in converting a Python list of integers to their character equivalents. Here's the straightforward algorithm.
def f3(list):
string = ""
for character in map(chr, list):
string = string + character
return str... |
What is the maximal number $c$ of single rotations after deleting a node from an AVL tree? We treat double rotations as two single ones.
I know that it is $O(\log n)$ but I'm trying to find a more precise number – it is in $[\log n, 2\log n]$ of course.
Nevertheless, I am dying to see the exact value of $c$.
|
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 ... |
Is there a way to multiply scalar by vector faster than just multiplying each element of the vector by that scalar?
It feels to me that there should be some exploit to do that. After all we will multiply two vectors elementwise in N steps. The original problem is simpler as it's only scalar by vector. Shouldn't we be a... |
I'm reading a Wikipedia article on the Traveling Salesman problem as an Integer Programming formulation (http://en.wikipedia.org/wiki/Travelling_salesman_problem). The authors have all their constraints and I don't understand the final one. The following statement is in there.
To prove that every feasible solution co... |
Think of an $n$-ary alphabet as $\{0, 1, ..., n-1, n\}$. For example, a binary alphabet is $\{0, 1\}$.
Do Turing Machines with binary alphabets decide the same set of languages as Turing Machines with $3$+ symbol alphabets?
I am unsure of how to show equivalence. Clearly, any $3$+ symbol TM can simulate a TM with $2... |
I'm doing a course in Computer Programming Languages and I'm trying to prove the following (roughly following Pierce's Types and Programming Languages book):
if $t \rightarrow^* t'$ then $if\; t\; then \; t2 \; else \; t3 \rightarrow^* if\; t'\; then \; t2 \; else \; t3$
I'm a little confused about where to start; as f... |
I am trying to reduce the grammar to LL(1) for a hypothetical language we created. I have removed most of the left factoring issues in the grammar, using the general rule of introducing new non-terminal characters for the same.
For example,
<assignmentstats>------- <type><id>=<E>/ id=<E>/id'['<E>']'=<E>/
is trans... |
I am given this algorithm
And I am also given the fact that $1 \leq k \leq n$.
If we let X be the number of times line 2 is executed, then I am supposed to find the run-time probabilities for the different cases.
Thus I know the best case will be when $A[n-1] = k$ because line 2 will only be called once.
I know that $... |
So I'm learning for an upcoming exam and there's a specific problem which I can't show:
Let A be decidable and B undecidable, then $A \le B$
Can someone give me a hint how to solve that? Furthermore, does that mean, that every decidable language is reducible to an undecidable language?
|
Please, help me to understand the mathematics behind the following formula of CPI. Why do we calculate CPI the way it's done on the pic?
|
I am currently constructing pushdown automata.
can I push/pop alphabet more than two in a transition??
For example, $\delta$(a, a/aaa) means, in the state of input alphabet 'a' and stack point 'a' (there is only one item 'a') then it can push two more item 'a' on the stack so that there is three a's in the stack.
|
What is the correct term for the maximal running time of a given algorithm on all inputs of length bounded by given $n$, on which the algorithm halts? Assume, if necessary, that the halting problem of the given algorithm is decidable (with unknown complexity).
How is this time function of $n$ called? Is it studied in... |
You are given a natural number n (n<20). We construct the set S from all binary numbers with n bits. We call two numbers "compatible" if they don't have any common substring of length n-1 (consisted of not necessarily consecutive bits). Now we have to find the maximum number from the numbers in S so that every pair of ... |
There is a branch mispredict and while executing the false code, an interrupt occurs (for example a keyboard interrupt). The EPC (register that holds the return address) now holds the wrong return address (after the interrupt handler has finished, it would return in code that wasn't even meant to be executed). How do C... |
I've been searching the net for an answer to this question, but it's guetting quite confusing.
I want to know if there are some undecidable problems for a classical computer that a quantum computer could do.
The examples I've seen are things like Shor's algorithm, but that's "just" because the quantum computer is more ... |
I am in High School (P.R.) and I am a regular person in math. Should I try computer science?
|
I was reading about Suurballe's algorithm on Wikipedia, for the shortest
edge-disjoint paths problem, i.e. given nodes $s$ and $t$ finding a pair of paths between these nodes, whose accumulated weight is minimal.
I understand why the output consists of two $s$-$t$ paths, and the relationship between this and augmenting... |
For a certain language $L \subseteq \{a, b\}^∗$, IL has exactly four equivalence
classes. They are $[\lambda]$, $[a]$, $[ab]$, and $[b]$. It is also true that the three
strings $a$, $aa$, and $abb$ are all equivalent, and that the two strings $b$ and
$aba$ are equivalent. Finally, $ab \in L$, but $\lambda$ and $... |
I have just read this answer and was very satisfied and it is indeed a fantastic answer. It taught me the working of BIT.
But at the end, the second last paragraph is where I am struggling.
It says,
Similarly, let's think about how we would do an update step. To do this, we would want to follow the access path back u... |
There is an algorithmic problem $A(n)$, where $n$ is the size of the problem.
It is known that, for every candidate solution S, the time it takes to verify whether it is a correct solution to $A(n)$ is $T(n)$.
Does this imply a lower bound on the time it takes to find a correct solution to $A(n)$ (e.g. that it takes ... |
I am reading a few papers on Bloom Filters – Bloom Filters in Probabilistic Verification (Dillinger and Manolios) suggests the following allocations for double and triple hashing respectively
$$\begin{align*}
f[i] &= a(δ) + ib(δ)\pmod{m}\\
f[i] &= a(δ) + ib(δ) + (c(δ)(i)(i − 1))/2 \pmod{m}
\end{align*}$$
Less Hashing... |
I have the following question to answer in a MapReduce assignment sheet
The Naive Bayes classifier is a widely-used tool for analyzing data. Consider a data set that has $n$ data items, each of which has the same $m+1$ attributes.
Each data item is stored as a tuple
$$(i,(X_0,i, X_1,i, . . . X_m,i))$$
where $i$ is th... |
I'm a little bit confused about the second condition of the pumping lemma which are:
$|y|\geq1$
$|xy|\leq p$
$\forall i \geq 0 : x y^i z \in L$
I don't understand why the length of substrings $xy$ has to be less than the pumping length? Considering the example below:
Suppose we have a language $L = \{ w | w ∈ 1^*0... |
Why is the average time complexity of searching an array $O(n)$? Is it because if the element does not exist, then $n$ searches must be done. If the element is at the end of the array then $n$ must also be done, so $\frac{2n}{2} = n$?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.