instruction stringlengths 35 29.1k |
|---|
Is there an algorithm to check whether an integer $x$ is a square modulo $n$, where $n$ is an integer whose factorization we do not know? Is the Jacobi symbol helpful?
What about higher powers, e.g., testing whether $x$ is a $k$th power modulo $n$?
|
In the seminal paper "Causal memory: definitions, implementations, and programming", distributed causal memory is defined to ensures that all the processes in a system agree on the relative ordering of operations that are causally related.
Its implementation:
For its implementation, each process maintains a private c... |
Let $s$ be the source vertex. In the standard Bellman-Ford algorithm (e.g. the version found in CLRS), when there is a negative cycle reachable form $s$, the algorithm will return that a negative cycle is found.
But let's say I am interested in the shortest path from $s$ to some vertex $a$, and it might be that there ... |
We have two binary strings, $X$ and $Y$, in two different computers. Both of them in length $n$. The computers can communicate by sending bits to each other.
We have to build randomized algorithm to check whether there's an index $i$ such that $X_i=Y_i$. We can send only $O(\log n)$ bits between the computers.
If there... |
I have a question about Locally Linear Embedding. I am trying to study this algorithm and implement it for better understanding. I have read An Introduction to Locally Linear Embedding. However, I don't think I really understood this algorithm. There are several questions I want to ask.
I understand that this algorith... |
I want to better understand how OS provides heap memory to a process. Here by heap memory I mean the memory allocated dynamically, say by call to malloc.
When a process is newly created, does OS reserve some heap memory for it?
If a process calls malloc, does OS associate a "Page" (from paging concept) with process an... |
I have a tree with percentages of the following form
100
/ \
/ \
/ \
/ \
25 75
/ \ / | \
15 10 35 10 30
/ \ / \
1 9 5 5
/ | \
3 3 3
So child nodes are added up in the parent node.
Does a tree with this attrib... |
Given a system of two Boolean Algebra equalities
a = b.
c = d.
one can exhibit a single equation
F(a,b,c,d) = 0.
which is equivalent to the former system. (Symmetric difference is pivotal for constructing such quaternary operation F(a,b,c,d)).
Questions:
Is there binary operation x ? y (infix notation) such that
a ?... |
An exercise from the book Foundations of Algorithms Using Java Pseudocode:
Write an efficient algorithm that will find an optimal order for
multiplying $n$ matrices $A_1 \times A_2 \times \ldots \times A_n$,
where the dimension of each matrix is $1 \times 1$, $1 \times d$, $d \times 1$ or $d \times d$ for some con... |
I think the following proof found in a textbook is circular, since the proof for case n=n'0 assumes the case n=n'1 and vice versa. Am I missing something?
Proof that the semantic function N is a total function from binary strings into the integers:
Let N be defined thusly:
N(0) = 0;
N(1) = 1;
N(n0) = 2*N(n);
N(n... |
Can someone help me to store the factorial of large numbers such as 100! efficiently?
UPDATE: obviously, storing the argument rather than the factorial digits themselves achieves a significant saving. The true challenge is to find a data compression scheme that achieves a significant compression ratio, but with a light... |
This question is about the intersection of probability theory and
computational complexity. One key observation is that some
distributions are easier to generate than others. For example,
the problem
Given a number $n$, return a uniformly distributed number $i$ with $0 \leq i < n$.
is easy to solve. On the other han... |
I read about Big-O notation with modular arithmetic. So, Time complexity is commonly estimated by counting the number of elementary operations performed by the algorithm, where an elementary operation takes a fixed amount of time to perform. Thus the amount of time taken and the number of elementary operations performe... |
At page 277 of Sipser's Introduction to the Theory of Computation, a proof of the NP-completeness of SAT is given.
The following comment is made on the trace of some machine $N$ which can decide a language $A\in\mathrm{NP}$:
"Next, we take any language $A$ in NP and show that $A$ is polynomial time reducible to SAT. Le... |
It is often stated in the CS folklore that Turing was inspired by Gödel's incompleteness theorem, more specifically the diagonalization proof and the isomorphism between axiomatically generated statements (Gödel numberings).
Are there other such links between model theory and computer science? Should a computer scient... |
This quote on descriptive complexity theory is given in Wikipedia:
"The first main result of descriptive complexity was Fagin's theorem, shown by Ronald Fagin in 1974. It established that NP is precisely the set of languages expressible by sentences of existential second-order logic; that is, second order logic excludi... |
The page on descriptive complexity theory in Wikipedia states the following:
"First-order logic defines the class FO, corresponding to AC0, the languages recognized by polynomial-size circuits of bounded depth, which equals the languages recognized by a concurrent random access machine in constant time."
How can we sho... |
I'm having trouble understanding the point of Subnet Masks.
I was reading a nice article on Tech-FAQ on the topic, but it has left me a bit confused.
When I first heard about Subnets, it was explained to me that these are small independent networks connected to the main internet at one point. For example in an office b... |
Lower complexity bounds tend to be a very hard problem in general. Despite this, I was wondering if there are any theoretical results that relate lower complexity bounds for some class of problems in the case where mutation is allowed and in the case it's not allowed? In particular, what type of problems would be inher... |
If I had a heap like the following: with blue blocks being occupied memory and white blocks being free memory
What is the general name given to the situation illustrated, where the free and occupied cells become distributed almost 'randomly'?
This is an exam question, I've tried searching online and through the provid... |
as i read some material about Optimal BST, i ran into a trouble.
for following key i find two optimal BST with Average Cost = 30. 1 optimal BST using Dynamic programming Algorithm and 1 by hand !
key : 1/ 2/ 3 /4/ 5
frequencies: 10 / 8/ 6/ 4/ 2
i think always the Optimal BST using dynamic programming always h... |
Mr. and Mrs. Smith, a married couple, invited 9 other married couples to a party. (So the party consisted of 10
couples.) There was a round of handshaking, but no one shook hand with his or her spouse. Afterwards, Mrs.
Smith asked everyone except herself, “how many persons have you shaken hands with?” All 19 answers we... |
I want to study theory of computation on my own, so I am looking for books.
What set of books would you recommend for the equivalent of a one-semester course that introduces theory of computation?
Please post answers that describe a complete curriculum, explaining which chapters of each book are relevant at which stage... |
Note its not a homework question, just practice
Hi i have always seen linked list implementation in java using the following piece of code
class Node
{
int key;
Node prev;
Node next;
}
I implemented linked list using single array which could be increased as per need. (Took code of ... |
For a given sufficiently strong formal axiomatic system $\mathsf{F}$ (like $\mathsf{PA}$ or $\mathsf{ZFC}$) and any given function $p^*(x)$ that can be specified within the formal system $\mathsf{F}$, Hutter's algorithm $M_{\mathsf{F},p^*}$ computes the function $p^*(x)$ nearly as quickly as any (provably quick) algori... |
Say I am using boost or the built-in float or double mathematical libraries of my C++ compiler.
I distribute the program.
Will the execution of my C++ program on different machines given different floating point results given that the FPU is CPU specific and AMD may not return exactly the same thing as Intel or ARM.
Sh... |
I found an algorithm for finding the shortest path on grid between selected cell, to all cells on the grid, with $O(KN)$ where $K$ is the number of neighbor cells and $N$ is the number of cells.
How ever if that's true than it's better than A*, Floyd–Warshall and many others. So I probably mistaking some thing. Can you... |
I'm interesting in teaching programming to middle school students. I'd like a programming language with the following criteria:
Simple - pared down to the absolute minimum needed to support sophisticated programming without too much code. As such, for this language, I'm not interested in pointers and am weary of obj... |
Section 12.4 of G.V. Bard's Algebraic Cryptanalysis discusses the XL-algorithm (first reported by N.T. Courtois and A. Shamir in Efficient algorithms for solving overdefined systems of multivariate polynomial equations and Courtois' thesis).
The technique is based on the following. Say we have a system of polynomial eq... |
I have a following problem:
Let $P^{SAT[1]}$ be a class of problems decidable by a deterministic polynomial Turing Machines with SAT oracle. (only one question to oracle).
Assume that:
$\mathrm{co}NP \neq NP \neq P$
Decide if $coNP \cup NP \neq P^{SAT[1]}$ or $\mathrm{co}NP \cup NP = P^{SAT[1]}$.
I know how to show th... |
In CLRS (on pages 49-50), what is the meaning of the following statement:
$\Sigma_{i=1}^{n} O(i)$ is only a single anonymous function (of $i$), but is not the same as $O(1)+O(2)+\cdots+O(n)$, which doesn't really have an interpretation."
|
Suppose we have a conjecture on graph theory that can be (dis)proved by means of a counter example, then, is it true that every alternative (dis)proof of the conjecture can be mapped to a counter example?
This is in the general case, but for instance, can any proof that the hadwiger's conjecture is false be mapped to ... |
Given a string, take all of its substrings (including the empty string). For example, given $abc$, we can form a set $\{\emptyset, a, b, c, ab, bc, abc\}$.
Given a regular language, take all the substrings of each of its strings, and form a language thereof. I wonder if the formed language is still regular?
Btw, is t... |
I am reading over the article found here specifically §D.4.4 Exceptions, Flags and Trap Handlers and am confused by the table D-4 in that section.
Specifically the arguments sent to the trap handler for the overflow and and underflow exceptions.
It shows round(x2-α) as the argument for both the over and underflow con... |
I'm having trouble figuring out the upper bound running time for this scenario:
Input:
$N$ number of strings
$M$ upper bound of string length
$T$ threshold for edit distance (2 strings with a Damerau-Levenshtein edit distance lower than $T$ are considered "duplicate")
Expected values
$N \approx 1,000,000$
$M \appr... |
As i passed PHD entrance exam, some days ago, i want to find solutions for challenging problem.
In Bayes network on X={X1,...Xn} each random variable has P parents and Q child's. for Xi we want to find minimum number of variable that Xi independent from other variables. at least, how many variable we need?
i think, we... |
Given a connected graph $G = (V,E)$, assume that there are partitions $\{p_0, p_1, ..., p_k\}$.
Denote the partition set of a vertex $v \in V$ as $p(v)$.
The neighborhood of a vertex $v$ is denoted as $N(v)$
I need to find a 4-clique $V' = \{v_0, v_1, v_2, v_3\}$ such that the total degree of $V'$ is maximum and $\fora... |
Consider the function $B:\mathbb{N}\rightarrow\mathbb{R}$ defined by
$$
B(n) = \begin{cases}
1 &\text{if $n\le 2$}\\
B\left(\left\lceil\frac{n}{\log_2n}\right\rceil \right)+n&\text{if $n\ge 3$}
\end{cases}
$$
I'm having a lot of trouble with this question. I tried substituting things like $n=2^... |
Suppose we have two sorted arrays $A$ and $B$, and we want to find the indices in $B$ of all elements of $A$. We can do this in $\mathcal O(|A|\log|B|)$ time by simply binary searching $|A|$ times. We can do it in $\mathcal O(|A| + |B|)$ time by iterating through the arrays together like the merge phase of a mergesort;... |
The problem I have is given a Tree graph , and two paths from u1 to v1 and u2 to v2 where u1,u2,v1,v2 are vertices of the Tree . How efficiently can we check that whether they are vertex disjoint paths or not ? The solution I thought was that the LCA of (u1 and v1) should be the ancestor of u2 or v2 or vice versa . But... |
Note: This is part of a homework exercise. I am asking for clarifications, not a solution!
Given: Assume $g: \mathbb{N} \mapsto \mathbb{N}, g\in R$ ($R$ is the class of recursive functions) is a strictly monotone function, i.e., $\forall n\in \mathbb{N}: g(n) < g(n+1)$.
Prove that $g(\mathbb{N})$ is decidable.
Clari... |
I've found an algorithm that acts like a depth first traversal that don't recognizes nodes that have been visited before.
A
/ \
B C
\ /
D
|
E
If run on this graph, the algorithm will traverse in this order:
A, B, D, E, D, B, A, C, D, E
Is there any way I can express the run-time complexity of this algorith... |
I hope I'm in the right section:
I know that if P = NP, then 3-SAT can be solved in P (Cook), but is the opposite valid, too? If P != NP, then 3-SAT is not in P?
Thanks!
|
I got an unweighted, undirected graph, with $N$ vertices, where each vertex has degree $K$. In my case its a grid with dynamic obstacles.
My goal is to output a map, based on given location on the grid, with the shortest path to all the cells on the grid, some thing like this:
4 3 2 3
3 2 1 2
4 x x 3
5 6 5 4
The sta... |
As a foreword, I'm not asking what the algorithm is, just whether one can possibly exist (though, if it does already exist and someone knows what it is, that'd be great).
Basically, given two sets $S$ and $T$, I want to compute the two set differences $I = T \setminus S$ and $R = S \setminus T$. The goal is that if $S$... |
We let $\alpha = \alpha_1\alpha_2\alpha_3\ldots$ be an infinite random sequence (under the uniform measure) where $\alpha_i$ may be $1$ or $0$, and then define the boolean function $B_k$:
$$
B_k(\alpha_1\ldots\alpha_k) =
\begin{cases}
1 \text{ if at least } \lceil k/2 \rceil \text{ of its inputs are } 1
\\
0 \text{ o... |
Given a weighted, undirected graph $G = (V,E)$, how can I compute the average weight of edges?
It seems an easy problem (divide the total weight to the number of edges!)
but I couldn't manage to find the sum of the edge weights since each
edge can be counted several times while iterating through the vertices.
|
I am having trouble understanding a part of the proof of Lemma 2 (Page 184).
It says the length of the tour is $$ \leq \lceil n^{1/2} \rceil + \triangle(n + \lceil n^{1/2} \rceil) + \sqrt{2} $$ I don't understand how they came up with this inequality. I can understand where the $\sqrt{2} $ comes from, since we have to... |
The related and interesting fields of Information Theory, Turing Computability, Kolmogorov Complexity and Algorithmic Information Theory, give definitions of algorithmically random numbers.
An algorithmically random number is a number (in some encoding,
usually binary) for which the shortest program (e.g using a Tur... |
I would like to know if there is a known decision problem with the following characteristics:
Represented in unary, the problem is decidable in polynomial time.
Represented in binary, the problem is not decidable in polynomial time (and this fact has been proved, not just conjectured).
For example, Subset-Sum is in $... |
$\text{HAMPATH} = \{(G=(V,E),s',t')| \text{ G has a Hamilton path from s' to t' } \}$
$\text{LONG-PATH} = \{(G,s,t,k) | \text{G has a simple path p from s to t, length(p) $\geq$ k} \}$
I'm trying to prove a polynomial reduction, $\text{HAMPATH} \leq_p \text{LONG-PATH}$.
My thought was to take an instance of $\text{HA... |
The Berman-Hartmanis conjecture more or less states that if one-way functions exist, there are some problems in $NP$ which cannot be polynomially reduced to $NP$-complete (cf. Ker-I Ko, A Note on One-Way Functions and Polynomial-Time Isomorphism).
Since the Cook-Levin theorem states that $NP$ is polynomial-time reducib... |
I know that there is something called partial correctness, but I was wondering if there was a way to tell how close a semi-correct program is to a fully correct program.
For example, if you had a sorting program that almost completely sorts an array, could you use Hoare logic to determine how close it is to getting th... |
A recurrence relation computes value $d_n$ with the $\{d_{i},d_{j}\ldots\}$ previous digits of the sequence
So for example, the Fibonacci sequence is defined as follows:
$$
F_n = F_{n-1}+F_{n-2},\ \ \ F_0=0, F_1=1
$$
The classic closed form solution is given by the Binet formula:
$$
F_n = \frac{\phi^n-\psi^n}{\sqrt{5}}... |
In combinatory logic, the axiom of composibility asserts that for any two combinators, $A$ and $B$, there exists a combinator $C$ that composes $A$ and $B$. That is, for all $A,B,x$ there exists a $C$ such that: $CABx = A(Bx)$.
But what if $A$ and $B$ have arities other than 1? In particular, suppose that $A$'s ari... |
I currently studying machine learning and pattern recognition area. Today, my professor said implementing an unsupervised system that automatically labels data is difficult. Why is that?
I think if I am given a data set, then I can categorize all data into groups. Then, for unknown input data, I can extract features an... |
As I read this lecture for being familiar with VC dimension we find on p. 8:
VC(half intervals in $\mathbb{R}$ ) = 1 .... no subset of size 2 can be shattered
VC(intervals in $\mathbb{R}$ ) = 2 .... no subset of size 3
It's not clear to me. I read on Wikipedia about the difference of Half Interval and I... |
Assume two hypotheses classes $H_A\subset H_B$ defined over the same instance space $\delta$. Assume also $VC(H_A)=d$, does this mean $VC(H_B)\geq d$ ? where $VC$ is the VC dimension.
We can use the same set of instances shattered $H_A$ to shatter $H_B$. Seems obvious to me but is it true? is there a reference for thi... |
I am currently reading and watching about genetic algorithm and I find it very interesting (I haven't had the chance to study it while I was at the university).
I understand that mutations are based on probability (randomness is the root of evolution) but I don't get why survival is.
From what I understand, an individu... |
Consider the matrix with dimension $m \times m$:
$$
M =
\begin{array}{cc}
1 & 1 & 1 \\
0 & 1 & 1 \\
1 & 0 & 1 \\
\end{array}
$$
Its 1-D representation:
$$ M^* = \begin{array}{cc} 1 & 1 & 1 && 0 & 1 & 1 && 1 & 0 & 1\end{array}$$
Now, another dimension added, so that the matrix becomes:
$$
N =
\begin{array}{cc}
1 & 1 & ... |
I want to prove that $ L = {a^n b^m c^{ \lfloor \frac{n}{m} \rfloor } } $
isn't context free language, so I choose N - constant from lemma
so the word is
$ w = a^N b^N c $ and $ w = uvxyz $
1 case
v and y contains only a
$ v,y \in a^{*} $
and $ w_2 = a^{N+B} b^{N} c $ where $ B > 0 $
is it correct to say that it does... |
I am professor of Electrical Engineering who will teach, for my first time, a class to first-year EE students about programming. This will be their first contact in an academic setting with programming, algorithms, data structures, etc.
When introducing the subject of algorithms, I'd like to present a few problems, giv... |
I need to pick a focus in my Masters program.
The running candidates are
Networking
Bioinformatics
Data mining
Computer Image Recognition
In order to avoid this becoming a discussion, I'd be interested in specific data about the type of research done in these fields, or anecdotal experience on why one particular... |
An automaton, as I have seen so far, is used to tell if a string belongs to the language that the automaton recognizes. This is determined by the final state of the automaton running on the string as an input. I wonder what role the output of the automaton plays here for this decision problem?
I saw that an automaton ... |
Like the title says, I am trying to solve the quadratic equation while avoiding floating point arithmetic. More specifically, I will be coding this algorithm in C.
I have integer values for a, b, and c. The result can be formatted in any way, though integers would be best. I would also like to avoid losing precision wh... |
Why Do Computers Use the Binary Number System (0,1)? Why don't they use Ternary Number System (0,1,2) or any other number system instead?
|
Why do computer use Hex Number System at assembly language? Why don't they use any other number system like binary, octal, decimal? What thing forced computer designer to use hex system at assembly? Why it looked so beneficial to them?
|
Is there a way to generate a random permutation of the numbers 1 to N such that I can find the k-th element of the permuted list without needing to either 1) store the entire permuted list, or 2) compute the elements 1..k-1?
|
I am writing a paper. I have a problem and I want to prove that it is an NP-hard problem. However, for simplicity, I select a subset from my problem to prove that it is an NP-hard problem. Although I think that it is reasonable that if a subset of problem is NP-hard, it result in the problem being NP-hard, but I think ... |
I want to show that the following problem is NP-Complete:
For a set of vectors $v_1,\ldots,v_n \in \mathbb{N}^d$ and an integer $k$, does there exist a subset $S \subseteq \{v_1,\ldots,v_n\}$, such that $S$ has $k$ elements and all coordinates in the vector $\sum\limits_{x\in S} v_x$ are powers of two?
I'm quite certai... |
We have two computers, Comp1 and Comp2, which hold binary matrices A and B of size $n\times n$.
We want to check if the matrices of the computers are identical except for exactly 1 entry.
Comp1 has to send $O(n\log^2n)$ bits to Comp2 and Comp2 should return 0 or 1 (for "no" and "yes" respectively) for the answer.
If th... |
I am currently reading Multidimensional and Metric Data Structures by Hanan Samet for fun. The combined index is discussed on page 5-6. I do understand it in the sense that the inverted file itself is an index, and then we extrapolate another index by lexicographically ordering the attribute.
So, given a record with fo... |
I know you can convert every context-free grammar into Greibach normal form grammar.
But can I convert every deterministic context-free grammar into deterministic Greibach normal form grammar?
|
This question is related to my previous question:
Looking for a set implementation with small memory footprint
I'm looking for information about combined data structures, which can efficiently represent a set S of non-intersecting sub-intervals of the given integer interval [0, MAX) with the single operation:
testAndI... |
I have difficulty with proving that the language
$ L = \{ a^p b^q | p \ge 1 , q \ge 1 , p \ge q^2 \vee q \ge p^2\}$
$ w = uvxyz $
I've chosen word $ w = a^{N^2} b^N $ where $ N $ is a constant from pumping lemma and I proved cases where a $ v,y $ is entirely in $ a $ and $ v,y $ is entirely in $ b $ , but how to prov... |
The LazySelect algorithm is given in these slides as follows.
We have a set $S$ of $n = 2k$ distinct numbers and want to find the $k$th smallest element.
Let $R$ be a set of $n^{3/4}$ elements chosen uniformly at random with replacement from $S$.
Sort $R$ and find $a$ and $b$ such that $\mathrm{rank}_R(a) = kn^{-1/4} ... |
I am confused on the following:
In the following trivial code:
for (int i = 0; i < n; i++) {
for(int j = i + 1; j < n; j++) {
for(int k = j + 1; k < n; k++) {
//some code here
}
}
}
I know that the complexity is N^3. But I am confused on some details.
The outer loop is executed... |
I'm trying to teach myself Quantum Cryptography for an exam I have soon, and I came across the following question:
To establish a common key, Alice and Bob analyse a sequence of 20 photon pairs. Alice measures the photon sequence: $$1\:1\:0\:1\:0 \qquad 0\:0\:0\:1\:0 \qquad 1\:0\:1\:0\:1 \qquad 0\:1\:1\:0\:1$$ using t... |
For reasoning about things like NP-completeness, we typically use many-one reductions (i.e., Karp reductions). This leads to pictures like this:
(under standard conjectures). I'm sure we're all familiar with this sort of thing.
What picture do we get, if we work with Turing reductions (i.e., Cook reductions)? How d... |
A) Solve this recurrence where $T(0)=0$ and write it in O-notation:
$T(n)= {2 \over n} (T(0)+T(1)+...+T(n-1))+c$
So, I started to calculate:
$T(1)=2(0)+c=c$
$T(2)=1(0+c)+c=2c$
and so on, which gives me that $T(n)=nc$
This I can prove by induction: $(n-1) \rightarrow n$
$T(n)= {2 \over n} (0+c+2c+...+(n-1)c)+c ... |
I took an algorithms class on Coursera. The professor in the video about hash tables said that
What's true is that for non-pathological data, you will get constant time operations in a properly implemented hash table.
What does "non-pathological data" mean? Can you give some examples?
|
I know it might sound like a silly question, I just can't get my head around it...
I just read that $DSPACE(f(n))\subseteq DTIME(n\cdot 2^{O(f(n))})$.
The proof for it relies heavily on the fact that for a given $L\in DSPACE(f(n))$, the turing machine $M_L$ (which decides $L$ while consuming no more than $p(|x|)$ mem... |
I was trying to find all the negative cycle vertices using the Bellman–Ford algorithm using this paper solution 7.1(b) in $O(V)$ by tracing back the predecessor subgraph.It is also stated in this answer too. But then while googling I found another Stack Overflow question it is proved that finding negative cycle vertice... |
I am working on my thesis on revenue management. I have been over the following problem multiple times now, but I fail to see where my mistake is. This example is based on The Theory and Practice of Revenue Management by Talluri and Ryzin, page 61. (See also errata, there is a small mistake in the equation). The recurs... |
Given a deterministic infinite word transducer (also called deterministic generalized sequential machine) with the following restriction:
There is exactly one initial state
All states are final
The transducer is real-time, i.e. reads excactly one input character on each transition
The transducer produces zero or more ... |
I've found numerous places that claim that the paper "How to Generate and Exchange Secrets" by Andrew Yao introduces garbled circuits as a solution to the secure multiparty computation problem. However, I can only seem to locate the extended abstract which lacks proofs and does not seem to mention garbled circuits. It ... |
I know very little about arithmetic circuits, so maybe it is something well-known.
Given a small circuit consisted of $\{1,x,-,+,*\}$ defining one variable polynomial. Let be additionally known that degree of this polynomial does not exceed $d$ and all the coefficients are small. I wonder if exists a fast way to find a... |
Theory of computation tells us that there are some languages that cannot be recognized by a Turing machine. That is, there are well-defined problems for which no Turing machines can provide an algorithm which solves the problem.
Many problems that are undecidable seem to have a reduction to the Halting problem: Matyase... |
I posted this same question on stackoverflow but I think it might be better suited here as I am having trouble with coming up with an algorithm with O(log(n)) running time.
Question:
I am completely lost for this question. I absolutely CANNOT figure out a way to get an algorithm that run in O(log(n)) time. The ONLY al... |
If $\sf RP = NP$ then the hierarchy collapses to its second level (by the Karp-Lipton theorem). But what about $\sf NP$ and $\sf coNP$?
I tried to prove that $\sf BPP$ is contained in $\sf NP$ (the other direction is trivial if $\sf RP = NP$) but to no avail, and I'm not even sure that it's true.
What do you think?
|
I have this language:
$$ L = \left\{ w \in \{a,b,c\}^* \;\big|\; |w| / |w|_a = 3 \right\} $$
where $|w|_a$ is the number of occurrences of $a$.
How can I find a grammar that generates it?
|
In our operating systems class, the teacher told us about deadlocks prevention methods. One of them is that to select as a victim the process which requires the CPU time or one that requires a lot of resources, and remove this process. The next time the algorithm is called, it may be possible that again the same proces... |
consider the policy iteration algorithm for a finite state MDP. Suppose the initial policy is a stochastic policy. Now, can the optimal policy be deterministic after improvements ? Or, can we say that always the optimal policy will be a stochastic one ? Confused about this. Any ideas will be helpful. The reason I am as... |
Hash tables are said to be amortized $\Theta(1)$ using say simple chaining and doubling at a certain capacity.
However, this assumes the lengths of the elements are constant. Computing the hash of an element requires going through the element, taking $\Theta(l)$ time where $l$ is the length.
But to discriminate between... |
I'm solving a question from CLRS where we need to prove that (ceil(lg lg n))! is polynomially bounded.
Let g(n)=(ceil(lg lg n))!
lg(g(n))=lg((ceil(lg lg n))!)
=theta(ceil(lg lg n) * lg (ceil(lg lg n))) [since lg(n!)=theta(n * lg n)
and replacing n by ceil(lg l... |
Do there exist models of type theory that allow types to contain an uncountable number of inhabitants? Traditionally type theory seems to be swirled in with computable programs as constructive proofs so types are always countable. I want to know if we go outside computable programs do we get types that have an uncounta... |
i'm studying for PHD Entrance Exam on Stanford. one of previous material exam designed very challenging.
i want to design a NN for classifying following 2-class problem.
1) output should be -1 or 1.
2) output should be 0 or 1.
for sove this question i think using XOR neural network for following problem for above da... |
Consider the following problem:
Given an array of $n$ integer numbers (positive and negative), find a (contiguous) subarray for which the product $(\text{sum of the elements})\times(\text{length of the subarray})$ is maximum.
Is there an algorithm with complexity less than $O(n^2)$?
For instance, if the array is
$$-... |
In the paper "Resolution for Quantified Boolean Formulas", I am unable to understand the proof of theorem 3.4. Please help me with the basic concept used on page 4:
The concept that I am referring to is:
Then $\mathit{\Phi}$ is false if and only if there exists a clause $\phi \in N^+_\mathit{\Phi}$ or $\phi \in N_\ma... |
Is there any result about the extension of first order logic with least fixed point operator, being complete (as logic in general on infinite structures too) or not? In other words does the Goedel completeness theorem of first order logic extent to such FO-LFP logic ?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.