instruction stringlengths 35 29.1k |
|---|
I'm studying a routing problem on a cyclic butterfly network. The paper I am reading states that two properties of the cyclic butterfly network make it efficient for the routing algorithm it describes. I'm new to this subject, and I'm struggling to understand the first property, which is:
"(1) It embeds a Benes network... |
I have a polynomial $P(x)$, and given some constant $d$, I need to find the polynomial $P(x+d)$. For example, if $P(x)=x^2$ and $d=1$, then the result would be $P(x+1)=(x+1)^2=x^2+2x+1$ (with the coefficients stored in an array/vector).
I know the algorithm with $O(n^2)$ time complexity, which is based on Horner's meth... |
AIXI is a theoretical formulation for artificial general intelligence. While AIXI is computationally intractable, there are approximations of AIXI like https://arxiv.org/abs/0909.0801 that are computable.
Some time ago, I stumbled upon theoretical artificial general intelligence, and I would like to know what are the p... |
Can someone explain me the way harddisks work? :/
The size of a block is specified in the filesystem, am I right? As you can see in the picture from wikipedia, the disk is divided into circle sectors. But the blocks on the outer tracks are obviously larger (physically)...
So the "bit-density" on the outer blocks is wa... |
We're given two arrays $A$ and $B$ with size $N$ and $M$ respectively. We want to find a set $P = \{(a_1, b_1), \dots, (a_s,b_s)\}$ such that
for each $i\in\{1, \dots, s\}$, $a_i\in A$, $b_i\in B$ and $a_i>b_i$ and $a_i,b_i$ musn't be chosen before;
$\sum_{i=1}^s (a_i-b_i)$ is maximized.
A natural approach is to sort... |
I have a DAG. I want to construct a boolean formula $\varphi$ that represents all paths from a source node to a sink node.
In particular, I have a variable for each vertex. A path $v_1 \to v_2 \to \dots \to v_k$ is represented as the subformula $v_2 \lor \dots \lor v_{k-1}$. I want a formula $\varphi$ that is a conj... |
I'm working on a compression algorithm for a specific kind of data. I have found a way to discard (important) parts of the data during compression as I have also found a way to recover the missing parts during decompression.
The decompression algorithm most of the times will infer the data equal to the discarded one. ... |
I have come up with:
S→0SX | 1SY | 2SZ | SS | ϵ
X→1
Y→0 | 2
Z→1
I think I am wrong. Any directions?
|
I have a discrete function of two real variables defined as a set of point in a rectangular domain. The function is smooth. I need to approximate it with a polynomial function of the 2nd degree with the error as little as possible. What algorithm can I use to find out the constants for the polynomial?
|
I am thinking about the worst-case space complexity of an algorithm.
Obviously, if $f \in O(nm)$ then $f \in O(n+nm)$. But is the converse true?
$O(m)+O(nm) = O(m+nm) = O(m(1+n)) = O(m)O(1+n) = O(m)O(n) = O(nm)$
If that were true then $O(n+nm) = O(m+nm)$
|
Given a sequence of positive reals $a_1, a_2, \dots, a_n$ and an integer $m$, for each $j$ assign $a_j$ to a machine $i$, $1< i < m$, so as to minimize the maximum, over $i$, of the sum of all reals assigned to machine $i$.
Theorem: There is no randomized $m$-machine scheduling algorithm with a competitive ratio le... |
Here is my earlier question. But there was no full answer.
I've decided to include specific DIMACS files:
http://jarvis2.hmcloud.pl/sat/cnf.formula.10 (15.8MB)
http://jarvis2.hmcloud.pl/sat/cnf.formula.15 (53.5MB)
http://jarvis2.hmcloud.pl/sat/cnf.formula.20 (134.6MB)
Are these CNF formulas fulfilling a condition of Sc... |
If I have a task graph T and want a schedule to optimize the make-span, what is currently the best approximation algorithm for this problem? Are there any constant approximation algorithms?
|
This month the IEEE Software magazine has published the article Voice of Evidence: A Look Back. This is a kind of impact analysis of the Voice of Evidence (VoE) series of articles.
As you know, these articles are meta-analysis about software engineering practices and they give invaluable information about which things ... |
Input alphabet = {a,b,c}
I tried with the following grammar :-
S -> aSa / bSb / T
T -> cTc / cSc / cBc
B -> c / cXc
X -> a / b / aXa / bXb / epsilon
This grammar is not able to generate 'cacac' .Is there any way to write this grammar with less number of productions or are any productions redundant here ?
Thanks.
|
Define languages $L_0$ and $L_1$ as follows :
$L_0 = \{\langle M, w, 0 \rangle \mid M \text{ halts on }w\} $
$L_1 = \{\langle M, w, 1 \rangle \mid M \text{ does not halts on }w\}$
Here $\langle M, w, i \rangle$ is a triplet, whose first component $M$ is an encoding of a Turing
Machine, second component $ w$ is a string... |
The ordered order-k Voronoi diagram (sometimes written OOKVD) partitions the plane into regions such that the k closest sites are the same and in the same order for all the points in a region.
I am interested in particular in the case k=n, the number of sites.
I would also like to know the upper and lower bounds in the... |
Consider the table employee(empId, name, department, salary) and the two queries Q1 ,Q2 below. Assuming that department 5 has more than one employee, and we want to find the employees who get higher salary than anyone in the department 5, which one of the statements is TRUE for any arbitrary employee table?
Q1 :
Select... |
I'm looking at some proof that shows $NP^{NP\cap coNP} = NP$.
Let's consider the non-trivial direction. Consider $L\in NP^{NP\cap coNP}$. Then, there's an $A\in NP\cap coNP$ such that $L\in NP^A$.
Since $A\in NP\cap coNP$, there're two machines $M_A$ and $M_{\overline A}$ to decide $A$ and $\overline A$, respectively. ... |
So I'm trying to get my head round Curry-Howard. (I've tried at it several times, it's just not gelling/seems too abstract). To tackle something concrete, I'm working through the couple of Haskell tutorials linked from wikipedia, esp Tim Newsham's. There's also a useful discussion when Newsham posted the tutorial.
(But... |
I am working on a problem in which I have to solve 0-1 linear programs, that is linear programs where some of the variables are binary, i.e. either 1 or 0.
Lets say I have a fixed number of $n$ variables in my program of which $k \leq n$ are binary. The other $n-k$ variables are continuous. My question is:
What can be ... |
So, i would like to know the time complexity of the following codes:
x = (float) rand() / rand(); // T(4)
while (x >= 0.01) // T(?)
{
x *= 0.8; // T(?) x T(2)
}
Assuming that all the basic operations are perfomed once, is the best case T(1) - constant time? Since, that might only happen when the random x gen... |
The only graph problem that I worked with is TSP. It is exponentially hard, but there are tons of heuristics which allows to find near to optimum solution.
So I was wondering, is there any graph problems (or optimization problems which could be mapped onto graph) that are exponentially hard and can not be solved (even ... |
Consider the following complexity class $IP^\star$, a variant of $IP$.
A language $L$ is in $IP^\star$ if there's a proof system $(P,V)$ s.t.
$V$ is a verifier runs for a polynomial time and:
$$x\in L \implies Pr[(P,V)(x) = 1] \ge 3/4 \\ x\not\in L \implies
> Pr[(P,V)(x) = 1] = 0 \\ $$
Prove that $NP = IP^\star$. ... |
I need to find an upper bound for $T(n)=T(\sqrt{n})+10\log\log n$.
I thought first to make a substitution: $m=\log n$. Then:
$$
T(2^m)=T(2^{m \over 2})+10\log m
$$
Let $S(m)=T(2^m)$:
$$
S(m)=S\big({m \over 2}\big)+10\log m
$$
Now we can use Master theorem.
Suppose it's the case when $f(m)=O(m^{\log_2 1-\epsilon})=O(m^... |
Note that this is not duplicate of my previous question: how to simplify algebraic expressions, though it is similar, but still this is different, this is not the same.
I need an algorithm that either proves or refutes that:
∀X,Y,Z,n,i,j,k,l: X∈{A,B} ∧ Y∈{A,B} ∧ Z∈{A,B} ∧ i,j,k,l≥0 ∧ n≥1 ∧ i+j+k+l≤n-3
$\Sigma$ (A+B)iX... |
Suppose I am running an experiment with some subjects, and I obtain some numerical data from them. The subjects are divided into 2 experimental groups. Rather than display the means of each group in a bar graph, I would like to show their individual data. So I plot the data like so:
This is all fine and good, but let'... |
In a recent algorithms course we had to form a condensation graph and compute its reflexive-transitive closure to get a partial order. But it was never really explained why we would want to do that in a graph. I understand the gist of a condensation graph in that it highlights the strongly connected components, but wha... |
Alphabets = $\{0, 1, \epsilon, \emptyset, [, ], \cup, \circ, \star\}$
where $\circ$ stands for concatenation, $\star$ is kleene star, $\epsilon$ is empty string, $[$ and $]$ are brackets to be used for language to be generated.
Only those Regular Expressions to be considered which don't have nested brackets $[[]]$.
How... |
Which is better, Flood Fill or Scanline Fill algorithm in computer graphics? My thoughts says that both of them has the same efficiency in term of time and space complexity. Maybe you guys have another thinking? Thanks
|
I'm stuck on problem 9.4 from The Nature of Computation which reads:
Dynamic Salesman. A naive search algorithm for TSP takes $O(n!)$ time to check all tours. Use dynamic programming to reduce this to a simple exponential, i.e., to solve TSP in $O(2^npoly(n))$ time. Can you do this without using an exponential amount ... |
Equality problem is checking if 2 DCFL's or CFL's are producing same language.
I read that it is decidable for DCFL and undecidable for CFL.
If we consider a DCFL like a^n b^2n / n>=1, here we can draw a PDA for this in two ways.
So how can we check if 2 DCFL's produce the same language by just looking at the PDA as t... |
This is a simplification of a real world problem and only a small piece at that.
Example sets are
---------------------- ------------------------------------
| Set1 | Set2 | Set3 | OR | Set1 | Set2 | Set3 | Set4 | Set5 |
|--------------------| |--------------------|--------------
| 1 | 10 | 40 |... |
How do I test if a circle (x,y,radius) is inside a polygon ([x,y],[x,y],[x,y],[x,y]...) without touching the edges?
Update
I decided to do a point in polygon followed by a circle line collision on each edge, this let me know first if the circle was within the polygon and then told me if it was colliding with any of the... |
I was reading this article. In its third paragraph of the third section, named The Classical computational theory of mind, it said that Most Turing Machines are not programmable. I got the literal meaning out of the statement.
I have only done Automata Theory 101 and the way I know Turing Machine, not much is making se... |
I know that intersection of CFL and regular language is CFL and hence CFL is closed if one of the languages is regular. One of the most common examples to show this is regular language being $p^*q^*$ and CFL being $p^n q^n$.
Now if I promote regular language to CFL according to Chomsky hierarchy as all regular language... |
How can I model logical OR as an integer linear program?
$$(y_3 + y_4 + y_5 + y_6 = 2) \lor (y_2 = 1)$$
where $y_i \in \{0, 1\}$, $1$ = True and $0$ = False.
|
If the time complexity $T(n)$ of two functions $x(n)$ and $y(n)$ are mutually recursive, as in Time complexity of mutually recursive functions, this gives $T(n)=O(2^n)$. But how do you measure an algorithm with two or more (4 in the example below) recursive functions that are not necessarily mutually recursive?
Exampl... |
The reduction from SAT to Clique shows a way to construct a graph with cliques from a Boolean formula. A closer look at that reduction even yields a simple algorithm which finds a large clique in the graph from a given satisfying assignment to the variables. That mapping is bijective: each satisfying assignment is mapp... |
I'm trying to understand what a random binary tree is. According to Wikipedia:
Two different distributions are commonly used: binary trees formed by
inserting nodes one at a time according to a random permutation, and
binary trees chosen from a uniform discrete distribution...
If I start with a root and then appe... |
Statements of the PCP theorem always speak of a proof of length $poly(n)$. But what polynomial is that exactly? Could you actually construct the PCP for some mathematical fact in real life?
|
The following is an excerpt from the Estimating LAT Confidence section of this paper:
... Since some LAT detection rules are more reliable than others, we
would like to have a confidence value in each LAT that can be used to
weight each LAT appropriately during answer scoring. To accomplish
this, we trained a lo... |
I read this answer below and got into another question.
Why is the consensus number for test-and-set, 2?
I also read that read/write registers have consensus number 1.
But I see that in test&set (also in compare&swap) by using read write registers alone, we still arrive at consensus.
I think I am missing something very... |
I have used a purely functional binary tree structure in which there is a single node that is "marked". It allows for $O(1)$ access and modification of the marked node's value, as well as $O(1)$ traversal upwards and downwards.
It is represented as a pair $(M, P)$, where $M$ is the marked sub-tree and $P$ is a list of ... |
This is what is known about the halting problem and semi-decidability :-
The halting problem says that for a given input x and a machine H, we can't say whether the machine H halts or not on input x.
A language is said to be Semi-decidable if there exists a Turing machine which halts if a word belongs to the language (... |
I'm trying to implement an Hopfield Network for pictures of 32x32 bits either 1 or -1;
I have these 3 pictures and I transform each of them in a vector of 1024 elements.
Then I take the 3 vectors and I build a matrix M:
U = [v1 v2 v3]
So I compute:
M = (U*U')/1024
where M is a matrix of 1024*1024 elements and I set ... |
According to wikipedia (https://en.wikipedia.org/wiki/P-complete):
The most basic P-complete problem is this: given a Turing machine, an input for that machine, and a number T (written in unary), does that machine halt on that input within the first T steps? It is clear that this problem is P-complete. if T is written... |
I've recently come across a following problem. In a rectangular array of ones and zeros one has to find maximum non-degenerate rectangle whose sides are filled with ones. By "maximum" i mean any rectangle with maximum possible perimeter. By "non-degenerate" i mean that all sides consist of at least two cells. We do not... |
How is the 3-SAT problem reduced to solving for a system of nonlinear modular equations?
I have read https://stackoverflow.com/questions/4294270/how-to-prove-that-a-problem-is-np-complete in how to prove that a problem is NP complete?. But how is this done for systems of nonlinear modular equations specifically?
In t... |
Suggest a data structure to perform a query $sumRange(low,high)$ which will return the sum of the elements whose key $k$ satisfies $low \le k \le high$ in $\Theta(\log n)$ time.
I found the original problem here (although it's for counting) but it runs in $\Theta(n)$ time. However, I think with additional data struct... |
From Wikipedia: Off-side_rule#Implementation, there is a statement:
...This requires that the lexer hold state, namely the current
indentation level, and thus can detect changes in indentation when
this changes, and thus the lexical grammar is not context-free –
INDENT/DEDENT depend on the contextual information... |
How to find a pair of indices $1\le i \le n$,$1\le j \le n$, $i\neq j$ in array $A[1..n]$ such that $0\le A[i]-A[j]\le\frac{max(A)-min(A)}{n-1}$ in $\Theta(n)$ time? max(A) is the max number in the array while min(A) is the min number.
Let $avg=\frac{max(A)-min(A)}{n-1}$. If we sort the array $A$ and calculate the dif... |
I am supposed to create an algorithm for this statement: “Two input lists of size n have at least one element in common”
This is my algorithm:
bool func(L1, L2){
val1, val2 = 0;
for(int i=0; i<n; i++){
val1=L1[i];
for(int j=0; j<n; j++){
val2 = L2[j];
if(val2 = val1){
... |
I am trying to wrap my hand around the undecidability proof of the Halting problem, and to me it really seems to be more of a proof about representation than decidability. Namely, the proof that some languages are undecidable by Turing machines seems to simply state that I cannot find finite representations for arbitra... |
Max-heap is called a "strong" max-heap if all the nodes at certain level are less than all the nodes at the level before them. What is the most efficient way to build such a heap from a given array?
I was thinking about something similar to the regular build heap algorithm: scanning the array from right to left, compa... |
Lets say i have a sequence ${6, 10, 11, 16, 17}$. Each number represents number of coins. The task is to find the minimum swaps to convert the sequence into AP
Lets say common difference is $3$.
To convert into AP, I'll do the following
Take one coin from $10$ and give it to $11$.
one from $16$ and give it to $17$.
So... |
By the definition of L=DLOGSPACE or of NL=NLOGSPACE (or any sublinear space class) there is an extra tape (for the Turing machine): the input tape, which is only for reading - but for arbitrary reading. The machine can read the first 10 cells and then maybe go back to read the 1st und 2nd cell.
My question is: If we r... |
I had an exam in algorithms. The question stated:
Given $n$ points in the plane, find an algorithm that finds two centers (which can be any centers in the plane) such that the sum of the squares of the distances from the points is minimized. Prove your algorithm and analyse its complexity.
As I understood this questi... |
Is anyone aware of an algorithm to determine which vertices/edges would disconnect an undirected graph if removed? For all vertices/edges.
Of course I could run a BFS for each vertex and for each edge to test if the remaining graph would be connected. But is there anything more efficient?
In the end I would like to uni... |
Assume that n is the number variables of the given 3CNF formula (n≥3) and all clauses in the given 3CNF formula are different.
That means that for each clause, each literal can be either positive or negative and be one of the n variables, so the number of options for each literal is 2n, but each clause has exactly 3 li... |
Given an N x M matrix. The task is to repeat the following steps K! times.
Add all the elements of the matrix and get a matrix sum (S) % mod 10^9 + 7
Add S to all the elements. % mod 10^9 + 7
Repeat.
What I can think of regarding the complexity it will O(K! x N x M).
But K ranges from 1 to 10^5 and this is a huge num... |
How do we know INVERSIONS-COUNT algorithm (exercise 14.1-7 from here), implemented in balanced tree really works?
We assume that the tree data structure we're using is an order statistic tree which means that a) it's a balanced binary tree, b) each node $x$ is augmented with $size$ field which tells us the size of the ... |
I have some interesting problem:
Prove that following problem is in $L$ (decidable in logarythmic
time). Decide if given undirected graph $G=(\{1,\ldots,n\}, E)$ such
that $\forall_{i,j\in \{1,\ldots,n\}} i\le j \to \operatorname{dist}(1, i) \le \operatorname{dist}(1,j)$.
Graph is represented as adjacent ma... |
Finding all anagrams for a word $w$ from a set of words is a problem with many well-known solutions (for example make a hash table mapping from the bag of letters of a word to the word).
But what about finding multi-word anagrams? For example "Eleven plus two" is an anagram of "Twelve plus one". In other words, given... |
Question:
I want to construct a optimal directory tree structure to access $n$ ($n < 256$) elements using only the keyboard with as few key presses as possible. For this one could consider the directory as double linked list with connections between the first and the last element. To access element E, one then would tr... |
Inspired by this post, I thought it would be a good idea to ask an analogous question in the context of distributed systems -
While most of us are familiar with the notion of Time Complexity as a measure of efficiency of algorithms, In the world of distributed systems, another important measure of efficiency plays a p... |
Suppose I have a (recursive) function $f:\Bbb N\rightarrow\Bbb N$ whose range is infinite, and I want to list all the function values without repeating.
That is, if $f(0)=1,f(1)=1,f(2)=5,f(3)=6,f(4)=6,f(5)=2$, I need a program with outputs $1,5,6,2$ I need it to firstly list $1$, then $5$, then $6$ and then $2$.
My i... |
If I were to construct a KD tree representing a sufficiently dense space, could it be used as a decision tree by querying it for the nearest neighbor to the point to classify?
|
In C++ a simple function like
int id_int(int x){return x;}
has type id_int :: int->int
a class template like
template<class T>
class List<T>{...};
has kind List :: *->*
But what is the type or kind of a function template like
template<class T>
T id(T x){return x;}
Could it be id :: \x. x->x? Does this even make sen... |
In CLRS, it works through an example going through a recurrence relation proof using the "substitution method".
We have the recurrence $$T(n) = 2T(\lfloor n/2 \rfloor) + n \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (4.19)$$
It claims:
We guess that our solution is $T(n) = O(n \lg(n)... |
Where can I find some code to generate random self-avoiding walks on 2 and 3-dimensional lattices whose side-lengths are powers of two? The walk should pass through every point on the lattice More specifically, how can I find a random hamiltonian path on a large $2^n \times 2^n$ or $2^n \times 2^n \times 2^n$ grid grap... |
I was solving the 8 queen problem and tried to look through the internet for comparison solutions to see how my solutions compared to others. I found one very small bruteforce solution that confused me. And i was wondering if anyone care to explain how the diagonal comparison actually works?
void solve(int n, int col, ... |
Definition: A minimal 3CNF formula is an unsatisfiable 3CNF formula with minimum clauses connected by conjunctions, where each clause is disjunction of 3 literals, that is if any of it's clauses is removed from the formula, then the 3CNF formula becomes satisfiable.
For some natural number n, where n is the number of a... |
How do you formally invalidate a question about the decidability of a partial halting problem solver that answers correctly with the following kind of input: Turing machines that don't use the partial halting problem solver inside?
I made this question and it was marked as unclear. I deleted it. This is my question:
"L... |
Comparative studies of tools like AProver, 2LS
|
I know and admit that this is long, but please read it slow and understand everything.
I think that this is one of the most interesting questions asked in computer science ever.
I don't expect for quick answers. Take your time to read slowly and to understand everything. I can wait. I don't rush.
In 1SAT, the turing ma... |
Prove: $P\ne BPP$ implies $P\ne NP$.
Obviously $P\subseteq BPP$ so the assumption is really $BPP\subsetneq P$. I'm trying to show the implication by contradiction. Let's assume that $P=NP$ and let's look at some language $L\in BPP$. Then, it has a proper probabilistic TM which decides it.
At first, I thought that I ... |
Given the following page table with a 24 Bit virtual address and 4KB page size and 4 byte long entries (%X means hexadecimal values):
I don't understand how to translate e.g. address %X00ABBA here. I really tried but I don't understand. I know I have 12 bits for the VPN, so I take 00A and look it up in the page table.... |
Where $n + 1 = 0$
and $0 - 1 = n$?
The $n + 1 = 0$ case can be achieved by using the modulus operator, but I can't figure out how to treat the $0 - 1 = n$ case.
|
I'm a new user so I cannot respond directly to this post here.
I'm confused about the answers to the question, namely that MAX-2-XOR-SAT is in $P$ iff each clause is of the form $(x_i \oplus \neg x_j)$ (or is it $(x_i \oplus x_j)$? There were two different answers). Couldn't you make a simple substitution $\neg x_i \r... |
I understand from the Wikipedia page on the Busy Beaver problem that the Busy Beaver values for 5-state 2-symbol (quintuple) Turing-machines have not been determined, because there are 'holdout' machines whose halting behavior is as of yet unknown.
Can someone provide me with a concrete example of such a 5-state 2-symb... |
The title says it all, I think.
We know there are universal Turing-machines that only use a binary alphabet. But who proved this first?
Turing himself showed the existence of a universal Turing machine ... but did he also show that such a machine can exist using only a binary alphabet? Or was that someone else?
Or was... |
I have trouble understanding Syntax directed translation/definition/actions. I am reading dragon book but it confuses me even more.
Having production for simple arithmetic
$$
\mathit{expr} \rightarrow \mathit{expr} + \mathit{expr} \mathbin{|} \mathit{expr} - \mathit{expr} \mathbin{|} \mathit{num}
$$
$$
\mathit{nu... |
I am new to understanding computer science algorithms. I understand the process of the binary search, but I am having a slight misunderstanding with its efficiency.
In a size of $s = 2^n$ elements, it would take, on average, $n$ steps to find a particular element. Taking the base 2 logarithm of both sides yields $\log_... |
The description of this game is already exists in this link
I am quoting from this link the description of the game to ease the reading of this question:
In a game, where there are m active bombs, each one with a number above zero, and n standing levers, where each can be either pushed forward or pulled backward, and ... |
LTL works with Boolean propositions.
People probably studied extensions to non-Boolean propositions...
Do you know a good starting reference?
(I am aware of STL, but it also seems to talk about clocks, is there a variant without clocks?)
Update: the question is not about "true, false, maybe" but rather about LTL where ... |
I am curious about an image processing algorithm used in this code pulled from this github repo. I have posted an explanation of the code below.
import numpy as np
import cv2
import sys
def calc_sloop_change(histo, mode, tolerance):
sloop = 0
for i in range(0, len(histo)):
if histo[i] > max(1, toleran... |
so hey, I've been recently reading about the Two-Pointer algorithm that allows us to find pairs $(i,j)$ such that $a[i] + a[j] = x$ in $O(m+n)$ instead of the trivial $O(mn)$ time.
I was wondering how can I find the number of pairs $(i,j)$ in time less than $O(mn)$. I was trying to use Two-Pointer but it seems that it... |
Let $L$ to be the following problem:
$$L = \{ \langle M,x,1^t \rangle \mid \text{$M$ accepts $x$ after $t$ steps with probability at least $3/4$} \}.$$
Show that if $L\in BPP$ then $NP\subseteq BPP$.
I already showed that $L$ is $BPP$-hard. I think a reduction from $3SAT$ to $L$ need to be shown (logarithmic/poly... |
An algorithm has a calculation whose worst case time complexity $T(x)=O(x^2)$ that outputs solutions $y$ & $z$ for input $x$ (the algorithm's worst case time complexity is greater than quadratic time):
for (i = 1; i <= x; i++)
{
for (j = 1; j <= i; j++)
{
// Some quadratic time calculation of... |
Recently, I encountered terminologies such as primitive recursion and recursion combinator. One of the sources is here link
I googled and read some, but missing the points of them. I know that recursion occurs when a function appears within its definition. While $\lambda$-calculus cannot express such recursive definit... |
I'm working on a problem that is very similar to the bin packing problem, but for me, the objective is to minimize the maximum weight given m bins. The problem statement is:
Given n items, each with a certain weight less than some maximum weight (w_max), how do you pack them into m bins so that you minimize the maximum... |
After reviewing the Bellman-Ford algorithm I can see that it runs with time complexity of $O(n^2)$ or, more exactly, $O(VE)$. It is necessary to loop (V-1) times the number of edges which is in fact 2 nested loops. This is true even if it includes the detection of negative cycles because this task only needs a last loo... |
Consider the well-known language: $$L = \{\langle M,x,1^t \rangle \ \ |\ \text{$M$ accepts $x$ after $t$ steps}\}$$
I've encountered some technical problem while trying to show a logarithmic reduction from some $L'\in P$ (which will show completeness of $L$)
Basically, the reduction is: $$f(x) = \langle M_{L'},x,n^c\ra... |
Let $X = \{x_1, ... , x_k\}$ and $Y = \{y_1, ... , y_h\}$.
A subset $S \subset X \times Y$ is a correspondence if :
$\forall x, \exists y, (x,y) \in S$ and
$\forall y, \exists x, (x,y) \in S$
That is to say, $S$ fully projects onto $X$ and $Y$.
Now for the problem. Given an $n \times m$ matrix of subsets $(S_{i,j})$... |
Two computing models can be shown to be co complete if each can encode a universal simulator for the other. Two logics can be shown to be co complete if an encoding of the rules of inferences (and maybe axioms if present) of each be shown to be theorems of the other. In computability this has led to a natural idea of... |
I stumbled upon these two defintions of a turing machine:
http://www.cs.um.edu.mt/gordon.pace/Teaching/Complexity/CoursePage/Notes/chapter5.pdf
http://scholar.harvard.edu/files/harrylewis/files/s6_sols.pdf
The difference which bothers me is that the second one allows only left and right movements whereas the first allo... |
I transformed the MNIST dataset as follows:(X (70000 x 784) is the training matrix)
np.random.seed(42)
def transform_X():
for i in range(len(X[:,1])):
np.random.shuffle(X[i,:])
I had thought that shuffling the pixels in an image would make the digits unrecognizable by humans,but the machine learning algori... |
I stumbled upon the following post while learning about turing machines:
Right moving turing machine
I kind of understand the intuition behind why a TM that only moves to the right works like a FSA but I can't think of a general way to create a let's say DFA (or NFA, doesn't really matter) which accepts the same langua... |
I would like to estimate complexity in space and time of generating every combination of every size for a given sequence.
Exemple :
seq = [1,2,3]
combinations = [{1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}]
From what i know, for a given sequence of size n and a fixed combination size k, the number of combination gen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.