instruction stringlengths 35 29.1k |
|---|
I'm trying to write a algorithm to solve the following problem, which I did not find any related papers:
Given a set of discrete data points generated by n unknown smooth functions $f_1(x), f_2(x), \cdots, f_n(x)$ at $x_{1}, x_{2}, \cdots ,x_{m}$, how to group these data points into $n$ arrays $a^{(n)}_{i}$ so that the... |
I have a logical question that I can't quite crack:
Given two automata accepting the same language $L$, does one have to refine the other?
In other words, if $A_1$ and $A_2$ both accept $L$, with associated equivalence relations $R_{A_1}$ and $R_{A_2}$, does $R_{A_1}$ have to refine $R_{A_2}$, or vice versa?
I am lea... |
What exaclty is resolution in prolog and how does it enables Prolog to obtain the following answer:
?- sublist([b,c],[a,b,c]).
true
|
Consider a 1-tape TM that starts with n ≥ 1 written in unary/binary
notation on its tape. Explain how it can count down from n to 0 in O(n) steps.
For binary notation, if we have a binary counter representing the number n, then will there be a total of O(log n) different bits (since each bit represents exponentially ... |
I think it would be challenging since the three body problem is about continuous movement and Turing machines execute in discrete steps.
|
The union of a recursively enumerable set and its complement is $\Sigma^*$, which is definitely recursively enumerable. What if instead we consider the following operation, on an RE set $S$?
$$
\{ \# w : w \in S \} \cup \{ \\\$ w : w \in \overline{S} \}
$$
Is the result recursively enumerable?
|
If $E$ is an enumerator and $n$ is a natural number, we define $\langle E,n \rangle$ to be all strings of length $n$ enumerated by $E$. Is $\langle E,n \rangle$ recognizable? Is it decidable?
|
Let $H_0$ be $\log_2(|A|)$, where $A$ is a set.
Let $C$ be a compressor $C\colon A \to \{1,0\}^l \cup \bot$.
This is a silly question, because intuitively it seems obvious.
How can I prove that $l$ can't be less than $H_0$?
I can prove that $l = H_0$ is sufficient, but how can I prove that it can't be less.
|
I am trying to find some generic upper bounds on the "standard" graph partitioning problem. Say I have a graph with $|V|$ vertices and $|E|$ edges I want to partition it into two equal $N/2$ (or approximately equal if easier) parts while minimizing the cut i.e. $\min(|C|)$ where $C$ is the set of edges with nodes on... |
I was trying to solve this problem.
Let $A[1] . . . , A[n]$ an ordered sequence of integers (with possible repetitions) and let $k$ be any integer. A contiguous subsequence $A[i], A[i + 1], . . . A[j]$ of $A$ is $k$-separated if the difference between every pair of its consecutive elements is at most $k$.
For example, ... |
Consider a connected undirected graph $G = \langle V, E\rangle$, we say that a subset $C$ of vertices is a Path-Cover if the following holds. For every finite path $p$, it holds that $p$ traverses all the vertices in $C$ iff $p$ traverses all the vertices in $V$. I am interested in finding a Path-Cover of minimal size ... |
Prove that there are infinitely many primes that divide none of the elements of the integer sequence
$a_{n+1} =1+a_0 a_1 \cdots a_n$, with a starting point of $a_0 \geq 0$.
I thought about $$\log (x_n-1)=\log x_0x_1\cdots x_{n-1}= \log x_0 + \log x_1 +\cdots+\log x_{n-1} $$ to solve the problem but couldn't.
|
I'm a Psychology student with a decent (yet not extensive) knowledge of mathematics and computer science. My knowledge on this two fields are those of a person beginning the third year of computer science (since I studied computer science for two years).
My field of academic interest is evolutionary psychology and beha... |
Suppose $n$ students have preferences over $n$ different notebooks. Their preferences can be represented with a square matrix of size $n$ where each column is a different permutation of the vector $[1:n]$, where the first entry in the column represents the most desirable notebook for student 1, and so on. We are intere... |
Let $n > 0$ be an integer. Show that the rounded square root function
$f(n) = ⌊\sqrt n⌋$ belongs to FP.
Suppose $n=x+y$, where $x$ is the largest perfect square which is at most $n$, and $y$ is the remaining integer. For a given $x$, checking whether $x$ is a perfect square is in time $O(\log n)$ (using binary search... |
So I have been asked to specifically construct a divide and conquer algorithm for the question:
"You are a visitor at a political convention with n delegates; each delegate is a member of exactly one political party. It is impossible to tell which political party any delegate belongs to; in particular,... |
Show that any $S \in NP$ has 2 different polynomial-time verifiers $V_1, V_2$ such that, for all $x,y$, the following conditions hold:
If $V_1(x,y)=1$ then $V_2(x,y)=0$
If $V_2(x,y)=1$ then $V_1(x,y)=0$
I show a guideline that say to define $V_i(x,y)=1$ if $y=p(|x|)+i$ and there exists a prefix $y'$ of $y$ such that ... |
Suppose n people live in a house and wish to share their expenses
equally. Their respective expenses (before settling) are x1, ..., xn.
They agree to write checks to each other so as to make all their net
expenses equal. Naturally, they want to use as few checks as possible.
SETTLEMENT denotes the decision version of ... |
I was watching a coursera video on Approximation algorithms and I understood the 2-approximation algorithm.
Later, the professor asks if we can do any better. The lecturer went on to say that computing 1.3606 approximation is NP-hard in the following words at 8:14.
Here's the transcript for that part.
Actually, what ... |
I am reading Chapter 9 Approximation Algorithms of Dasgupts et al.'s Algorithm book for vertex cover approximation and they bring up the concept of matchings.
To support this, I am also watching Coursera's Approximation algorithms course by EIT digital.
This video mentions using disjoint edges and would like to confirm... |
A: Given nonnegative integers x1,...,xn (written in binary), and an
integer k, can the net expenses be balanced using k or fewer checks? (Suppose that A is in NP).
Purpose: to reveal that SUBSET SUM reduces to A so that A is
NP-complete (since SUBSET SUM is NP-complete).
Let me construct A as follows:
We can find th... |
Let's say we have n postmen that are bringing people mail in a neighbourhood, and that they start and end at the same post office. This situation can be decribed with a directed graph, where the vertices represent the people's houses the mails are brought to. If the graph has an edge from a to b, it means it is an acce... |
We have an $n \times m$ matrix whose entries are non-negative integers and we want to find a sub-matrix whose area (number of entries) is at least $k$ such that the sum of the entries in minimal. The answer to this problem is the sum of these entries.
My solution:
Using dynamic programming, I have defined the sum of en... |
What is the time complexity of the following procedure?
for $x \in \{1,\ldots,n\}$:
$\quad$ $i \gets \lfloor n/2 \rfloor$
$\quad$ while $i \neq x$:
$\quad\quad$ if $i > x$ then $i \gets i -1$, otherwise $i \gets i + 1$.
According to me, the time complexity is $O(n^2)$.
The inner while loop starts at $n/2$ and moves ... |
In the most even possible split, PARTITION function produces two subarrays, each of size no more than n/2. since one is of size floor(n/2) and one of size ceil(n/2)-1.
The recurrence for the running time will be,
$$
T(n) = 2T(n/2) + \Theta(n)
$$
where we tolerate the sloppiness from ignoring the floor and ceiling and ... |
In the context of lambda calculus, how should one prove $\beta$-equality of terms that do not have normal form?
In particular, how to prove that these are different combinators:
$$
Y = λf.(λx.f(xx))(λx.f(xx)) \\
Θ = (λxf.f(xxf))(λxf.f(xxf))
$$
These work the same if we reduce them, but Wikipedia states that they are di... |
Is O(loglog n) equal to O(n^2) in polynomial time?
I know O(log n) is eqaul to O(n) in polynomial time because this can change as follows:
log n > 2^(log n) > n^(log 2) > n.
So, my question is to determine whether O(loglog n) = O(n^2) or not.
Thank you for your time.
|
Wikipedia says that
There are several practical methods of computing minimal unsatisfiable cores.
but I cannot find any. I suppose that “practical methods” means polynomial algorithms. Be careful, a polynomial algorithm, that finds a minimal unsatisfiable core of a given CNF $F$, doesn’t mean that $P=NP$, because the... |
i tried both algorithm to find the shortest path with minimal cost between two vertices,but most of the time Dijkstra gives a different path and the cost is smaller than the cost for the path UCS gives, is this right or there is something wrong with my code?
edit: here's the code for both algorithms implemented in jav... |
Excuse me if this is obvious.
At 1:55 of this Coursera video on streaming algorithms (see pasted image below for relevant slide), the professor mentions sublinear storage. I get the $N^{\alpha}$ but I don't get the $log^{O(1)} N$. I take it that $O(1)$ is a constant which we could set it as $k$ for example.
Does he me... |
I was reading this page on approximation ratios and the author says that for a problem looking for a:
maximum, an approximation algorithm will give us a value lower than this optimal maximum
minimum, an approximation algorithm will give us a value higher than this optimal minimum
Is it possible to get the opposite?
... |
bios is a program that checks all devices and starts the bootloader.
but how does the CPU sync with the motherboard if the CPU clock settings are stored in the BIOS?
Does the BIOS have CPU clock frequency settings?
how does the BIOS adjust the clock speed of the processor if it's just a program?
does the BIOS synchron... |
Let's say we have a string s , a code size limit of b bytes and a time limit t, the question is then whether or not it is possible to construct an algorithm that prints the string within the time limit when a program is given no input.
In other words - is this problem decidable or undecidable?
I was thinking of reducin... |
Give the diagram of transitions of a Turing machine to a ribbon which
accepts the language on the alphabet $\{0, 1\}$ of the words which contain
as many $0$ as of $1$. (Note well that the $0$ and the $1$ can appear in any
order.)
This problem is similar to $\{0^n 1^n : n \in \mathbb{N}\}$ except the fact that we mix ... |
This is from the Algorithms textbook by Dasgupta,C. H.Papadimitriou,andU. V. Vazirani question 8.6 (b) that asks:
Edit:
And missing from the pic as @Nathaniel points out in his answer below:
"3SAT remains NP-complete even when restricted to formulas in which
each litteral appears at most twice".
My reduction from Cl... |
I've been learning regular expressions as part of a class on automata and formal languages. I am still fine tuning and trying to figure out the algebra and the identities.
I am struggling with the regular expression
$$ (b^*a)^+.(b^*a) $$
It's supposed to come out as $$(b^*a)^*$$
I believe I have to use some identity be... |
I know little about computer science. I wrote a function that has some ifs and may call itself recursively.
Is there a branch of computer science that studies these possible branches?
I'd like to analyze the possible branches and maybe generate a graph of all of them to study all possible outcomes of my function.
my_fu... |
Given $\Sigma =\{0,1,@\}$, I am looking at a language $L=\{u@v | u,v\in \{0,1\}^k\wedge u\neq v\}$. So $u,v$ have only $0,1$s, same length $k$, yet are different.
Also, for me $k$ is a known constant. So the language ìs regular (at most $(2^k)\cdot (2^k-1)$ words).
I want to build the most efficient NFA for $L$. So far... |
Given an array of elements which can contain duplicates, this is an algorithm that solves the problem.
def subsetsWithDup(self, nums: List[int]) -> List[List[int]]:
nums.sort()
res = [[]]
self.dfs(nums, res, [], 0)
return res
def dfs(self, nums, res, path, index):
if path not in res:
... |
I have been working on the following problem:
Let $\newcommand{\bin}{\operatorname{bin}}\bin\colon \{0,1\}^* \to \mathbb{N}$ convert a binary representation of a non-negative integer to that integer, with the last symbol of the input being the LSB. For example, $\bin(110) = \bin(00110) = 6$ and $\bin() = 0$.
Design a ... |
I want to write the algorithm that takes the adgacency matrix of a directed connected graph without any cycles, then for each edge computes the number of paths starting from that edge. Also note that there is at most one edge between two nodes.
For example consider the graph depicted below:
For instance, we want to co... |
Suppose there are $n$ points $p_1,p_2,\dots,p_n$ with color red or blue on a line. We want to find all pairs $(p_i,p_j)$ whose color is distinct and such that there are no points between them. If there are $k$ pairs with the described property, design an algorithm with $O(n\log k)$ that uses idea of divide and pruning... |
As we all know, when a given thread/process reaches a memory address it does not have cached, the execution will (for the most part) freeze up until said data is fetched from memory. What I don't understand, is why in multithreaded systems, we can't save ourselves the headache of data-oriented design. Why can't the pro... |
I have seen that a Turing machine without return is a Turing machine $M$ which at each stage of its calculation systematically moves its read / write head to the right.The aim of the exercise is to understand the computing power of Turing machines without return. If a language $L$ is recognise by a Turing machine witho... |
I'm trying to wrap my head around a prune-and-search algorithm for returning a bottleneck spanning tree, currently I'm selecting the median weight of all the edges, then divide the original graph G into two graphs containing the edges which are less than or equal to the median or greater than.
After separating the grap... |
I am a computer science student in his final year on the university with several years of experience in software engineering. I want to take me to the next level in programming web applications.
I am looking for a good book or online course on the subject of distributed programming with in-depth understanding, and how ... |
Binary numbers like '0110', or '00100101' are seen very often in all contexts. What are the leading (left hand side) zeroes for? Why did the writer not write '110' and '100101', respectively?
|
Are the sets in each stage of the arithmetic hierarchy well-ordered, with respect to : $T-$reductions, or $m-$reductions?
It is something which I have been unclear with for a while (from a Computability Theory POV).
|
I have a little bit changed algorithm for 1-0 Knapsack problem.
It calculates max count (which we can put to the knapsack) as well.
I'm using it to find max subset sum which <= target sum. For example:
weights: 1, 3, 4, 5, target sum: 10
result: 1, 4, 5 (because 1 + 4 + 5 = 10)
weights: 2, 3, 4, 9 target sum: 10
resul... |
I proved the inapproximability of a problem that, given a multigraph $G = (V, E)$ and a set of vertices $U \subseteq V$ tries to maximize a score $f(U)$ whose value depends on the edges of the graph, so it takes values in $\{0, \dots, m\}$, $m$ being the number of edges in the graph.
As the result was obtained by (exac... |
Operating System - CPU scheduling Decisions
The question above talks about why CPU scheduling does not take place when ready to running.
But I wonder why CPU scheduling does not take place when new to ready. I think it is similar to the process of waiting to ready. They both add processes to ready without changing pro... |
A Bloom filter is an array $B[1..m]$ of bits, together with a collection of $k$ independent ideal random hash functions $h_1,h_2,...,h_k$. To insert an item $x$ into a Bloom filter, we set $B[h_i(x)] ← 1$ for every index $i$. To test whether an item $x$ belongs to a set represented by a Bloom filter, we check whether $... |
I am trying to understand the discrete Fast Fourier Transform. I get the idea of switching between coefficient and value representations to and then back but I am stuck in figuring out how the multiplication of 2 polynomials using their value representation works.
The screenshot below is from a Reducible video (at tim... |
I was going through the automata text by Peter Linz. There I came across the proof the theorem below. I could not quite get the portion of the proof in bolds.
Every context-sensitive language L is recursive.
Proof: Consider the context-sensitive language $L$ with an associated context- sensitive grammar $G$, and look... |
In the Milner Award lecture "The Type Soundness Theorem That You Really Want to Prove (and now you can)" and related Sigplan blog post (with collaborators), Derek Dreyer argues that semantic soundness is an important thing worth proving.
In the questions section, Adam Chlipala asked how to trade off complexity between ... |
We are given an undirected graph $ G $ and a positive parameter
$ k \geq 0 $. The problem is to decide if there exists a set $ S \subseteq V(G) $ of size at most $ k $ such that $ G − S $ does not have any path on three vertices.
Is there any deterministic kernel algorithm for this problem with $ \Theta (k^2) $ vertice... |
Well in many texts and places I have seen a called statement, which claims it self to the famous "Church Turing Thesis".
I have seen many texts say that based on Church-Turing Thesis :
"Anything that can be done by a digital computer can also be done by Turing Machine".
Peter Linz text roughly says that the thesis is... |
$1.\: A_{DFA} = \{\langle B, w \rangle \mid B \text{ is a } DFA \text{ that accepts input string } w \}$
$2.\:A_{DFA} = \{\langle B \rangle \mid B \text{ is a } DFA \text{ that accepts input string } w \}$
I know how to proof that 1 is decidable by constructing a machine that always halts and accepts whenever $B$ accep... |
I have the following code in python and was asked to find the tightest upper-bound in terms of Big-O , I've done two attempts below and I don't know which one is right, can you help me verify as to which one is the right answer/approach?
def f1(L):
n = len(L)
while n > 0:
n = n // 2
for i in ran... |
Why does {w | w has equal number of 01 and 10 substrings} not require an infinite amount of memory
to “count” the number of 01 and 10 substrings?
|
Let $G$ be an undirected graph with $n$ nodes. Prove that any two of the following implies the third:
$G$ is connected
$G$ is acyclic
$G$ has $n-1$ edges
Proving $1, 2 \implies 3$
A connected, acyclic graph is a tree. Each node(vertex), except the root, in the tree has exactly one edge going upwards(towards the root)... |
In the context of studying the conversion from an NFA to the equivalent DFA, I came across the following NFA, which accepts all strings over the alphabet $\{0,1\}$ which contain $01$:
After I converted the NFA to the equivalent DFA, it became:
The issue is that the NFA accepts the string $101$ but the DFA doesn't.
Is... |
An array is $d$-sorted if every key in the array is located at a distance at most $d$ from its location in the sorted array.
I need to write an algorithm that get a $d$-sorted array of length $n$ and sort it in the following running times:
$\Theta(n)$ if $d$ is constant
$\Theta(n\log\log n)$ if $d = \Theta(\log n)$.
... |
Given a connected sourced/sinked directed acylic graph $G = (V, E \subseteq V^2, s \in V, t \in V)$, we want to enumerate the edges $e \in \mathsf{Bottleneck}(G) \subseteq E$ for which every $s$,$t$-path contains $e$. I don't actually know the real name for this notion; so I'm calling it the "bottleneck set", but when ... |
I'm trying to create an unambiguous grammar for a calculator that uses $+$, $-$, $*$, $/$ and $()$.
From watching videos and reading articles online, I understand how to create the grammar with $+$, $*$, $()$ (or 3 different precedences).
i.e. $E \to E + E \mid E * E \mid (E) \;\mid \;\text{num}$
$$\begin{align}
E &\to... |
This is a very elegant implementation of prefix-span algorithm by the maintainer of the prefixspan pip package. However, I am having a hard time understanding the reason behind the implementation. The result by localOccurs doesn't really make any sense to me. Can I get a overview of what each part of this implementatio... |
In the book "Advanced computer architecture and parallel processing" (El-Rewini & Abd-El-Barr), there is a question in the exercises of chapter 1 that needs the reader to compare between multiprocessor systems and uniprocessor systems in terms of many factors including run-time system:
Compare uniprocessor systems wit... |
I am reading Goldreich, Vadhan, Wigderson: Simplified Derandomization of BPP Using a Hitting Set Generator and trying to understand the result that polytime hitting set generators (HSGs) would not only imply $\mathsf{RP = P}$ but $\mathsf{BPP = P}$ as well, but I can't even conceptualize why the former holds.
The paper... |
I'm trying to prove that the following language is not regular:
$$\{ w^n\mid w \in \{0,1\}^∗, \, n \ge 2 \}$$
I'm trying to prove this with the pumping lemma, but I'm kind of confused because $w$ is a language, not an expression like $a^n b^n$, and I don't know how can I partition that into three parts.
|
We have a language $$ L = \{a^n b^m \mid 2n + 3m \le 1000 \} $$
Is this language regular?
I'm trying to disprove this using the Pumping Lemma, but it didn't work.
assume I say x = $x=a^{h}$ and $y=a^{t}$ and $z =a^{n-t-h}b^m$
if I say i = 0 everything is okay because $L =a^{n-t}b^m$ and 2(n-t) + 3m <= 1000
if I say i ... |
We have a language $$ L = \{a^n b^m \mid 1000|nm \} $$
Is this language regular?
I'm trying to disprove this using the Pumping Lemma, but it didn't work.
assume I say $x=a^{h}$ and $y=a^{t}$ and $z =a^{n-t-h}b^m$ and 1000|nm
if I say i = 0 , $L =a^{n-t}b^m$ and 1000|(n-h)*m and I can't prove (n-h)*m isn't dividable b... |
Is it possible to find an upper and lower tangent line to a convex hull in $log(n)$ time where $n$ is number of points on a convex hull? I have just done it in linear time where I checked for upper tangent line if orientation of $S,i,i+1$ is greater than zero (anti-clockwise) and if orientation of $S,i,i-1$ is greater ... |
For any alphabet and any natural number k, a language of strings at least k is decidable.
So my question is having some alphabet (let's say (0,1)) and some number let's say k=5 then my language has every string of 1's and 0's that are 5 or more characters at length (ie 01101, 011011 belong to language, while 011,10,110... |
Let the language $K = \{\langle W \rangle: W \text{ is a DFA on } \{a, b, c\} \text{ and } L(W) \text{ contains some string in } \{b, c\}^*\}$.
Is $K$ decidable?
Is it sufficient to define $M$ as follow :
Input $w$;
Simulate the computation of $W$ on $w$
If the accepting state is final after reading at least one $b$ o... |
Prove that 9 is the minimum number of calls to make-set, union-set, find-set such that a disjoint set union using weight (number of nodes) by path compression and disjoint set union using rank (upper bound on height) such that the trees produced by this sequence of calls is different.
So far I've found a tree example f... |
Setting aside the fact that tax lots (using specific id) should usually be assigned at the time of the trade (for stocks in the USA), let's assume instead we want an algorithm to optimally allocate them once we have the whole list of trades in hand for a single security. Each trade comprises: date-time, number-of-share... |
I’m trying to analyze a repeated data stream from a sensor. The data probably has events at the 100us scale, it occurs at a fairly random interval, and the signals are extremely similar. The problem is that I don’t have any sensors that have sub-millisecond refresh rates. The best I can do with what I have is about ... |
This is probably a very stupid question but I couldn't find an answer anywhere. I'm reading the Technical Reference book of the IBM PC XT and it says that "The system board also has from 128K by 9 to 256K by 9 of R/W memory." What does this by 9 means?
|
I'm trying to create a program where I have a user walking around a random space that contains obstacles, but I can't see where the obstacles are. The point is that as a user walks around, based on where they are traveling, the program creates a rough map of places where there aren't any obstacles (if the user is able ... |
I am studying algorithms and there is a question in CLRS called the Half-SAT problem
We are given a 3-CNF formula with n variables and m clauses where m is even. We wish to determine whether there exists a truth assignment to the variables of f such that exactly half the clauses evaluate to zero and the other half to ... |
can a computer be totally made up of SRAM with no DRAM but with secondary memory and run an opreating system properly?
|
I am learning computer architecture and organization. I am stuck in the following question. Can someone please help me?
The stage delays in a 5-stage pipeline are 300, 200, 100, 400 and 350 picoseconds. The second and third stages are merged into a single stage with delay 350 picoseconds. The throughput increase/decre... |
Is there an algorithm that could check whether it is possible to win in the current situation in solitaire? That is, can we remove all cards from the table in a certain number of moves?
Description of the game:
Two decks of cards (36 pieces each) are connected and shuffled, and then they are laid out in 8 piles of 9 ca... |
I have the following problem:
Write a function
whose input is an adjacency matrix A of a graph G. The function returns true
if G is a regular graph and false otherwise.
I understand that a graph is regular if the degrees of all the vertices are the same.
Therefore, I have written the following code which calculates t... |
I need to prove the existence of the $(1944, 144, 0.5)$ spectral expander. I tried to construct it using tensor product of the following graphs:
$$
(1944, 144, 0.5) = (9^2, 9, 1/3) \otimes (24, 16, 0.5)
$$
I already know that expander with parameters $(9^2, 9, 1/3)$ exists and corresponds to the affine expander, but I ... |
I am not asking about the Huffman Code, but the most widely described algorithm for generating one, also described on the english wikipedia: https://en.wikipedia.org/wiki/Huffman_coding#Compression
Now, I am not really concerned with the code being optimal or not, because many proofs for this can be found, but there is... |
As part of a project i'm doing I have been looking for a way to find common values between 2 arrays including duplicates.
For example;
A = [2, 2, 3, 5]
B = [2, 2, 5]
would return the array;
Common values = [2, 2, 5]
I have attempted using sets, and the intersection function, but neither gave duplicates
Any help appreci... |
Generally, we can implement algorithms in-place and out-of-place.
However, I can't say for certain that radix sort can be implemented in both ways.
|
Most programming languages have some kind of type systems but are there any programming languages widely used outside of academia (in consumer-oriented tech, finance etc.) that have intensional identity types à la Martin-Löf?
Coq and Agda have identity types but they are primarily used in academia.
|
Any physical computational device clearly has finite memory. On the other hand the input can be external and could therefore potentially be infinite. This idea is perfectly captured by the deterministic finite automata (DFA), so why do we use the Turing machines instead?
Let's consider a popular example. The language
$... |
Is there any formal method to prove that one problem belongs to Complexity Class $\mathbb{P}$?
For example, how can we prove that the problem of finding $n^k$ belongs to Class $\mathbb{P}$? We can use the fact that each multiplication can be done in unit time.
If you present an algorithm that can solve this problem wit... |
I solved the question T(n) = T(sqrt(n)) + 1 but can't quit understand one step of the solution
I don't understand the transition in (1).
how did we conclude that T(m) = T(m/2) + 1 from the previous step that m is in the power?
|
Can somebody please explain this in simple terms. I don't understand Sipser's way of explaining it.
He says this is a corollary to PATH is NL-complete which I do not understand either.
Can somebody please explain everything in a simple manner to me?
Theorem 8.25 shows that any language in NL is log space reducible
to ... |
I'm trying to understand the various optimizations given in the original 1992 paper on Karger's algorithm. Specifically, looking at section "3.1 Unweighted Graphs", I don't understand what data structure is used to represent the variant of the algorithm that works in $O(|E|)$ time and space (the other variant, which us... |
What have you tried?
So I watched this video.
According to the video, we've to calculate the variance $\sigma^2$ as follows:
$$
\sigma_{k}^{2} =
\frac
{
p_{1} \left(x_{1} - \mu_{k_1}\right)^{2} + \ldots + p_{n} \left(x_{n}
- \mu_{k_n}\right)^{2}
}
{
... |
I have the following language:
$L = \{a^{n^2}|n\geq 1\}$
Hey i have been stuck on this problem for a few days now and even going through sample problems in my textbook as well as sample solutions i cant figure out how to make this turing machine to work.
I know it may be a vague question but i really could use some hel... |
Recently been practicing some recent exams, there was a problem I could not comprehend the given answer, the question is as follows:
Suppose array $A[1..n]$ consist of $n$ distinct integers that is
sorted in ascending order, then How many of below problems could be
solved in $O(\log n)$?
and there were three statemen... |
1)"Given a CFL L and a regular language R, is the intersection of L and R an empty set?" decidable?
2)What if we replace L with the complement of L?
Either 1 or 2 is decidable and the other is not.
For the one that is decidable, give an algorithm. For the other, give an undecidability proof.
Intuitively, i think that 1... |
Algorithms like LZW and others compress data sequences.
What I'm looking is an algorithm that compress multiple Sets. if possible online algorithm.
For example :
1,2,3,4,5
2,8,7,5,4
3,1,8,9,7
2,4,5,8,7
becomes :
Rule1 : 2,4,5
Rule2: 8,7
Rule3 : 3,1
Rule4 : R1,R2
R1,R3
R1,R2
R2,R3,9
R4
.. Rules are hiera... |
The Wikipedia page on the Toffoli gate mentions that CNOT is the only non-trivial reversible gate on two input bits. The CNOT gate computes the following function:
$$
00 \to 00 \\ 01 \to 01 \\ 10 \to 11 \\ 11 \to 10
$$
I think I found a different non-trivial gate on two input bits:
$$
00 \to 01 \\
01 \to 00 \\
10 \to 1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.