instruction stringlengths 35 29.1k |
|---|
How do I prove that the following language isn't context-free using the pumping lemma?
$$
L=\{w_1\#w_2\#\dots\#w_k \colon k ≥ 2, w_i \in \{0,1\}^*, w_i = w_j \text{ for some } i \ne j\}
$$
I am having trouble choosing the string to use for the proof. I know that I have to choose a string such that at least two substrin... |
I was self learning about entropy and came across this equation.
$$
H = - \sum p(x) \log p(x)
$$
The equation for entropy in expected value,
$$
H(x) = \operatorname*{\mathbb{E}}_{X \sim P}[I(x)] = -\operatorname*{\mathbb{E}}_{X \sim P}[\log P(x)].
$$
But the expected value is written as
$$
\mathbb{E}[X] = \sum_{i=1}^k ... |
I'm working on an algorithm that computes lots of "nearest point on a triangulated surface" queries in 3d as a way to resample data sets, and I'm wondering if there is any information out there on speeding up these queries. My gut tells me that partitioning the set of query points in a voxel grid or something, and doin... |
Let $L_1$ be some language in $R$. Let $L_2$ be some language in $RE$. Is it necessarily that
$L_1 \leq_m L_2$ ?
I know that for non trivial $L_1$,$L_1$ in $R$ it is right to say that $L_1 \leq_m L_2$.
But I can't prove the first case.
and another question:
I am almost certain that the following is true, though I have ... |
I came across the question:
What are the minimum and maximum numbers of elements in a heap of height $h$?
To which I came up with this theory:
$$\sum_{i=0}^{h-1} 2^i = 2^h-1$$
$2^h-1$ is the internal nodes and that is understood according to the understood fact. But because nowhere except CLRS mentions heaps to be a ... |
In some problems related to the Ising model in physics and mathematics the following problem comes up:
Suppose I have a graph $G$. Then an even spanning subgraph of $G$ is a subgraph where you keep all the vertices and some of the edges such that each vertex has even degree.There is always at least one since the empty ... |
We can write inductive types in terms of a fixpoint type:
Fix : (* -> *) -> *
In : (f : * -> *) -> f (Fix f) -> Fix f
NatF r = () + r
Nat = Fix NatF
Z = In NatF (InL ())
S n = In NatF (InR n)
But this fix type is not sufficient for indexed datatypes and we need an indexed fixpoint:
IFix : (I : *) -> ((I -> *) -> (I -... |
The Observational Equality from Epigram 2 seems to be intensional equality (like Coq and Agda have), but it also supports function extensionality. In that sense it seems that Observational Equality is better in every way than intensional equality in a type theory.
Is it true that it's always better to have Observationa... |
Coq (and other type theories such as Setoid Type Theory) have a Prop universe for propositions. As far as I understand this universe is needed to be sure that the propositions can be erased. In Quantitative Type Theory one can explicitly say which parameters are only used in types and can be erased. Does Quantitative T... |
Originally posted in Stack Overflow but was told to post here.
Context: I am doing a PCA on a $M \times N \, (N \gg M)$ matrix with some invalid values located in the matrix. I cannot infer these values, so I need to remove all of them, which means I need to delete the whole corresponding row or column. Of course I wan... |
Consider that you have a permutation of $n$ elements from $1$ to $n$ and you need to sort the elements lexicographical . for example sorted permutation for $n=11$ is $1,10,11,2,3,4,5,6,7,8,9$ .Now consider this notation $Q(n,k)$ as position of number $k$ in lexicographical sorted permutation. $Q(11,2)=4$. We are give... |
Given G(V,E) a graph that has 2 connected components, what is the diamter of this graph?
|
Are there any "natural problems" which are known to be NPI under weak assumptions.
By weak assumptions I mean something like $P \neq NP$ or $NP \neq Co-NP$
|
I am having trouble understanding the following statement regarding Turing reduction:
"If P1 is reduced to P2, then P2 is at least as hard as P1."
Does this mean that
(i) P2 can be harder or as hard as P1, or
(ii) P2 can be easier or as hard as P1?
To represent this visually...
I would appreciate any insight on the ... |
I was going the text Introduction to Algorithms by Cormen et al. Where I came across the following statement in the proof of the third case of the Master's Theorem.
(The Statement of Master theorem) Let $a \geqslant 1$ and $b > 1$ be constants, let $f(n)$ be a function, and let $T (n)$ be defined on the nonnegative int... |
Below is a problem worked out in the Introduction to Algorithms by Cormen et. al.
(I am not having problem with the proof but only I want to clarify the meaning conveyed by few statements in the text while solving the recurrence and the statements are given as ordered list at the end. Simply because I want to master th... |
I wonder what is the best data structure I can use in order to achieve the following:
Given a data structure based on a balanced BST, I would like to get a tree with the $\lfloor\frac{n}{2}\rfloor$ greatest values in $O(1)$.
I thought about maintaining another balanced BST and a variable containing the middle value, bu... |
There is a tool called JFLAP, which, among other things, can analyze push-down automata, and find non-determinism.
In this example it is detecting non-determinism in state q0:
The first symbol in the transition represents the symbol read as input; the second symbol represents the symbol extracted from the stack; and t... |
Question:
An email campaign has a sequence of email messages
where each email message belongs to one of two categories:
transactional (and/or) marketing.
Given the campaign size n and the gap length k, find the total number
of distinct valid campaigns.
My Approach:
My initial thoughts were around generating all the v... |
First case:
I was stumble upon a two step sequential algorithm where the big O complexity of each step is $O(N^9)$.
Second case:
Also if the algorithm have three steps where the complexity of step 1 is $O(N^2)$, the complexity of step 2 is $O(N^3)$ and the complexity of step 3 is $O(N^9)$
What would be the complexity o... |
I am trying to understand the technique of using configuration history in proofs.
To prove that:
$\{<M>|M\,\,\,is\,\,\,a\,\,\,TM\,\,\,and\,\,\,L(M)=\sum^* \}\notin RE$
given $<M,w>$ we have built a Turing machine that accepts all words except M accepting configuration on w. (and then simple reduction)
To prove that:
$\... |
I am trying to determine whether Kolmogorov complexity is computable for a specific language. I am certain this given language is not Turing-Complete. The language is defined as follows:
$A;B \text{ - executes instructions A and B one after the other.}$
$!x_i! \text{ - sets variable } x_i \text{ to the value }2.$
$\{... |
I recently came across the sentence in the Book Introduction to Algorithms section 4.1 The maximum sub-array problem:
We still need to check $\binom{n-1}{2} = \Theta(n^2)$ subarrays for a period of $n$ days.
Here $n$ is the number of days taken as an example to show the changes in price of stock.
We can consider this... |
Lets say we use the predictive parser LL(1). Why is it necessary that
$FIRST(\alpha) \cap FIRST(\beta) = \emptyset$,
for all $\alpha, \beta$ right side of alternative productions i.e., productions associated to the same non-terminal. Why is this condition necessary?
|
How to prove if P = NP if problem Π ϵ NP-complete and Problem complement Πc ϵ NP?
OR
P = NP if NPC intersects with Co-NPC
|
The pieces of information available to us are the number of leaves in a tree and that each internal node must have at least two children. Is there a way to find the upper bound on the total number of nodes in the tree?
|
I would love to have a direction for the following exercise (the material for this exercise is greedy algorithms):
Let $G = (V,E)$ an undirected graph whose vertices $V = \{v_1,\dots,v_n\}$ appear in this order on the real line (meaning forall $1 \leq i < j \leq n$, $v_i$ appears before $v_j$).
A $d$-divison of $G$'s v... |
I have found this reference for the C syntax Backus-Naur Form (BNF). I was wondering if there are any other ambiguities in this grammar other than the infamous "dangling else"? Also how we can modify the BNF grammar to avoid those ambiguities, including the known one mentioned above?
|
Let N and M be arbitrary 1024+ bit integers.
The objective is to compute the product of N and M (2048+ bits)
There exist various multiplication algorithms for various bit lengths (ex library: GMP). But there is always the assumption that both numbers are equally arbitrary.
Are there algorithms that are even faster unde... |
Construct a Turing machine for
M = {wvw| v, w ∈ {a, b}*, reversal(v) = w}.
I tried to imagine that I will have to divide the string into 3 equal parts and check if the first and last part are identical, and that first two parts form a palindrome. But not sure how to proceed with this to construct the turing machine.
|
We have N tasks that need to be scheduled for processing. Each task consists of two parts that need to executed in order. The first one is guarded by a mutex and therefore only one task can be executing this part at a time. The second part has no such constraint and any number of the tasks can be executing this at the ... |
In the world of mutable/ephemeral data structures and imperative programming languages, one of the classic ways to implement a stack or queue is to use array doubling: use mutation to fill up or empty an array, doubling or halving to expand/contract. Such stacks/queues have several nice properties:
They use at most tw... |
Problem statement Suppose I have a boolean function $f: \mathbb{F}_2^n \times \mathbb{F}_2^m \to \mathbb{F}_2$ where $\mathbb{F}_2 = \{0,1\}$.
I define two boolean functions $h: \mathbb{F}_2^n \to \mathbb{F}_2$ and $g: \mathbb{F}_2^m \to \mathbb{F}_2$ to be xor separable upper bound of $f$ if
$$f(\vec{x}, \vec{y}) \leq... |
Euclidean geometry is complete, so the problem of determining whether a statement $A$ is provable is computable. Do we know its time complexity?
|
I was reading Turing's paper on computable numbers and the Entscheidungsproblem. There is this part of Section 9, Part II that I cannot quite seem to understand. He says:
It is pretty straight forward until the part where he introduces $\mathfrak{U}$. So $\mathfrak{U}$, he says, includes the Peano axioms; but what els... |
Are there any two primes that are NOT a factor of $M$ that multiply up to $M$?
Fact: Any two primes that multiply up to $M$. Must be factors of $M$!
Thus because of the fact above an $O(1)$ algorithm exists. It always outputs $NO$
Complement
Are there any two primes that are a factor of $M$ that multiply up to $M$?
Fac... |
I was reading this article. The author talks about "The Blub Paradox". He says programming languages vary in power. That makes sense to me. For example, Python is more powerful than C/C++. But its performance is not as good as that of C/C++.
Is it always true that more powerful languages must necessarily have lesser po... |
Given language $L$, why is it not necessarily true that the number of equivalence classes of $L$ is equal to the number of equivalence classes of $L^R$?
And for the private case that $L$ is regular, is that true?
|
I was going the text Introduction to Algorithms by Cormen et. al. Where I came across a step in the analysis of the time complexity of the $BUILD-MAX-HEAP$ procedure.
The procedure is as follows:
BUILD-MAX-HEAP(A)
1 heap-size[A] <- length[A]
2 for i <- ⌊length[A]/2⌋ downto 1
3 MAX-HEAPIFY(A,i)
Now the author... |
I am currently reading this paper which shows how to calculate CRC using the instruction PCLMULQDQ. I don't quite understand the equations in it yet.
Starting with this one for the definition of crc32:
CRC (M (x)) = xdeg(P(x)) • M(x) mod P(x)
Before reading this paper, I had only ever seen CRC (M (x)) = M(x) mod P (x... |
I have a sequence of 1s and 0s. For example: $bits = [1, 0, 1, 1, 1, 0]$. I also have an array of positive integers. For example $arr = [12, 23, 4, 6, 8, 0, 24, 72]$. I need to find the index, $i$, in $arr$ of the leftmost element of $bits$ such that
$$\sum_{j = i}^{i + \textrm{length of bits}}{bits[j - i] * arr[j]}$$
... |
I am very new to the whole concept of context-free grammars to represent the syntax tree of formal languages (i.e., programming languages). It seems that the Backus–Naur form (BNF) is the oldest of all possible notations and the most prevalent one. Though it looks like to be an ancient piece of art. Now I'm wondering t... |
I am trying to find an DFA for the regular language given by the expression $L\left( aa^{\ast }\left( a+b\right) \right)$.
First simplifying $L\left( aa^{\ast }\left( a+b\right) \right)$ we get
$L\left( aa^{\ast }\left( a+b\right) \right)$ $= L\left( a\right) L\left( a^{\ast }\right) L\left( a+b\right) $
Then I constru... |
I am trying to understand average no of exchanges in Quicksort.
Here is the code to partition the array -
private static int partition(double[] a, int lo, int hi) {
int i = lo;
int j = hi + 1;
double v = a[lo];
while (true) {
// find item on lo to swap
while (l... |
I'm trying to piece together a general picture of the state of formal software verification, and I'm having a good bit of trouble. For context, I come from mostly a math background. I'm quite familiar with the state of automated theorem provers and proof assistants with respect to their use to prove well formed mathema... |
I'm a math Ph.D. having done research in Algebraic Geometry and Algebraic Topology in grad school for my thesis and I've studied a fair amount of category theory in the process (e.g. having worked through most of "Categories for the Working Mathematician" as well as more specialized topics in Homological Algebra). Is t... |
Given $S$ of positive integers $>$ $1$ is there some combination with even $SUM$ > $2$ that is NOT the sum of two primes?
$SUM$ = 10
$S$ = $[4,6]$
$No$,
Sum of Two Primes
$5 + 5 = 10$.
Combination $4+6=10$
It has an $O(1)$ algorithm if Goldbach is True (always output $NO$). Otherwise, it would seem to be NP-complete be... |
I was going through the text Introduction to Algorithms by Cormen et. al. and I came across their analysis of the worst case of the quicksort algorithm. I could not quite understand a few specific statements used by them.
I try to bring up the excerpts from the text with the portions where I face difficulty and the por... |
I was going through the text Introduction to Algorithm by Cormen et. al. where I came across an excerpt which I felt required a bit of clarification.
Now as far as I have learned that that while the Best Case and Worst Case time complexities of an algorithm arise for a certain physical input to the algorithm (say an in... |
How can i perform binary subtraction of two numbers that are already in 2's complement?
I have to subtract 01010011 from 10100110,both numbers are in 2's complement.
I know that 10100110 is -90,and 01010011 is 83,so the result should be -173.
So if i use 8 bits that means that there's overflow.
But i don't get how can ... |
This problem is not decidable (reducible to halting problem) but is semi-decidable and therefor verifiable (as those two definitions are equivalent: How to prove semi-decidable = verifiable?).
However, is this problem poly-time verifiable?
A decision problem $P$ is poly time verifiable iff there is an algorithm called... |
For some enumeration of the complexity class P (such as this as an example: How does an enumerator for machines for languages work?), for each string in the enumeration, does there exist some other string (certificate) that allows you to verify is a member of the enumeration in poly time? I believe that it might be ... |
I am intrigued: In many languages there are both normal control flow and exceptions.
But I never saw "an exception from an exception" or "an exception from an exception from an exception". Why?
Why there are just two variants?
My guess is that an "exception from an exception" would be just another class of exceptions, ... |
$L=\{\langle M,k\rangle \mid\exists w\in L(M) \text{ such that $M$ passes at least
$k>2$ distinct states before accepting $w$}\}$
I try to think of reduction to prove that this language is neither RE nor coRE.
How to approach this problem? Is there a hint, or intuition?
I usually check whether Rice can be used, but t... |
I read the question in Exercise 4.1-4 in Introduction To Algorithms:
Suppose we change the definition of the maximum-subarray problem to allow the result to be an empty subarray, where the sum of the values of an empty subarray is 0. How would you change any of the algorithms that do not allow empty subarrays to permi... |
Suppose $G$ is a $CFG$ with $m$ variables, in which the right-hand side of all production rules has length at most $\ell$. Show that if $A\Rightarrow^*_G\varepsilon$, then there is a derivation of no more than $\frac{\ell^m-1}{\ell-1}$ steps by which $A$ derives $\varepsilon$. How close to this bound can you actually c... |
Given the alphabet $\Sigma = \{1,2,\dots, n \}$ and a parameter $k$ how can we find all words of length $k$ over $\Sigma$ in lexicographic order?
I thought of doing this recursively, but although the task is basic it seems pretty hard to come up with a general algorithm, even when using the last word as a parameter usi... |
I'm faced with the following problem:
Given
Directed and unweighted graph, where each edge E has two attributes
Goal
Find every path through the 3 (or more) given edges in a specific order
Questions
Is it NP-hard?
Is there already an algorithm for this?
I was thinking about placing a node in every edge and than ru... |
I'm having a small issue with wikipedia's proof that $RP \subseteq NP$:
An alternative characterization of RP that is sometimes easier to use is the set of problems recognizable by nondeterministic Turing machines where the machine accepts if and only if at least some constant fraction of the computation paths, indepe... |
I tend to see a lot of ML/AI/DL courses everywhere. Having no background in either of these, I am confused about what to do and where to begin. I was suggested to have a look into the Stanford Andrew Ng ML course. That seems pretty outdated now. I see Python libraries being used always everywhere.
The following two cou... |
Suggest a way to augment an AVL tree to support a $O(\log n)$ implementation of the function
calculateSum(key), which receives a key of a node and returns the sum of its subtree.
I implemented it this way:
sumSubtree(node):
if node != null:
return sumSubtree(node.left) + sumSubtree(node.right) + node.key
... |
Assume for the regular knapsack problem we have additional information - maximal weight of every item - lets denote it as P. Using this information, I want to solve the problem using dynamic programming in $O(n^2P)$.
Anyone have an idea how to solve it?
|
I'm confused about where the probability from the hiring problem comes from.
For background:
We interview one person everyday who has a quality characteristic, x, from 0 to 1(distributed uniformly). We interview for n days. If on the $i^{th}$ day, person i is more qualified then all the previous candidates, then we hi... |
Given an arbitrary binary tree on $n$ nodes, choose an assignment $A$ from each parent to one of its children (the "favored child" as it were). We define the skew height of the tree as $H_A(\mathsf{nil})=0$ and $H_A(\mathsf{node}\;a\;b)=\max(H_A(a), H_A(b)+1)$ if $A(\mathsf{node}\;a\;b)=a$ is the favored child and symm... |
If $T$ is a Turing Machine that accept a language $L$, I want to define a Turing Machine $T'$ such that accepts the language $L^*$.
An approach:
$T'$ is a nondeterministic Turing Machine which has many tapes.
$T'$ 'copies' in a nondeterministic way a prefix from the original string to another tape and then it is appli... |
I was going through the text Introduction to Algorithms by Cormen et. al. where there was a discussion regarding the fact that finding the minimum of a set of $n$ (distinct) elements with $n-1$ comparisons is optimal as we cannot do better than it, which means that we need to show that running time of algorithm which f... |
I was going through the text Introduction to Algorithms by Cormen et. al. where I came across the recurrence relation for analyzing the time complexity of the linear SELECT algorithm and I felt that few things probably mismatch with respect to the range of $n$, the input size for which $T(n)$ is assumes $O(1)$ and $cn$... |
Most standard works on random graphs focus on $G_{n,p}$ and random regular graphs. However, such models are far from a good abstraction to describe the types of networks that one typically encounters in the real world.
There are several simple models that mimic the behavior of real-world graphs, sometimes called Comple... |
Regular expressions in the sense as equivalent to regular (Chomsky type 3) languages know concatenation xy, alternation (x|y), and the Kleenee star x*.
"Real-life" regular expressions as used in programming usually have a lot more operations available; amongst others, quantification x{n}, negation [^x], positive and ne... |
I would like to prove in Haskell, whether in vanilla Haskell or using some libraries / tools, some simple theorems such as:
and [n*(n+1)/2 == sum [0..n] | n <- [0..]]
Is there a simple enough (ie. fully automated) way to prove such theorems involving integers in Haskell? I am not really interested in the proof itself,... |
I have calculated the boolean functions for $r$ and $f$:
$f = \overline{s_1} \cdot s_0 + s_1 \cdot \overline{s_0}$.
$r = \overline{s_0 \cdot s_1 \cdot s_2 \cdot s_3}$.
Do you have an idea what an application for this circuit can be? I don't know where we would use it.
|
I'm trying to solve the contiguous subarray problem on CodeSignal & I came up with the following solution which is based off of Kadane's Algorithm. My implementation passed the given test data set however upon submission, it failed. There's no reason given on CodeSignal & I can't look at it since I just started doing i... |
I am referring to the definition of the minimum vertex cover problem from the book Approximation Algorithms by Vijay V. Vazirani (page 23):
Is the size of the minimum vertex cover in $G$ at most $k$?
and right after this definition, the author states that this problem is in NP.
My question: What would be a yes certif... |
I'm trying to find an algorithm that can find the lengths of simple cycles in an undirected graph in parallel that benefits strongly enough from it's parallelization to be practically more efficient than what I'm currently using to find simple cycles in an undirected graph.
Basically if a graph has n nodes, I need to k... |
While going through the official documentation SHA algorithms from NIST here.
There is a choice and Majority function used.
Maj(,,)=(∧)⊕(∧)⊕(∧)
Ch(,,)=(∧)⊕(¬∧)
Can I use Ch (or Maj) function in a simplified version?
eg:
(x^y)⊕(¬∧)
=(x^y)^ ¬(¬∧) + ¬(x^y)^ (¬∧)
=(x^y)^(x + ¬z) + (¬x + ¬y)^ (¬∧)
can be further simplified ... |
While reading the classic text Introduction to Algorithms by Cormen et. al. I came across the following claim:
Sets are as fundamental to computer science as they are to mathematics. Whereas mathematical sets are unchanging, the sets manipulated by algorithms can grow, shrink, or otherwise change over time. We call su... |
Suppose I have a matrix with entries either $x$ or $y$, where the number of rows = number of columns = $n$. If I want to select/circle $n$ entries such that for each row, only exactly one is circled, for each column, also exactly one is circled, and such that all entries circled are only $x$ (if such a circling of entr... |
By unrolling the recursion,
\begin{equation*}
\begin{split}
T(n) &= T(\sqrt{n}) + 3 = T(n^{\frac{1}{2}}) + 3 \\
&= (T(n^{\frac{1}{4}})+3) +3 = T(n^{\frac{1}{4}}) +6 \\
&= (T(n^{\frac{1}{8}})+3) + 6 = T(n^{\frac{1}{8}}) +9 \\
\end{split}
\end{equation*}
Claim: $T(n) = T(n^{\frac{1}{2^k}}) + 3 \cdot k$
Base ... |
Problem Statement:
Suppose that I have a $0-1$ matrix $A$ (all of the entries are $0$ or $1$). I wish to find the tightest upper bound with $k$ many unique rows. To be more precise, let S denote the set of $0-1$ matrices $B$ such that it only has $k$ unique rows, $A_{ij} \leq B_{ij}$ for all $i$ and $j$.
Find
$$\min_{B... |
I have a multi-objective linear programming problem of the form Ax = b, where A is a matrix and x and b are vectors. x is known, and I'm looking to minimise each row of b by solving for A.
Constraints are:
Each column of A must add up to 1.
A will start with some values being 0, and those must remain 0. In other word... |
My question is whether a specific decision problem is in P or not. It's straightforwardly in NP. The decision problem is a specific case of the general $k$-color leapfrog problem.
I can already show that when $k=1$, the problem is in P. And when $k$ is unlimited, the problem is NP-complete. I have not been able to find... |
I am having trouble figuring out how to solve this recurrence problem...
$$
\begin{aligned}
&4T(n/2) + n \\
= &4(4T(n/4) + n/4) + n \\
= &16T(n/4) + 2n \\
= &4^kT(n/2^k) + kn
\end{aligned}
$$
I lose the trail here and I cannot figure out how to finish it and actually find the complexity. Can anyone help? How can this ... |
Consider the language $$L = \{ x \in \{0,1\}^* \mid |x| = 3 \}.$$
I think the above language is regular. A DFA can be used to determine the above language.
Am I correct? Is the above language regular?
If this language $L$ is regular, then it should satisfy the pumping lemma. Then there exist $w = xyz$, where $xy^nz \... |
I am given that $Z$ is independent of $(X,U)$, where $Z$ and $X$ are binary random variables while $U$ is an arbitrary random variable. I need to prove the following:
$$ H(X\oplus Z|U) \geq H(X|U)$$
Am I doing this right?:
$$ H(X\oplus Z|U) - H(X\oplus Z|U,Z) + H(X\oplus Z|U,Z) - H(X|U)$$
$$ H(X\oplus Z|U) - H(X\oplus ... |
So i'm currently reading a lot of things about graph NP-complete problems, and it seems that the goal of a lot of researchers is to find new results about their complexity, results like "independent set is 1.593 approximable for graphs which doesn't contains K4 K5 P3 as a minor" (this is probably a wrong result i just ... |
I have the following complexity equation: $T(n)=T(n-i)+T(n-(\frac{n}{m}-i))$ with the base case $T(m)=1$.
Is it possible to calculate a big $O$ approximation for such equation? What is the right method to do so?
Edit:
I actually need to calculate this equation for any $1\leq{i}<\frac{n}{m}$
so if it is easier to consid... |
independent problem is: there is a simple and undirected graph, we are looking for the maximum vertex in which there is no edge between any two of them.
cluster problem is: there is a simple and undirected graph, we are looking for the maximum number of the vertex in which there are proximity every two vertexes ( there... |
I have a simple script to calculate gaps in a sequence of digits of the square root of 2 (or any other multi-precision constant).
As input, I generated files with the bigfloat module in Python:
from bigfloat import sqrt, precision
MAX_PRECISION_BITS: int = 1 << 30
CONSTANT = 2
precision_bits: int = 8
while precision_... |
Problem. Given $X$ a finite metric space of cardinality $n$, construct a data structure in subquadratic time such that the query distance to the kth nearest neighbor of x can be resolved in sublinear time (independent of $k$) for arbitrary $k \leq n$ and $x \in X$.
What I have tried. I am aware of the existence of kdt... |
Given an infinite set $S \subseteq \mathbb{N}$, define the language:
$L_S = \{ \langle M \rangle : M $ is a deterministic TM that does not halt on $\epsilon$, or, $T_M \in S\}$
where $T_M$ is the number of steps that $M$ takes until it halts with the empty word $\epsilon$ as input (or $\infty$ if it doesn't halt).
Wha... |
I'm having troubles understanding two things from some notes about Uniform Hashing.
Here's the copy-pasted part of the notes:
Let us first argue by a counting argument why the uniformity property,
we required to good hash functions, is computationally hard to
guarantee. Recall that we are interested in hash functions ... |
I have this first task:
You have a set of numbers $S =\{ \dots \}$ of length $n$.
And a number $k$.
Both $n$ and $k$ are powers of $2$ and: $1 < k < n$
Your task is to write an algorithm (pseudo-code) that splits $S$ into $k$ sets (which have the same length each): $S_1 , S_2 , \dots, S_k$ such that all the numbers i... |
The example in this answer proves the fact familiar to CS students - that the "big-O" is not a total order. However, most algorithm running times analyzed using big-Oh notation are not expressed in piecewise form like this example. In fact, most algorithms I am familiar with have a running time expressed in terms of po... |
I can easily define a class that corresponds to the notion of a "monoidal structure" on a type M via
Definition associative {X:Type} (f : X -> X -> X) : Prop := forall x y z:X, f (f x y) z = f x (f y z).
Definition opId {X:Type} (f : X -> X -> X) (e : X) : Prop := forall x:X, f e x = x /\ f x e = x.
Class Monoid (M:... |
It is known that recognizing a unit disk graph is NP-hard [1].
However, the paper does not mention how hard the realization problem is.
I have looked up several references [2][3][4]. None of the papers answer whether the following problem is NP-hard:
Given a unit disk graph $G = (V,E)$, find a configuration of a set
$... |
I've been thinking about a division problem for groups that I haven't found a dynamic programming solution and I'm trying to analyze the complexity of the problem.
There is a set of $n$ positive numbers ($S$), a vector of group sizes (let's call it $Sizes$), and a parameter $Y$. Find a way for divide the $n$ numbers in... |
I am working on a project to convert equations to LaTeX code. After segmenting out the characters, I got stuck on the detection part and was looking for some pre-trained model that could detect characters of the equation for later conversion to LaTeX. Is there any such pre-trained model available on the internet that c... |
Disclaimer: I am just an undergraduate student so my exposure to a lot of things is certainly limited.
I am not sure about the actual popularity of the idea that consciousness is a computation but my impression is that it is very widespread. I lost count to how many times I saw, sometimes very serious scientists, claim... |
My problem is this:
Let's say I have an arbitrary list of integers A[2013, 54, 3, 32 1, 23...]
What is the best strategy to find which of those numbers I should add together to have a sum equal or closest to a given number ?
Obviously there is always the brute force method but I'm interested in knowing if there is a mo... |
Let $T \subseteq \Sigma^* \times \Sigma^*$ be a regular (rational) relation. We define the obligatory rewrite relation over $T$ as follows:
$$
R^{obl}(T) := N(T) \cdot (T \cdot N(T))^*
$$
$$
N(T) := Id(\Sigma^* \setminus (\Sigma^* \cdot dom(T) \cdot \Sigma^*)) \cup \{ \langle \epsilon, \epsilon \rangle \}
$$
$N(T)$ is... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.