instruction stringlengths 35 29.1k |
|---|
Does this Turing Machine decide
language of polynomials with integer coefficients which have integer roots:
The input represents a polynomial over variables x1, . . . , xn with integer coefficients.
1. Examine all possible integer values of x1, . . . , xn.
2. Evaluate the polynomial on all of them.
3. If any of them ev... |
Background:
I worked on finding the maximum path from the top to the bottom of a tree-like graph. During the process I found that the algorithm for finding the maximum path from the top to bottom of a binary tree also worked for my graph. My problem arose when trying to name the program, because the graph it works on i... |
If we expanded the alphabet Sigma = { 0, 1, u, > } to Sigma' = { 0, 1, 2, u, > }. How would the table change? We're just learning about Turing Machines in class and I'm a bit confused. Is the table in the picture calculated in some way?
|
I'm working on my graduation project for CS, which is about cellular automata. Recently, i was able to build a system where the input is transferred to multiple different structures at once. The input consists of numbers, a sequence of numbers ranges from (-infnite to infinite), like ('5','65443'or'9921075').
From the... |
An admissible heuristic never overestimates the cost to reach the goal. However, isn't that only the relative difference between heuristics for two different paths matter?
Say we have optimal path A (cost 100 to reach goal) and sub-optimal path Z (cost 120 to reach goal). Even if the heuristic is admissible, say it gi... |
When wolfram described Elementary Cellular Automata, most of the rules appeared as triangle and lines.
Now, Rule 110 consists of triangles which is proved to be universal.
Is there a relation between these triangles and universality like rule 110, or even other geometric shapes can be related to universality?
|
I would like to know your book recommendations / popular books to learn how computers perform operations, store memory, process your mouse input to open a program for example (maybe not that complicated) at transistor / logic gate level
|
It took me about a week to understand how does it works, but still, I'm wondering if it actually works!
I. The algorithm EXPLORE
EXPLORE (S:sommet, D:following vertices of vertex X, visited:TAB)
var LIST;
i,j:vertices
visited[S] ←true;
LIST ←{S};
WHILE LIST ≠ 0
selectionner i ∈ LIST
IF ∃ j ∈ D[i] , not visited[... |
I need an advice.
There is in section "V. CONCLUDING REMARKS" of the paper [1],
a term that only the autho's paper use: "PREFIX CODING COMMUNICATION".
I googled the expression and the only result is the same paper [1].
It's difficult for a beginner in communication complexity to understand what the author is talking ab... |
I am looking for bounds - both lower and upper - on the time and spacial complexity of simulating Turing-complete systems with each other. (I am aware that both time and space are ill-defined with many systems. However, I do not know of a better way of describing them.)
|
I'm trying to figure out what the smallest positive integer x such that the floating point expression round(round(1/x)*x) is not equal to 1 in single precision.
I have that the answer is 41, but when I let the number 3 for example be x, isn't 1/3 = 0.333, and when rounded = 0, 0 * 3 = 0? So why is the answer 41?
|
First of all, this question relates to an issue that affects several areas of science, but since StackExchange doesn't have a meta science section I'll make it specific to computer science, which is pertinent because the solution to the bigger problem may actually come from computer science.
In the context of the news ... |
I need to find a DFA for this language:
L = { $ \omega = xy \in (a,b)^*\mid |x|_a = |y|_b $ }
|
I am looking for bounds - both lower and upper - on the time, spacial, and state/symbol (i.e. number of states and symbols required) complexity of simulating the (untyped) λ-calculus with a queue machine (roughly speaking, a pushdown automaton with the stack replaced by a (n unbounded) queue).
It is easy to emulate a t... |
I am reading the paper Measuring the hardness of SAT instances by Ansótegui, Bonet, Levy and Manyà (Proc. 23rd AAAI Conf. on AI, pp. 222–228, 2008) (PDF). I am trying to understand the demonstration of the last part of the Lemma 3 (in bold). For this, I get an example. Let be $\Gamma = (a+b)(a+b')(a'+c)(a'+c')$ then it... |
I have a set $E$ which is the set of all possible $d$-tuples ($d$-dimensional vectors) of integers between $1$ and $n$.
Typically $d=3$ and $n\approx1000$, but for the sake of making a small example, suppose $d = 2$ and $n = 4$, so
$$E = \{(1,1),(1,2),(1,3),(1,4),(2,1),(2,2),(2,3),(2,4),(3,1),(3,2),(3,3),(3,4),(4,1),(4... |
Church-Turing thesis : Every effectively calculable function is a TM-computable function.
But, hypercomputation models are strictly more powerful than TM and can solve TM-uncomputable problems on the paper.
Does this imply that, for one who believes in the Church-Turing thesis, there is only two options :
There is two... |
I am working on a project in which I am supposed to come up with a system that detects fraud from a credit card transaction. I read about techniques that others have used and decided to use Artificial Neural Networks for their adaptability.
WHAT THE SYSTEM MUST DO
My system is supposed to detect fraud on a credit card ... |
The problem that I'm trying to solve (well, I think that I almost did, but need a review from someone more experienced) is about changing probability of the transition for semi-Markov state machine during simulation.
Let's assume that M=<S,T> defines machine with S states and T probabilistic transitions between states.... |
Does anyone know of an algorithm to generate a set of numbers of size $N$ which are all co-prime to eachother?
Ideally I'm looking for something that has random access abilities so i could ask for the 100th item in the set without having to first calculate items 0 to 99.
Also, I would like to be able to specify a minim... |
I'm reading CLRS Section 33.4 Finding the closest pair of points. At exercise
33.4-2 they say
33.4-2
Show that it actually suffices to check only the points in the 5 array positions following each point in the array Y'
But I'm getting 4 array positions following each point in the array Y' will be suffice to check. S... |
Consider the following algorithmic task:
Given: primes $p_1,\dots,p_k$, and positive integers $e_1,\dots,e_k$, and a positive integer $M$
Find: integers $d_1,\dots,d_k$ that maximize $\prod_i p_i^{d_i}$, subject to the requirements that $0 \le d_i \le e_i$ and $\prod_i p_i^{d_i} \le M$.
What is the complexity of this p... |
The well-known algorithm for computing the $k$-th largest element in an unsorted array of size $n$ runs in $O(n)$ time.
How about for a range $[k, k+c]$, where $c$ is not necessarily independent of $n, k$? The obvious "brute-force" algorithm is to find the $k$th largest using the original $O(n)$-time algorithm, then t... |
I was converting a DFA to regular expression with the help of state equations and came up with this regular expression. How do I further reduce this regular expression?
$$b+aaa^*b+abb^*+a$$
I can feel it's same as $$a^*b+ab^*$$ but how do I proceed to simplify the first one to the second mathematically?
|
Consider the language
$$L = \{1^i 0^j 1^k \mid i + j = 2k, k ≥ 1\}\,,$$
and let $x_n$ be the canonical $n$'th word in $L$. My problem involves proving that the Kolmogorov complexity of $x_n$ can be bounded by
$$K(x_n) \leq c + 2\log_2 |x_n|$$
for some constant $c$.
My ideas :
(please note that I'm not writing this in a... |
I'm currently studying compiler construction book "Compilers Principles, Techniques, and Tools (2nd Edition)" , in page unit 3.1 , page 113 , example 3.2 .
i cannot understand what is this kind of method ?
E = m * 2;
conversion to token types(this method) below
<id , E> <op=> <id , m> <op*> <number , 2> <op;>
it is... |
I need to find a grammar that generates the language composed by all words that have more $a$ than $b$ given an alphabet $\{a,b\}$
I tried the following production rules:
S->B
B->b | ABB | BAB | BAB | BBA
A->a
with this rules it's fairly simple to proof that all the words that the grammar generates are made up with mo... |
The language is $\{w \mid \text{$w$ is any string except $11$ and $111$}\}$ where the alphabet is $\{0,1\}$.
Drawing the DFA recognizing $\{v \mid \text{$v$ is either $11$ or $111$}\}$, then switching the accept and non-accept states, and finally examining this resulting structure, I thought of it as being:
$(ϵ∪0Σ^*∪1∪... |
High-order pattern matching is an undecidable problem. That means there is no algorithm that, given an equation a => b, where a and b are open terms on the simply typed lambda calculus, finds a substitution S such that aS => bS, where => stands for "has the same Bn normal form". Yet, humans can solve that problem effic... |
So for my homework, I was supposed to design an algorithm which was divide-and-conquer that fulfilled the task of finding the two smallest numbers in an array of size n.
I recognize that my version is a bit cheap in that regard, in that it uses reference variables and only does work on the size 1 cases of the recursio... |
I want a low-level understanding of how a pixel is displayed on a monitor.
I am guessing that the point at which I want to display a pixel must be modified in the frame buffer, which should be sent as a signal to the monitor. But, on low level, how do I find out what part of memory represents the frame buffer? I also g... |
See the interactive example here. First-fit on the left, optimal on the right.
I know that in general, optimal bin-packing is NP-hard, so I'm not looking for a perfect solution. I'm looking for the lowest cost improvement over the current solution.
The problem is the one most of the web pages on the internet have: How... |
Draw recursion trees and use them to find big theta bounds on the solutions to the following recurrences. For each, assume that T(1) = 1 and that n is a power of the appropriate integer. ex) T(n) = 8T(n-2) + n
There are multiple equations that I have to do with the above directions. I am lost on finding big theta bound... |
If we have a finite chess board and two figures x and y. Is it possible to get y from x by following chess rules and when white is y and white starts from y placement. Is this decidable?
My reasoning is, that we have a finite sets of moves and since all finite languages are decidable and at some point x is going to g... |
I was just thinking today that the best approach to find two smallest numbers in any array would be to first sort(ascending order) it with some efficient algorithm like Quicksort(Average case complexity: nlogn) and then access the first two members of the array in O(1).
Is my approach optimal or there are some alternat... |
I have recently started reading more about context-free parsing techniques, in particular LR parsing.
As I have read, LR state transition graph (or table(s)) used for finding handles in sentential form is created by first constructing NFA from grammar rules (with included position in the rule - dot and possibly lookahe... |
High-order pattern matching is an undecidable problem. That means there is no algorithm that, given an equation a => b, where a and b are terms on the simply typed lambda calculus, a containing free variables, finds a substitution S such that aS => b, where => stands for "has the same beta normal form" (up to variable ... |
In 2007, it has been proven that high-order unification is decidable on the pattern matching case. If that is true, what is stopping someone to write an equation like:
(F [1,3,2], F [4,1,3,2], F[3,1]) = ([1,2,3], [1,2,3,4], [1,3])
If the unification works, wouldn't it probably find an F which implements a sorting algo... |
There was a comment here that " It is possible in principle to reduce the factorization of a $256$-bit number (which is computable in TFNP) to the Permanent on a matrix of dimension $N\times N$ where $N\leq c\cdot256^c + c$ for some hopefully small constant $c$. However the computation of a nice upper bound on $c$ woul... |
Let's suppose I want to generate n equal sized boolean arrays with maximum "difference". - "Difference" in this case is defined as that the arrays share as low as possible fields with one another. (an example of share: array1 = {1,0,0,0) and array2 = {1,1,1,1} -> array1 and array2 share 1 field (array1[0] / array2[0])
... |
In my understanding both of them can be converted to serial schedules. (This helps with consistency by isolation property while also giving the performance boost by concurrency).
I'm unable to understand one of the lines in this text:
http://infolab.stanford.edu/~ullman/dscb/vs-old.pdf
Intuitively, view-serializabili... |
I understand the difference between Hoare and Mesa monitors. However I don't understand why priority inversion (when a lower priority process gets done before a higher priority process) is possible in the Hoare type but not possible in the Mesa type. Can someone explain this?
|
I am studying about DFS these days from the book "Algorithm Design" by Jon Kleinberg. Here a DFS algo is given which is as follows:
DFS(s):
Initialize S to be a stack with one element s
While S is not empty
Take a node u from S
If Explored[u] = false then
Set Explored[u] = true;
... |
BACKGROUND:
Note: The following question arose in my mind when watching this lecture (watch at 5:30 minutes if you will).
Assumption: Just for the sake of this question, let's assume that the term "basic operation" means an addition or a multiplication operation between two single-digit numbers.
Now we have to calcula... |
How should I understand the definition of computational problem?
A computational problem is a mathematical object representing a
collection of questions that computers might be able to solve. For
example, the problem of factoring
"Given a positive integer n, find a nontrivial prime factor of n."
What is the mathe... |
Let's say I have an array of numbers {a,b,c,d,e} and want to calculate the sum of product of all triples abc+abd+...+cde.
I can calculate it very fast without generating all triples using this formula
F(n,k)= k*F(n-1, k-1)+ F(n-1, k) with two loops
int[] values={a, b, c, d, e...};
int k = 3;
int[,... |
I was reading about sierpenski's triangle and i found that it is similar to pascal's Triangle, which can show coefficients in binomial expansion, also rule 90 from ECA.
If Sierpenski's triangle can show coefficients in binomial expansion, and was simulated by other two systems {Pascal's Triangle} and {Rule 90} does th... |
I know this might sound like a newbie question, but bear with me.
I have read a paper where researchers use a random forest to predict species distribution, but in their study, they only predict a new set of points given an old set and a map of environmental variables. https://www.uam.es/proyectosinv/Mclim/pdf/MBenito_... |
A list of n strings, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is __________.
$O(n log n)$
$O(n^2 log n)$
$O(n^2 +log n)$
$O(n^2)$
My attempt:
If we are used in-place merge sort , then time complexity for the worst case $Θ(n^2... |
I have searched extensively and unsuccessfully for references to a
combinatorial problem that arises in my work. I am hoping someone
can tell me if this type of problem has a "name" and provably optimal solutions.
The problem: Given a set of objects denoted by $X_1,\ldots,X_N$, a commutative
and associative operator $\... |
I have a field in my data store which must take exactly 180 bits of information. Some users will choose to make this data encrypted, some won't, so some of those 180 bit fields will be ciphertext some will be plaintext. A boolean will indicate which one the user is using. The important thing here is that I need this fi... |
I was wondering whether it is possible (and if so, then how) to tell what is the maximum number of equivalence classes generated by a DFA as per Myhill-Nerode theorem (assuming it has no redundant transitions) as a function of number of accepting and rejecting states and cardinality of its alphabet.
My guess is that ... |
Consider a company that wants to lunch a new subsidiary. To do so, four phases are needed: A, B, C, D which have to be done in this order. The length of each depends on how much money is invested in the phase.
Assume that numbers the close to the red edges are for all red ones, and likewise for the purple ones.
Here i... |
The question asks for the decimal number that 0x0C000000 represents if it is a floating number. I'm not too sure on how to approach this, but here's my thought process:
0x0C000000 = 0000 1100 0000 0000 0000 0000 0000 0000
The first digit is 0, so it's positive. The exponent is
0x0C = 12 - 127 = -116.
The mantissa is ... |
Our software receives documents (in the order of tens of thousands) from various providers, each document flows through a number of steps, one of those steps finds duplicates and similar documents (within 80% threshold) to this document.
We implemented Levenshtein distance algorithm and we limit amount of documents cur... |
I've come up with an idea on how to compress data. But I'm not sure if the approach already exists. I would like to know if it does already, and if so, what its name is.
The approach is to:
Convert the message to a number
Find the smallest equation to represent the number
The result of this is an equation. Which wil... |
I've found and implemented a full adder to be able to do unsigned or two's complement addition on wikipedia:
https://en.wikipedia.org/wiki/Adder_(electronics)#Full_adder
However, in my particular case, I'd like to use a sign bit instead of twos complement, due to there being a variable (unbounded) number of bits involv... |
I am stuck by analyzing the time complexity of the following algorithm:
def fun (r, k, d, p):
if d > p:
return r
if d = 0 and p = 0:
r <- r + k
return r
if d > 0:
fun (r, k + 1, d - 1, p)
if p > 0:
fun (r, k - 1, d, p - 1)
The root call will be fun (0, 0, n, n), ... |
So this is the pseudo code I came up with but the run time is very slow. Is there a way to write this code to get it in terms of O(n)?
First for loop (starts at 0) grabs the first value of the array and the second for loop is nested inside the first for loop (starts at j =i+1). The second for loop runs through and chec... |
We have Stocks in several discrete positions, let say:
A B C
40 20 80
And Demand, which may be satisfied by one or more Stock positions (if no specified then it would accept any Stock).
Demand for A=20 may be satisfied from A Stock only, and depletes 20 units from it. Demand for AB=20 may be satisfied from any... |
I am trying to solve the following problem and despite having performed quite extensive literature review, I do not seem to find any similar problem or technique that would be useful here.
PROBLEM FORMULATION:
Given a file of size K (bits) residing at a node 1, we would like to disseminate it in minimum time to a set o... |
We say an algorithm runs in polynomial time if it is of the form $O(n^k)$ where $n$ is the size of the input, right?
So how do we judge how many inputs there are in: $(x_1 \vee x_2 \vee \overline{x_3}) \wedge (\overline{x_1} \vee \overline{x_2} \vee x_4) \wedge (x_2\vee x_3\vee x_5)$
...actually, in looking for an actu... |
I've been thinking about sorting $6$ elements with the minimal possible number of comparisons. I can do it in $10$ comparisons but I've no idea if this is optimal. Or is there a better algorithm ?
Algorithm
1. Sort $a_1, a_2, a_3$ and $a_4, a_5, a_6$.
Number of comparisons: $3+3=6$.
2. Merge two subarrays.
Number of ... |
Considering the lower limit to the problem of checking whether the array are only the same number via comparisons. And thnik about $ n-1 $.
Consider the diagram hasse. This diagram must be consistent (one piece), so you need at least $ n-1 $ edges (comparisons),.
However, I would like to consider a decision tree. Unfor... |
Is this problem a know variant of the optimisation version of the bin packing problem? There is an approximating algorithm for it?
Let $A = \{a_1,a_2,...a_n\}$ be a set of items, $B = \{b_1,b_2,...b_m\}$ be a set of buckets, with $m \leq n$. Each $a_i$ has a weight, based on the bin it is placed on (the item $a_i$ whe... |
It is required that, in a black red tree, the color for the root is always black. However, wikipedia argues that this rule can be omitted as a red root can always be changed to black but not vice versa. I get the first half, that a red root can be changed to black at any time, but in what circumstance is it impossible ... |
I was given the following problem in an test (at codility.com)
A turtle starts at (0, 0) on a cartesian graph. We have a non-empty
zero-indexed "moves" list that contains positive integer numbers. Each number
represents the distance moved. The first number is the distance north,
the second is the distance east, ... |
Question: How does one formulate a back propagation algorithm (either batch, gradient, anything that works) for a neural net, playing a game of Tic Tac Toe?
(Java is being utilized)
Scenario: There are 9 input neurons, one for each square. A value of -1 represents X, 1 represents O, and 0 represents an empty space. The... |
Have a problem that's a variant of the linear time selection algorithm of a randomized array that I'm struggling with.
Let $A = A[1], ..., A[n]$ be an array of $n \ge 4$ distinct keys.
Describe an efficient algorithm to find the three smallest keys in $A$. Use words.
What is the worst case number of comparisons perfor... |
How might one compute $4^{-1} \mod 17$ I know the answer is 13. I'm just not sure how to arrive at that number, and can't find any good explanations. Any help would be great
|
I know that languages which can be defined using regular expressions and those recognisable by DFA/NFA ( finite automata ) are equivalent. Also no DFA exists for the language $\{0^n1^n|n \ge 0\}$. But still it can be written using regular expressions ( for that matter any non-regular language can be ) as $\{ \epsilon... |
I'm an academic mathematician. While trying to verify a counterexample to something in my research, the following computational problem has arisen:
Fix a vector space $V = \mathbb{Q}^n$. Here $n$ is something on the order of $20,000$. I have a procedure that spits out a sequence of vectors $\vec{v}_1,\vec{v}_2,\ldot... |
I have a piece of code that applies recursive Binary and Ternary searches on sorted arrays of increasing size, i.e. 500, 1000, 2000, 4000, etc. The entire code segment is about 200 lines so I've been forced to upload it to Pastebin which you can find here. When the main method is executed, arrays are created and popula... |
In this problem, I'm first given n number of values which I have to store in a space efficient manner. Then I'm given m number of values which I have to check if they were added to the data structure before (such that after the operation, I know which value was a member, and which weren't).
I could use a Bloom Filter a... |
I suppose you are all familiar with the baseball elimination problem (it is about determining whether some team with particular number of points can finish in the first place, when there are still such and such games to be played by other teams).
The rules there are rather simple - the winner gets a point, while the l... |
I'm actually studying the Bellman algorithm. I have to draw a graph from this array.
\begin{array}{|l|c|r|B|d|}
Rhythme & A & B& C& D\\
\hline
Normal & 5 & - & - & -\\
Rapide & 4 & 3 & 5 & 2\\
Prioritaire & 2 & 2 & 3 & 1\\
\end{array}
The instructions are: each vertex corresponds to a possible progress where some phase... |
Problem
Given a vector of bools of length n I wish to compute the logical and over all subsets up to length k.
By logical and I mean that for a subset to give true all of its elements must be true.
Example:
With a boolean vector of 3 elements (indexes below each for reference below)
v = [true, true, false]
i = 0 ... |
I think about following problem:
There are given three sorted arrays $A,B,C$ (each of them is length $n$).
Every array has distinct elements.
Find median of union $A,B,C$.
I consider following approach:
Let's consider $A_i, B_i, C_i$, where $i=n/2$. There are six cases - but I consider only one (rest of them is analo... |
The algorithm is in Python. Seems correct to me, ideas how to prove it? And what would be its time complexity?
from bisect import bisect
# Implements the decision version of subset sum.
# The subset sum problem: given a set and a number find a subset of the set which sums to the given number.
# Inputs: an ordered list... |
I get that all problems in NP can be reduced in polynomial time to some NP-Hard problem. An NP-Hard problem is also supposed to be harder or at least as hard as any NP problem.
Can an NP-Hard problem be reduced to an NP problem, which is not already an NP-Complete problem?
Also, are NP-Hard problems inter-convertible?
|
In constraint satisfaction problems, heuristics can be used to improve the performance of a bactracking solver. Three commonly given heuristics for simple backtracking solvers are:
Minimum-remaining-values (how many values are still valid for this variable)
Degree heuristic (how many other variables are affected by th... |
For functions of a single totally ordered variable, I already know that $f(n)$ is $O(g(n))$ if and only if $\exists m. \exists c. \forall n. (n \ge m) \rightarrow [ f(n) \le c \cdot g(n) ]$.
What I don't know is the meaning of $O(g(n_1, n_2 \dots n_k))$ for $k > 1$ totally ordered variables. What's the formal definitio... |
I'm working on proving that the following language is regular:
B = {x|for some y, length(x) = length(y) and xy are in A}
where A is a regular language.
Since A is regular, we know that there is an FSA that describes it. My plan is to modify this FSA, M, into M' using jumps, to prove that for certain strings of x, that... |
Are there any graph implementation data structures beyond the standard adjacency list/matrix ones? If so, what are they?
I welcome experimental ones as well as highly specialized ones.
A little background: I'm developing an algorithm that relies heavily on graph operations, so I'm doing research in graph implementation... |
A language $L \subseteq \Sigma^*$ can be described by a regular expression iff it can be defined by a formula in monadic second order with words as structure $(\{0, \dots, n-1\}, <, (P_a)_{a \in \Sigma})$. The proof I know is an indirection construction over automata, i.e. we show that DFAs and regular expressions / fo... |
Consider a directed graph with nodes {1,2,3...n} and include an edge (i,j) whenever i<j.
According to me, it should be n(n-1)/2 but the book says it's nC2(combinations).
|
I've already asked this question over at MathExchange, but since I received no replies or comments there, I hoped it might be more adequately fitting in this category.
I have a convex (concave) objective function with constraints that are all linear, and would like to use the Multiplicative Weights Update method (see ... |
Context-free grammar can generate the string a 2 n for n≥0 .
The production rule P is S→SS|a .
The derivations is, for example:
1) S⇒a (this is when n = 0)
2) S⇒SS⇒aa (this is when n = 1)
3) S⇒SS⇒SSSS⇒aaaa (this is when n = 2)
4) S⇒SS⇒SSSS⇒SSSSSSSS⇒aaaaaaaa (this is when n = 3).
Am I right?
Someone told me yes b... |
In the GAP-CLIQUE$(k,\ell)$ problem, we are given a graph $G$ over $n$ vertices and have to decide whether $G$ contains a clique of size $k$ or no clique of size $\ell$. Using a PCP system, it can be shown that GAP-CLIQUE$(k,\varepsilon k)$ is NP-hard for any positive constant $\varepsilon$ less or equal to $1$. In fac... |
Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions.
I'm looking for implementation of queue where ENQUEUE takes a sequence of three instructions and DEQUEUE takes a single instruction , or any better algorith... |
What does $L_1 \in CS - CF$ means?
I think the meaning is $L_1$ can be generated by context-sensitive grammars, but cannot be generated by context-free grammars.
Am I understanding this correctly? Just to be sure.
|
I want to compare the vertices of two graphs. Given two graphs, $G_1 = (V_1, E_1)$ and $G_2 = (V_2, E_2)$, I want to compare $u_n$ and $v_m$ for $u \in V_1$ and $v \in V_2$. I came up with double loops for doing this:
for all u in G1
for all v in G2
if u.label == v.label then
do something here
end if
... |
I'm attempting to create an automatic scheduler from a list of tasks I have available. Here are the key points:
Each task has been given a priority beforehand and the algorithm should try to maximize the total 'priority points' it can get from the tasks it schedules.
There should be no overlap between any tasks.
Each ... |
I'm interested in pushdown automata with a unary stack alphabet: let's call them UPDA's. Define a $k$-UPDA to be a pushdown automaton with $k$ stacks, each with a unary stack alphabet.
I've figured out that a $k$-UPDA is at least as powerful as a $(k-1)$-PDA (see proof at the end). This implies that a $k$-UPDA is equi... |
I'm just refreshing my memory on Turing machines and computability, and I was wondering how to design a function of 2 arguments that is guaranteed not to be computable. I've seen the proof (by diagonalization) for one argument functions, and I'd like to make sure I have the right idea. For functions with 2 arguments, a... |
I'm given a more restricted version of 3-SAT called 3-SAT-M:
Problem: 3-SAT-M
INPUT: A set of clauses C {c1,...,ck} over n boolean
variables {x1,...,xn}, where every clause contains exactly three
literals (as in 3-SAT).
OUTPUT: YES if there is a truth assignment to
the boolean variables such that the following constra... |
Given a set of points $x_1, \ldots, x_n \in \mathbb{R}^2$ and a radius $r$. Which is the complexity of finding the point with higher number of points at a distance smaller than $r$. E.g the one that maximizes $\sum_{i=1}^n \mathbb{1}_{\|x - x_i\| \leq r}$?
A brute force algorithm would be to go over every point and cou... |
So I'm trying to learn how to simplify Big O notations, these are the ones i'm working on (also sorry if i mess up the format, i'm new)
So the first one i have is:
f(n) = n g(n) = n/loglog 12
I have to determine whether f is O(g), Omega(g), or Theta(g).
I also want to account for Big O vs Little O (which is also so... |
I'm trying to understand this dynamic programming related problem, adapted from Kleinberg's Algorithm Design book. Not homework: i've already a solution, just considering if i'm ok with the theory.
Suppose we want to replicate a file over a collection of $n$ servers $S_1, S_2
, \ldots , S_n$. Each server $S_i$ has a ... |
I'm taking my first algorithms class, and the first exam is tomorrow. I've been looking forward to this class since freshman year, but now that I'm in it the professor is less than stellar and I've been having trouble (making tomorrow's exam worrying). We've covered the meaning of each of the notations, but we'll be as... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.