instruction stringlengths 35 11.4k |
|---|
Assuming (hypothetically) someone proves $P=NP$ by providing a polynomial time algorithm for a $NP-Complete$ problem the Polynomial Hierarchy collapses.
What are the other (important) questions that are still left in complexity theory in respect to the remaining complexity classes?
If possible can someone help with a l... |
I'm interested in the following variant of Travelling Salesman Problem sometimes called Partial TSP. I'm particulary interested in the euclidian version :
Input : A set $\{x_1,\dots,x_n\}\subset \mathbb{R}^2$ of $n$ points in the plane, and an integer $k\le n$.
Output : A tour of $k$ points $x_{i_1},\dots, x_{i_k}$
Min... |
$k$-Weight Independent Set
Input: A vertex weighted graph $G=(V,E,w)$ and an integer $k$.
Question: Is the a set $V'\subset V$ such that $V'$ is an independent set and $\sum_{v\in V'} w(v) \geq k$?
Showing that this problem is in NP is trivial, but I'm suck on showing that $X \Longleftrightarrow Y$. The forward d... |
Do you know where Can I find an algorithm to sort a set of binary strings in colex order?
Recall, that two k−element subsets A and B
of a set with strict linear ordering $<$ are said to be in co-lexicographical order (colex order) if, for the sequences, a and b of their elements sorted in ascending order, there exists ... |
I'm currently working on an algorithm that requires me to come up with unique matrices. Two matrices are considered equivalent if one's rows and columns can be swapped to make it match the other. For example, $\begin{bmatrix} 0 & 0 \\ 1 & 1 \end{bmatrix} \equiv \begin{bmatrix} 1 & 1 \\ 0 & 0 \end{bmatrix} \not\equiv \b... |
I have decent enough experience with programming to be able to tackle most things but I want to know how you recommend making the jump from just programming to computer science. I still have a couple years till college, I'm only a sophomore right now although I am taking Calc over this summer which should help with som... |
A tree is provided which has $n$ nodes and each edge of that tree has a certain length. There are $M$ persons on the tree, numbered 1 through $M$. For each valid $i$, person number $i$ starts at time $t_i$ from vertex number $u_i$ and runs straight to vertex number $v_i$ with constant velocity $s_i$. Before time $t_i$... |
I have a question about follow sets.
Suppose there's a rule,
A -> XBCD
B -> $\beta$ | $\epsilon$
C -> $\gamma$ | $\epsilon$
D -> $\delta$
What is Follow(X)?
Is it (First(B) - $\epsilon$) $\cup$ (First(C) - $\epsilon$) $\cup$ First(D) = {$\beta$ , $\gamma$, $\delta$ } ?
|
Let $A = (a_1, a_2, \dots, a_n)$ denote an array of distinct values with an order defined. Consider the following randomized sorting algorithm.
Let $m := 0$.
Select a pair $(i, j)$ with $1 \le i < j \le n$ uniformly at random.
If $a_i > a_j$, swap $a_i$ and $a_j$.
If $m < m_{max}$, let $m := m + 1$ and go to step 2.
... |
I was going through graph theory and came across the term Euler path or some people prefer Euler trail as vertices can repeat.
According to the definition from wiki (https://en.wikipedia.org/wiki/Eulerian_path), Euler path is defined as under
In graph theory, a Eulerian trail (or Eulerian path) is a trail in a graph w... |
Let $L$ be a regular language, and $Pre(L)$ be the set of all words that are prefix of some word in $L$. Prove that $Pre(L)$ is regular.
My proof:
Let $M = (\Sigma, Q, \delta, q_0, F)$ be an automata such that $\mathcal{L}(M) = L$ and $Q' = \{ q \in Q \ | \ (\exists q_f, w \ | \ q_f \in F \ \wedge \ w \in \Sigma^{*}: ... |
Can a neural network be used to find the genus of a 2-manifold given for instance as a CW complex?
|
I'm looking to design an algorithm for a problem I have, and was hoping there may be someone that could provide some insight on where to start.
In my picture above, the grid is the area they needs to be explored by the circles. Each cell is a unit of work, so currently I've got lat/lng coordinates for the exact center... |
I'm confused as to why we can't write formulas of infinite length in FO. For example, to express reachability, I understand the proof that there cannot be a single formula for it, but it is expressible with a set of formulas?
Since any formula has an equivalent formula in CNF, if we transform a formula of infinite leng... |
I'm a cs student and i've just started learning about binary arithmetic.I have to do this homework assignement to get prepared for exams..I'm having some trouble figuring out how to convert a negative floating point number in binary system....I was thiking about IEEE-754 representation but i must use only two's complem... |
Basically, I'm interested in doing 2 things. Let's say we have a mesh M.
1. Find the minimum number of points(inside M) required to see the whole M.
2. Decompose M into polyhedrons which can be seen by only one point inside of them.
There are many articles on 2, for example I've found algorithms on convex decompositi... |
I was looking at a tutorial for recurrent neural networks in Python, and I have a question in regards to multiplying matrices of different sizes. Specifically, why does S[t] have 100 elements in it?
s[t] = np.tanh(self.U[:,x[t]] + self.W.dot(s[t-1]))
Earlier in the tutorial, the author lists the dimensions for each v... |
Are pushdown automata without $\varepsilon$-transitions as powerful as those with them? Intuitively, if we need to make such a transition, we could just add the letters on the next transition we take, but I'm not convinced by that reasoning.
|
Let's say a person took an image like this
I have access to all image attributes (like for example image format, resolution and so on), and I know the location of the person - basically the place where he made the photo. Also I know all the data about the camera - model, resolution and others.
Is there an algorithm th... |
I have taken one basic class in complexity and understand the fundamentals. E.g. P, NP, NP-hardness. But I can't understand how to interpret $BPP^{NP}$. I believe it means "BPP with an NP oracle" but how should I interpret that?
Does this mean that members of this class are problems for which there exist randomized al... |
I know many algorithms that can be analyzed using master theorem, but the only algorithm I know where the time is dominated by the leaves is fast matrix multiplication.
Are there other recursive algorithms (not necessarily master-theorem-style -- can be akra bazzi/something similar) where the time is dominated by the l... |
The paper for BIRCH (a clustering algorithm) contains definitions of a Clustering Feature (CF) where the notation is unclear (cf. PDF page 3 / section 4).
A cluster contains N d-dimensional entries $ \{ \vec{X}_1, \vec{X}_2, \dots, \vec{X}_N \} $ and its CF is composed of three values.
N the number of elements (straig... |
Let $L$ be the set of strings of length $n$ (say $n=400$, for example). Let $N = \{0,1,\dots,|L|-1\}$. I am looking for a function $f : N \to L$ with the following properties:
$f$ is efficiently computable
$f$ is a bijection
$f$ is pseudorandom (not necessarily cryptographically)
Given some interval $[a,b]$ and a regu... |
In the following MIT open course, it is claimed that min-cost circulation reduces to min-cost max-flow:
...
The second part of the proof is showing that min-cost circulation
reduces to min-cost max-flow.
Consider a network G for which we want to find a min-cost circulation.
Add a source s and a sink t to the netwo... |
I've been recently dealing with a problem which, when worst case is considered, results in exploration of $B_{n}$ options, where $B_{n}$ is th $n^{th}$ Bell number. I am trying to rigorously prove, that dealing with $B_{n}$ possible solutions results in exponential (or worse?) computational complexity (in terms of $n$)... |
I am studying cache coherence MESI protocol with "intervention" (cache can send to other cache without use the Main Memory).
On my notes I wrote that in case of a processor has a block in M (modified state) and read on the bus a Write operation done by an other Cpu, the processor sends the block directly to the cache t... |
I am trying to solve a problem- Longest repeated substring in a string. Firstly, I built a suffix tree that takes O(n) time and then I traversed the suffix tree to find the deepest internal node. I am not sure whether traversing in a suffix tree would be O(n) or not?
These are the properties of a suffix tree-
A suffix... |
I am currently studying the Erdos-Reyni model, the $G(n,p)$ model to be specific.
Its easy to understand that all graphs with $m$ edges have generating probability of $p^{m}(1-p)^{n(n-1)/2 - m}$ where p is the probability that there is an edge between a pair of vertices.
What I am not able to understand is the followin... |
(Pre-note: I'm learning Theory of Computation on my own, so bear with me if I'm saying something wrong/stupid.)
Why is $L := \{b^2a^nb^ma^3\mid m,n \geq 0\}$ a regular language?
This question appeared in a problem set, whose answer is the following:
The language is regular. Indeed, it can be expressed by the regular... |
I have a graph consisting of about 5000 vertices, with density around 0.5. I'm trying to find two disjoint 6-cliques, which are not connected by an edge. I have tried bruteforcing this, by firstly looking for any 6-cliques, and then checking pairs for being non-adjacent. However, although it finds a lot of 6-cliques it... |
I have a set of source bins, each with some number of items, and a set of target bins. I want to move all of the items from the source bins to the target bins, using the minimum number of moves. Each move can move any number of items from one source bin to one target bin.
The bins do not have the same size, but the t... |
I came across this classic question and found may many solution to it. for loop and DP/ reclusive + memorization.
Also found a twisted version of the questions asking to print all possible path instead of counting. Wondering for the twisted version, if we have DP solution ?
Q: If there are n stairs, you can either tak... |
There's a list of (unknown) integers, in [0...20]. They are generated from a uniform distribution via a RNG.
The input is observations of the form:
in a subrange [i,j) of the list, and some given threshold T in [0...20], how many sextuples exist (not necessarily of consecutive numbers) consisting of numbers that are l... |
I have implemented a branch and bound algoritm for finding a Hamiltonian cycle in my software, but I actually need to find a shortest route from fixed vertex through all verticies ending at any of them.
As far as I understood, I can reduce closed-cycle TSP to open-cycle with fixed starting point by adding dummy vertex... |
Max weighted independent set returns a set of nodes that form the maximum weighted independent set. K-independent set returns yes/no if the graph has a independent set of size k. How would you go about proving this?
|
so I have a problem on one of my computational structures final reviews, and I cannot seem to figure it out. It's been driving me crazy, so I would like to post it here for some insight.
Prove that the following CFG is ambiguous.
S-> begin A end
A-> A;A / a / S
Terminals: begin, end, ;, a.
Variables: S, A.
I cannot see... |
I have no detailed questions actually. My question is about a (maybe possible) generalization for reductions.
We defined reduction as following (If I translate a term false please correct me.):
$ L_1, L_2 \in \{0,1\}^* $ two languages.
One may reduce the language $L_1$ to $L_2$, if there is a total function:
$f: \{0,1\... |
In the Rabin Karp algorithm the rolling hash is calculated as follows:
H1= c1*a^k-1 + c2*a^k-2+c3*a^k-3+…+ck*a^0
where a is a constant. On what basis is this a selected? In Cormen they have used a value 10 and at some other places it is 26. By observation, when the string is of digits they have taken a = 10 and when t... |
The term abstraction as I understand it, is used in many different contexts, but has one essential meaning, namely that it refers to the “general properties of some class of objects that doesn’t rely on their details”. For example, abstraction in programming is e.g. interfaces that allow you to constrain a set of objec... |
Let G be a graph that forms a cycle on $n$ vertices, with non-negative weights on the edges.
Can you give each vertex v a vector $\mathbb{R}^m$ (for some $m\in \mathbb N^+$) such that the L1 distance (taxicab distance) between two vectors is the same as the distance between them in $G$?
Prove for a general circular g... |
The definition for SUTO and WUTO is the following:
Suto
If some process TODelivers some message m before message mʹ, then a process TODelivers mʹonly after it has TODelivered m.
And for WUTO
If process p and process q both TODdeliver messages m and mʹ, then p TODelivers m before mʹ if and only if q TODdelivers m bef... |
$n$ : length of text T
$m$ : length of pattern P
When I study Rabin-Karp algorithm, I learned the best case of this algorithm is $\theta(n-m+1)$. Because if a hashed number is too small to modulo by some other number.
But when I'm talking with my friends about this best complexity, I was very curios that does above ... |
I'm reading A Rendezvous of Logic, Complexity and Algebra, my first introduction to the world of CSP. Let $\Gamma$ be a finite constraint language. It says in Pg. 9 that
$Pol(\Gamma)$ is used to denote the set of all polymorphisms of $\Gamma$, that is,
$$Pol(Γ) = \{f : \forall R \in \Gamma, \textrm{ f is a polymorph... |
There is a problem that as much as I am trying to understand it, I fail. There are theoretically three cache manufacturers that each make 16 byte cache. The first has 16 blocks, 8 blocks the second, and 4 blocks the last. Then we are provided with 12 memory addresses, and we are asked the hit ratio of each cache. How d... |
We learned about the WISARD neural network in my machine learning course. We said that for an $n\times k$ image, we would use discriminators having $n$ RAM neurons each of $2^k$ bits. The examples we covered were always simplistic and involved small images, something like $3\times 4$.
I am looking at some past papers i... |
I’m trying to find an efficient algorithm for the following optimization problem:
Given a matrix $A$ with elements $a_{ij}$ and dimension $k$, select exactly $n$ elements from $A$ ($n<k$) such that the sum of the elements is maximized, subject to the constraint that any index of $a_{ij}$ is only used once. In other wor... |
I have a list of board members of all companies in the city. In the city lives three gangsters. Every company needs to have at least two gangsters among the friends of board members but every board member can know at most one gangster. Member can be a board member in multiple companies.
What is the name of this problem... |
The human brain as studied by neuroscientists, or neurobiologists, generally focus on what I would call
implementation details (how specifically does information transport between synaptic channels, i.e. what are the chemical processes)
vague generalities (e.g. about "memory" as a psychological concept and in very va... |
Is there any particular reason for picking a left-leaning red-black tree over a regular red-black tree when trying to do a purely functional implementation?
I've not researched very deeply into this subject matter but I see that Okasaki's implementation is left-leaning, and just as Yamamoto's.
Left-leaning red-black t... |
Recently i have found a problem stating:
There is a network of roads G=(V,E)(it is not directed) connecting a set of cities V. The length of each road e ∈ E is le. There is a proposal to add one new road to this network, and there is a list E′ of pairs of cities between which the new road can be built. Each such potent... |
I have some issue with how to simplify regular expression. I cannot find any suitable method to approach these types of problems.
How would one approach simplifying the following regular expression:
(01(11)* (10+0)+00+1)* 0(11)*
Thanks in advance,
Erik
|
The OpenAPI specification aims at standardizing the representation of REST based systems in json and yaml formats. A short version of the petstore is below:
{
"swagger": "2.0",
"info": {},
"host": "petstore.swagger.io",
"basePath": "/v2",
"tags": [],
"schemes": [
"http"
],
"paths": {},
"securityDefinitions"... |
Are thre any efficient algorithms for checking if a list of integers is pairwise coprime, or would a more general algorithm be the best option available?
|
Let $T$ be a Splay Tree. For a given permutation $\sigma$ on a set $S = \{1,2,3,...n \}$ we defined the following function:
Splay-Insert-Permutation(σ)
{
FOR i := 1 TO n DO
T.Tree-Insert(σ(i))
T.Splay(σ(i))
ENDFOR
}
We basically insert the elements of some permutation on $S$ one by one and perform splay after ... |
How to calculate the rate of growth of the below function $f(x)$?
$$
\begin{align*}
f(x) &= \begin{cases} f(x-1) + g(x) & \text{if } x > 1, \\ 1 & \text{if } x \leq 1. \end{cases} \\
g(x) &= \begin{cases} f(x-1) + g(x/2) & \text{if } x > 1, \\ 1 & \text{if } x \leq 1. \end{cases}
\end{align*}
$$
|
You are given an array with $N$ elements. The values of the elements may be any number in the interval $[0,10^9]$. Define $f(a,b)$ as the bitwise or of all the values in the subarray $[a,b]$. Find a bound on the number of distinct values of $f(a,b)$.
Attempts: I have tried to brute force cases to find a pattern but w... |
In the paper Deep Networks with Large Output Spaces, Vijayanarasimhan et al. describe their approach to approximating the dot product between a neural network's output layer's parameter vector and input activations with winner-take-all hashing. I'm trying to grasp the main idea described in the following paragraph:
Ou... |
I find a formula on my book to estimate cpu utilization under multi-processing.
$ U = 1 - P^n $
U: cpu utilization
P: cpu idle
I want to know why or how to proof.
Edit:
The book is about operating system, not in english.
This may be like https://stackoverflow.com/questions/20328619/calculate-cpu-utilization/20328695?no... |
One candidate key is (report_no, author_id).
What are the other candidate keys?
|
Given a graph $G = (V, E)$ with $V = U \uplus T$ (let's say the vertices are
labelled $U$ or $T$), I am looking for the smallest set $U' \subseteq U$ such
that $G[U' \cup T]$ is connected.
If we eleminate all the type-U nodes from the graph, the type-T nodes (terminals) might form several disconnected subgraphs.
That ... |
Topological sorting on a graph seems like an immensely powerful operation:
No matter whether the algorithm ends in success or failure, we obtain an important information about the topology of the graph, i.e. whether it is cyclic or not.
If it ends in failure, we can trivially find the cycle that let the algorithm end ... |
I have a matrix which represents the distances between every two relevant items. For example, M[i][j] holds the distance between items i and j. My next aim is to cluster items by these distances.
I can provide some parameters: maximal number of clusters, maximal distance between two items in a cluster and minimal numb... |
This question is doable if you can calculate the number by multiplying f(n-1) and f(n-2).
Is it possible to do this question if we entirely want to skip multiplying these 2 numbers and still be able to calculate say the number of trailing zeros in f(20).
Why do I want to skip multiplying these two numbers?
Because as... |
Given: A Square Matrix where each entry is an integer (either positive or negative). The magnitude of each integer entry is at most $m$ bits. The size of the Square matrix is $nXn$.
Objective: Reduce the Square Matrix to a Diagonal Matrix form using Gaussian Row Elimination.
Query: What is the most efficient algorithm ... |
I'm struggling with this problem: you are given an array $A$ of $n$ integers and a number $k \in \mathbb{N} : k \neq 0$. The problem asks to find an algorithm that runs in $\Theta(n)$ that returns the length of the longest subarray $A'$ in $A$ s. t. $\max(A')-\min(A') \leq k$.
For example, in the array $A = \{6, 5, 9, ... |
I'm looking for an online algorithm/datastructure that is able to maintain a pareto frontier for two dimensional elements in an online scenario where elements can be added and deleted.
For example:
insert((3,7))
since the pareto front is empty it has to be added to it
set of elements E={(3,7)}
pareto frontier P={(3,... |
given:
$$m_1+m_2+...+m_k=m$$
How can I find $\Theta(log(m_1)+...+log(m_k))$ as related to $m$?
I know that i can doing that: $O(log(m_1)+...log(m_k))=O(log(m)+...+log(m))=O(k \cdot log(m))$ , but can I find something without $k$ ?
|
Given a directed a-cyclic graph G (unweighted), give algorithm which count all the paths from node s to node t, and calculate the run time complexity.
so I thought about the naive way to do this :
1)hold a counter (counter=0 at beginning) and start from vertex 's', loop through all 's' neighbors.
2) if one of the ne... |
Let $L$ be the language generated by a context-free grammar whose start variable is $S$. Does adding $S \rightarrow SS$ in this grammar creating language $L^*$, why? What about grammars in Chomsky normal form?
|
Many important (non-deterministic) complexity classes like NP are believed not to be closed under complement. But have any of them been proven not to be?
I'm sure one could construct some contrived example, but is there any "natural" complexity class that has this property, by which I mean one that has been studied by ... |
This answer on another SE community discusses the concept of a "counting complexity class". As far as I can tell, the author is using that term in a slightly nonstandard way: most sources (PS format) use that term to refer to complexity class like #P of counting problems that count the accepting branches of a polynomia... |
I want to build a cellular automata that simulates a behaviour that looks like clouds, that is: infinite and random cycles, pieces can gather or break apart, just like the image below:
My question is: Is there any algorithm whose result looks like this cycle (or anything that can help me)?
I've been searching for a lon... |
I was reading an article on Water Jug Problem. The problem is -You are given a m litre jug and a n litre jug where 0 < m < n. Both the jugs are initially empty. The jugs don’t have markings to allow measuring smaller quantities. You have to use the jugs to measure d litres of water where d < n.
I solved the problem usi... |
I am interested in all know classes of Computatinal problems. The Wikipedia article on computational problems types is incomplete. Some of the known classes are:
1- Decision problem such as 3SAT
2- Search problem such Factoring search problem
3- Function problem such as finding a second Hamiltonian cycle on a cubic gra... |
I've read the definition for Rice's Theorem, here's the one from Wikipedia:
In computability theory, Rice's theorem states that all non-trivial,
semantic properties of programs are undecidable.
The classical proof for proving Rice's Theorem is on Wikipedia, which is similar to other sources.
However, I have a pr... |
The problem is - Given an undirected tree with some marked nodes in a set and a positive number K. We need to print the count of all such nodes which have distance from all marked nodes less than K.
My first approach-
I ran bfs on every from each marked node given in the set and takes the intersection of the respectiv... |
Have some code (written in C), need the equivalent notation for mathematics.
Is it possible using if-statements and sigma notation for this, and if so, how?
int res = 0;
for (int i=0; i < (N/2)+1; i=i+1)
if (N % pow(2, i) == 0) res = i;
I have gotten as far as:
$$ \sum _{i=0}^{{N\over2}+1}\:(N \mod 2^i )$$ (missing ... |
Suppose we have a term rewriting system $\mathcal{R} = (\Sigma, R)$ with signature $\Sigma$ and set of basic rewrite rules $R$. Suppose we also have a set $S$ of ground rewrite rules, i.e. rewrite rules where both terms are ground terms. For my specific application, we can also assume that the right-hand sides of all r... |
In CMU's HoTT course, lecture 1, which can be found here: https://scs.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=0945cc7f-48b7-4803-81af-e7193a3f461d
At 33:52, Harper was giving parallel comparison between synthetic theories and analytic ones, and when he reached PL theory, he said Coq is analytic and said Coq onl... |
I was reading an article on Find the smallest binary digit multiple of given number. The problem is - We are given a decimal number N, we need to find the smallest multiple of N which is binary digit number.
There is an optimization done i.e. if a string with same mod value is previously occurred we won’t push this new... |
I'm trying to find the longest palindromic subsequence for any string and I've tried two approaches:
Recursive Algoritm
Dynamic Programming
Dynamic programming should be the better option in this case because of the time complexity but the time complexity of both algorithms is $O(n^2)$. My question is if the time co... |
In a Part Test for GATE Preparation there was a question :
f(n):
if n is even: f(n) = n/2
else f(n) = f(f(n-1))
I answered "It will terminate for all integers", because even for some negative integers, it will terminate as Stack Overflow Error.
But my friend disagreed saying that since this is not implemente... |
I had a question regarding converting a language with the Kleene star production into a PDA. Here's the particular language I was looking at in my textbook:
$$L = (aaa^*bab)$$
My normal approach to constructing PDA's for languages would be to determine the pattern or rule of the language, and think to myself that it's ... |
Let $A$ be a pushdown automata with input alphabet $\Sigma$ and stack alphabet $\Gamma$ and let $R \subseteq \Gamma^∗$ be a regular language. Let $L_R(A) \subseteq \Sigma^∗$ be a language of such words over alphabet $\Sigma$, for which there exists some run of automata $A$, such as in every step symbols on the stack be... |
I'm struggling to find a way to show that
$$T = \{ \langle M \rangle\mid M \text{does not halt on any input}\}$$
is undecidable.
Should I use reduction? If so, reduce this to what &ndashp the halting problem?
|
I was reading an article on Clone an Undirected Graph, It says I have do do bfs and have to keep track of visited/cloned nodes.
I have another approach- I will initialize an empty adjacency list and then traverse the original adjacency list and copy it. Its time complexity is O(V+E) and I don't have to keep track of a... |
We look at 32 bit and 64 bit systems with octal-core processors.
What does all that mean? As in, does it have 8 processors that operate bit wise?
Or do they all operate on 32/64 bit blocks.
I was studying Crypto with stream and block ciphers. And this has been confusing me now.
Also, is it fair to say that a computer h... |
I know when we have multiple networks connected to each other, we can call every network a layer and the whole network is called multi-layer. But I don't know what is the difference between multi-layer and multiplex and heterogeneous?
Thanks
|
You are given a tree $G\langle V, E\rangle$ and an integer $k$. The goal is to cover $k$ edges of the graph, to minimize the length of the longest uncovered path in the tree (and to return this path's length)
Constrains: $O(n\log n)$ time and $O(n)$ space.
Now, the scheme of the algorithm is kinda obvious (from the g... |
I am looking for a university/college that offers courses in English language and accepts students for Masters Degree in Computer Science and/or Mathematics without asking for a Bachelor's Degree. I have been studying online (doing courses from Coursera, EdX etc.) and have about the same knowledge as undergraduate stud... |
The homotopy type theory book claims in section 1.3 that "As in naive set theory, we might wish for a universe of all types" but from this one could "deduce from it that every type, including the empty type representing the proposition False, is inhabited"
The reference that it gives uses notation that I don't understa... |
Let $A$ be a sorted array of $n$ positive integers (sorted in non-decreasing order, that is there can be equal consecutive elements). Can we check whether some positive integer $x$ is a sum of $k$ elements of $A$ in $O(n^2)$ or $O(n^3)$ time complexity? If yes what would be the pseudocode?
This seems to be a knapsack... |
In the book Logic in Computer Science on page 244, there is a proof that $[[E(\phi U\psi)]]$ is the least fixed point of $G(X)=[[\psi]] \cup ([[\phi]]\cap\mathop{\textrm{pre}}_\exists(X))$. I don't get the idea of point 2. I tried to understand why this proof says that $[[E(\phi U\psi)]]$ is the least fixed point of $G... |
I'm solving the end of the chapter problems of Morris Mano's Digital Design (4th Edition, if that's relevant). In one of the problems, it is asked to simply find the 1's and 2's complement of 00000000. It's 1's complement would be 11111111. Now, for 2's complement, adding 1 to will give 100000000. But in the answer key... |
I'm seeking some clarification on the proof of the expected number of probes in an unsuccessful search in open addressing hashing. The proof is given in CLRS on page 275, section 11.4 (Open addressing).
Specifically, why is the higher bound of an expectation (of unsuccessful probes) in search is $\infty$? What is the r... |
I'm looking for pointers for high-performance calculation of the weighted Jaccard similarity between two sparse count vectors. I would like to speed up my code by at least 5x.
I have a database of about 2 million count vectors. Each count vector is sparse, with about 50 non-zero terms in the range 0-(2**32-1). (The num... |
Consider such question:
(Prove or disprove) There exists a language in $TIME(2^{n^2})$ that is not in $NTIME(n)$.
I guess that answer is yes because $TIME(2^{n^2})$ and $NTIME(n)$ are totally different classes ($TIME(2^{n})$ and $NTIME(n)$ are the same classes, i guess). How to prove it strictly? (Or my guess is incorr... |
I had a question regarding LL($k$) grammars. I came across a problem that I attempted to solve, but my answer varied from the solution and I wasn't sure why.
$$L = \{a^{n + 2}b^mc^{n + m}\ :\ n \ge 1,\ m \ge 1\}$$
The grammar I came up with is:
$$
\begin{align}
S & \rightarrow aaA \\
A & \rightarrow aAc\ \vert\ bBc \\
... |
I am reading the PBFT Correctness Proof Paper and I cannot make completely sense of the Invariant 4.7 and its proof:
Here are my concerns:
I assume that the symbol $\Leftrightarrow$ is used with the usual meaning of double implication.
$n\mbox{-}faulty$ is defined (Definition 4.3) as the number of faulty replicas, so... |
My first question here, I think this will be an easy one.
As for definition:
NP:
NP is the set of decision problems solvable in polynomial time by a theoretical non-deterministic Turing machine. (wiki)
P:
P Contains all decision problems that can be solved by a deterministic Turing machine using a polynomial amount of ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.