instruction stringlengths 0 29.8k ⌀ |
|---|
Any set $A$ Turing-reduces to its complement $A^c$.
Hence, the non-recognizable set $K^c$ Turing-reduces to the recognizable set $K=(K^c)^c$, where $K$ is the Kleene set (or, if you prefer, your favorite variation on the halting problem). |
Assume we have:
$$T(n)=7T(\frac{n}{2})+n^2\lg{n}$$
Can we solve it using master theorem?
As we know $n^{\lg_2{7}}\approx n^{2.81}$. On the other hand, we have $f(n)=n^2\lg n$. So we should compare $n^.081$ and $\lg{n}$. As I know, $\lg{n}=\mathcal{O}(n^{0.81})$. So the answer should be $T(n)=\Theta(n^{\lg7})$. Am ... |
Can this reccurrence recurrence be solved using Master Theorem? |
|recurrence-relation|master-theorem| |
Yes, that recurrence can be solved using the master theorem, and you got (sort of) the correct answer but your justification is wrong (or at least deficient).
In particular it is false (in general) that a recurrence of the form $T(n) = aT(n/b) +f(n)$ has solution $T(n)= \Theta(n^{\log_b a})$ when $f(n) = O(n^{\log_b... |
{"Voters":[{"Id":6759,"DisplayName":"Steven"}],"DeleteType":1} |
{"Voters":[{"Id":6759,"DisplayName":"Steven"}]} |
Yes, that recurrence can be solved using the master theorem, and you got (sort of) the correct answer but your justification is wrong (or at least deficient).
In particular it is false (in general) that a recurrence of the form $T(n) = aT(n/b) +f(n)$ has solution $T(n)= \Theta(n^{\log_b a})$ when $f(n) = O(n^{\log_b... |
Yes, that recurrence can be solved using the master theorem, and you got (sort of) the correct answer but your justification is wrong (or at least deficient).
In particular it is false (in general) that a recurrence of the form $T(n) = aT(n/b) +f(n)$ has solution $T(n)= \Theta(n^{\log_b a})$ when $f(n) = O(n^{\log_b... |
I want to do my undergrad thesis on this topic. Can anyone suggest me some existing papers related to this topic or its real life use cases? |
Related papers about finding furthest reachable point choosing subset from given 2d vectors |
|algorithms|computational-geometry| |
Given a set of 2D vectors, find the furthest reachable point
I want to do my undergrad thesis on this topic. Can anyone suggest me some existing papers related to this topic or its real life use cases? |
Yes, that recurrence can be solved using the master theorem, and you got the correct answer but your justification is wrong (or at least deficient).
In particular it is false (in general) that a recurrence of the form $T(n) = aT(n/b) +f(n)$ has solution $T(n)= \Theta(n^{\log_b a})$ when $f(n) = O(n^{\log_b a})$. As ... |
Given a set of 2D vectors, find the furthest reachable point.
I want to do my undergrad thesis on this topic. Can anyone suggest me some existing papers related to this topic or its real life use cases? |
Yes, that recurrence can be solved using the master theorem, and you got the correct answer but your justification is missing on a detail.
In particular it is false (in general) that a recurrence of the form $T(n) = aT(n/b) +f(n)$ has solution $T(n)= \Theta(n^{\log_b a})$ when $f(n) = O(n^{\log_b a})$. As a concrete... |
Yes, that recurrence can be solved using the master theorem, and you got the correct answer but your justification is missing on a detail.
In particular it is false (in general) that a recurrence of the form $T(n) = aT(n/b) +f(n)$ has solution $T(n) \in \Theta(n^{\log_b a})$ when $f(n) \in O(n^{\log_b a})$. As a con... |
I have a solid grasp on why we minimize the L2 norm of the weight vector ( w ) in Support Vector Machines (SVM) for classification problems — it maximizes the margin between classes and helps the model generalize well to unseen data. However, I'm finding myself lost when trying to understand the analogous concept in Su... |
How exactly does minimizing the L2 norm of w in SVR affect the model's ability to fit the data? |
|machine-learning|mathematical-foundations|svm| |
Assume this recurrence:
$$T(n)=T(n-1)+\frac{1}{n}$$
As we can use Master Theorem and Akra-Bazzi method here, I tried to draw a recurrence tree and I reached the whole cost of this tree is $\frac{1}{1}+\frac{1}{2}+\frac{1}{3}+\dots+\frac{1}{n}$. What's a tight upper and lower bound for this recurrence (I'm talking a... |
Solve the recurrence $T(n)=T(n-1)+\frac{1}{n}$ |
|recurrence-relation| |
The quantity $H_n = \sum_{i=1}^n \frac{1}{i}$ is known as the $n$-th [harmonic number](https://en.wikipedia.org/wiki/Harmonic_number).
It is well-known that $H_n = \Theta(\log n)$.
|
Assume this recurrence:
$$T(n)=T(n-1)+\frac{1}{n}$$
As we can use Master Theorem and Akra-Bazzi method here, I tried to draw a recurrence tree and I reached the whole cost of this tree is $\frac{1}{1}+\frac{1}{2}+\frac{1}{3}+\dots+\frac{1}{n}$. What's a tight upper and lower bound for this recurrence (I'm talking a... |
The quantity $H_n = \sum_{i=1}^n \frac{1}{i}$ is known as the $n$-th [harmonic number](https://en.wikipedia.org/wiki/Harmonic_number).
It is well-known that $H_n = \Theta(\log n)$.
To see this notice that:
$$
H_n = \sum_{i=1}^n \frac{1}{i} \ge \int_{1}^n \frac{1}{x} \text{d}x = \ln n,
$$
and
$$
H_n = 1 + \sum... |
The quantity $H_n = \sum_{i=1}^n \frac{1}{i}$ is known as the $n$-th [harmonic number](https://en.wikipedia.org/wiki/Harmonic_number).
It is well-known that $H_n = \Theta(\log n)$.
To see this notice that the function $\frac{1}{x}$ is monotonically decreasing, which means that the area under $\frac{1}{x}$ in the ra... |
The quantity $H_n = \sum_{i=1}^n \frac{1}{i}$ is known as the $n$-th [harmonic number](https://en.wikipedia.org/wiki/Harmonic_number).
It is well-known that $H_n = \Theta(\log n)$.
To see this notice that the function $\frac{1}{x}$ is monotonically decreasing, which means that the area under $\frac{1}{x}$ in the ra... |
Assume this recurrence:
$$T(n)=T(n-2)+\frac{1}{\lg{n}}$$
I tried to draw its recurrence tree and I reached that the whole cost is $\dfrac{1}{\lg{n}}+\dfrac{1}{\lg{n-2}}+\dots+\dfrac{1}{x}$ that $x$ is $2$ if $n$ is even, otherwise is $3$. So somehow we should solve $\sum_{i=1}^{\frac{n}{2}}{\dfrac{1}{\lg{2i}}}$ or $\... |
Solve the recurrence $T(n)=T(n-2)+\frac{1}{\lg{n}}$ |
|recurrence-relation| |
It can be proven with the following two steps that clique with cardinality at least L exist:
1. There is at least one node which is in the clique of G+
2. If a node is in the clique of G+ than all of its predecessors are in the clique
For #1 we use proof by contradiction. So we will assume that no such node exi... |
Ignoring rounding (which does not affect the asymptotic growth rate):
$$
\sum_{i=1}^{n/2} \frac{1}{\log 2i} \ge
\sum_{i=1}^{n/2} \frac{1}{\log n} \ge
\frac{1}{2} \cdot \frac{n}{\log n} = \Omega\Big(\frac{n}{\log n}\Big),
$$
and
$$
\sum_{i=1}^{n/2} \frac{1}{\log 2i} =
\sum_{i=1}^{\sqrt{n}/2} \frac{1}{\log 2i}... |
null |
I'm performing a sequence of text formatting using regex in Python, some questions arise.
I'm curious to know if it's possible to formally verify whether a single (or a sequence of) regex modification(s) is an idempotent, which means that for any `text`, `d ∘ d (text) = d (text)`, where `d` denotes the resulting tot... |
How to Formally Verify if a (or a Sequence of) Regex-Based Modification(s) is an Idempotent |
Ignoring rounding (which does not affect the asymptotic growth rate):
$$
\sum_{i=1}^{n/2} \frac{1}{\log 2i} \ge
\sum_{i=1}^{n/2} \frac{1}{\log n} \ge
\frac{1}{2} \cdot \frac{n}{\log n} = \Omega\Big(\frac{n}{\log n}\Big),
$$
and
$$
\begin{align*}
\sum_{i=1}^{n/2} \frac{1}{\log 2i} &=
\sum_{i=1}^{\sqrt{n}/2} ... |
Given a set of 2D vectors. Find maximum magnitude of sum of a subset of the set.
I want to do my undergrad thesis on this topic. Can anyone suggest me some existing papers related to this topic or its real life use cases? |
Related papers about finding longest vector(maximum in magnitude) as subset sum from given set of 2d vectors |
{"OriginalQuestionIds":[84892],"Voters":[{"Id":755,"DisplayName":"D.W.","BindingReason":{"GoldTagBadge":"algorithms"}}]} |
{"OriginalQuestionIds":[56158],"Voters":[{"Id":755,"DisplayName":"D.W.","BindingReason":{"GoldTagBadge":"algorithms"}}]} |
Given a set of 2D vectors. Find maximum magnitude of sum of a subset of the set.
I want to do my undergrad thesis on this topic. Can anyone suggest me some existing papers related to this topic or its real life use cases? I need research papers specifically. |
|algorithms|computational-geometry|research| |
Is my proof that FINIT is undecidable correct?
```
FINITE= { ⟨M⟩ | M is a Turing machine that accepts only finitely many strings } is undecidable.
Answer:
To prove this we can use reduce to Halting Problem, which is a known to be undecidable problem.
to prove that FINITE is undecidable, assume for contradiction... |
Help me verify my proof that FINITE is undecidable |
|undecidability| |
This is likely to be a very hard problem, so hard that I don't think you should expect a useful solution that can handle all possible regexes.
The extended regular expressions supported by Python's `re.sub` are very expressive and powerful, which makes the verification problems involving them very hard. These advan... |
Is my proof that FINIT is undecidable correct?
FINITE= { ⟨M⟩ | M is a Turing machine that accepts only finitely many strings } is undecidable.
Answer:
To prove this we can use reduce to Halting Problem, which is a known to be undecidable problem.
to prove that FINITE is undecidable, assume for contradiction ... |
Approximation ratio of 1 means that it outputs an exact solution (so it is not an approximation algorithm but rather an exact algorithm). Set cover is known to be NP-hard, so there is no such polynomial-time randomized algorithm, unless RP = NP. |
how to prove that in the Nearest Neighbor algorithm for the Traveling Salesman Problem with one modification, if it finds a hamiltonian cycle, it's the optimal cycle. the modification is if the shortest path it could choose is an edge to a node already visited, the algorithm stops. |
optimal hamiltonian cycle in the Nearest Neighbor algorithm for the Traveling Salesman Problem |
|hamiltonian-circuit| |
For an integer linear program: Given a matrix $A \in \mathbb{Z}^{n\times d}$ and two vectors $b \in \mathbb{Z}^{n}$, $c \in \mathbb{Z}^{d}$, compute $max\{ c^{\top}x|Ax \leq b, x\geq 0, x\in \mathbb{Z}^{d}\}$ is an NP hard problem.
Also given matrix $A \in \mathbb{Z}^{n \times d}$ and a vector $b \in \mathbb{Z}^{n}... |
Given objective value for ILP find parameter is NP hard? |
|complexity-theory|optimization|linear-programming|integer-programming| |
null |
In exercise 22.3-13 of CLRS (Intro to Algorithms 3rd edition), the authors provide the following problem:
A directed graph $G = (V, E)$ is **singly connected** if the existence of a path from $u$ to $v$ implies that $G$ contains at most one simple path from $u$ to $v$ for all vertices $u, v\in G$. Give an efficient ... |
A $O(|E||V|)$ algorithm to determine if a graph is singly connected? |
|algorithms|graphs|algorithm-analysis|graph-traversal|depth-first-search| |
In exercise 22.3-13 of CLRS (Intro to Algorithms 3rd edition), the authors provide the following problem:
A directed graph $G = (V, E)$ is **singly connected** if the existence of a path from $u$ to $v$ implies that $G$ contains at most one simple path from $u$ to $v$ for all vertices $u, v\in G$. Give an efficient ... |
I'm performing a sequence of text formatting using regex in Python, some questions arise.
I'm curious to know if it's possible to formally verify whether a single (or a sequence of) regex modification(s) is an idempotent, which means that for any `text`, `d ∘ d (text) = d (text)`, where `d` denotes the resulting tot... |
I'm performing a sequence of text formatting using regex in Python, some questions arise.
I'm curious to know if it's possible to formally verify whether a single (or a sequence of) regex modification(s) is an idempotent, which means that for any `text`, `d ∘ d (text) = d (text)`, where `d` denotes the resulting tot... |
In exercise 22.3-13 of CLRS (Intro to Algorithms 3rd edition), the authors provide the following problem:
A directed graph $G = (V, E)$ is **singly connected** if the existence of a path from $u$ to $v$ implies that $G$ contains at most one simple path from $u$ to $v$ for all vertices $u, v\in G$. Give an efficient ... |
Here's the problem link: [Alien Dictionary][1]
Now the optimal solution requires building a DAG. We iterate over the dictionary and compare every string to its next string, building the DAG using total 'n-1' comparisons (n=number of strings). My question is why does it not require n^2 comparisons. How can I be sure ... |
Why not n^2 comparisons in the Alien Dictionary problem on leetcode? |
|algorithms|graphs|data-structures|dag| |
If I am doing a many-one reduction from L1 to L2, since it is described as a total function, does that mean that every possible encoding in L2 should have been achieved from L1 or is it possible that there might be some encodings of L2 that cannot be derived from this reduction.
If such encodings exists in my reduc... |
Does valid value in L2 have to be gotten from L1 when we have a Many-One Reduction from L1 to L2 |
|complexity-theory|turing-machines|computability|reductions| |
Note that the algorithm by *Cormen et. al.* runs DFS for each vertex separately. Therefore, for the case you mentioned, the algorithm declares the graph as *non-singly connected* when performing DFS starting from the vertex $v$. In that case, one of the back edges will be a cross-edge in the DFS tree, thus declaring th... |
Note that the algorithm by CLRS runs DFS for each vertex separately. Therefore, for the case you mentioned, the algorithm declares the graph as *non-singly connected* when performing DFS starting from the vertex $v$. In that case, one of the back edges will be a cross-edge in the DFS tree, thus declaring the graph as n... |
null |
IMO, it is intuitive to reduce Vertex-Cover to the problem that you are describing (which will show that the problem you are describing is at least as hard as Vertex-Cover). At the core of the problem you describe, you have to find $k$ literals such that setting them to 1 will satisfy the boolean formula. This is just ... |
The closest thing that I found was the from the Indian based college(?) Chennai Mathematical Institute's [STEM's][1] competition for Computer Science (Category A & B).
[1]: https://tessellate.cmi.ac.in/stems/ |
The closest thing that I found was the from the Indian based college(?) Chennai Mathematical Institute's [STEM's][1] competition for Computer Science (Category A & B).
Some tangentially relevant discussion is in the doi: 10.1007/978-3-319-25396-1_9
[1]: https://tessellate.cmi.ac.in/stems/
|
The closest thing that I found was the from the Indian based college(?) Chennai Mathematical Institute (CMI)'s [STEM's][1] competition for Computer Science (Category A & B).
Some tangentially relevant discussion is in the doi: 10.1007/978-3-319-25396-1_9
[1]: https://tessellate.cmi.ac.in/stems/
|
null |
In the Narasimha's data structure book, there is a line
> The amortized time of a push operation in the incremental growth of array stack (realloc on every push) is $O(n) [O(n^2) / n]$.
I am confused with this Big-O notation here, what does it mean? Is arithmetic legal on big-o notation functions? |
Explaination of incremental push's amortized time |
|algorithm-analysis| |
Note that the algorithm by CLRS runs DFS for each vertex separately. Therefore, for the case you mentioned, the algorithm declares the graph as *non-singly connected* when performing DFS starting from the vertex $v$. In that case, one of the back edges will be a cross-edge in the DFS tree, thus declaring the graph as n... |
This is from the Narasimha's data structure book
> For nth element (n - 1 index), if we want to push an element, create a new array of size n and copy old array to the new, and at the end assign the value of n-1 index.
>
> After n push operations the total time T(n) is proportional to 1 + 2 + 3 + 4 .... + n ≅ $O(n... |
Why is the push operation in incrementally grown array stack is $O(n^2)$ |
|data-structures|algorithm-analysis|stacks| |
The time for pushing in a stack of size $k$ is $O(k)$.
Thus the cost of all of the pushes is:
$$\sum_{k=1}^{n} k \ = \ \frac{n(n+1)}{2} \ = \ O(n^2) \ .$$
|
It just means that the amortized time complexity is $O(n)$, amortized over $n$ pushes. The $[O(n^2)/n]$ indicates that the $O(n)$ amortized time comes from a total time complexity of $O(n^2)$ divided by the $n$ pushes.
The total time complexity is $O(n^2)$ because a push in a stack of size $k$ costs $O(k)$, thus:
$... |
Every recursion formula of the form T(n) = T(n-k) + f(n) for sum fixed k can be turned into a sum: T(n) is the sum of f(n - i*k) for those i where f(n - i*k) is not known, plus the first known value. In your case you would need to know T(1) and T(0) without the recursion formula.
Note that for $\sqrt n ≤ j ≤ n$ we ... |
I'm working on [a problem][1] from the Digital Design and Computer Architecture course on Systolic arrays.
The question set up is as follows:
> The following diagram is a systolic array that performs the multiplication of two 4-bit binary numbers (a
and b). For example, if a=1110 and b=1011, the result of the mu... |
How do you understand Systolic Arrays? |
|computer-architecture|arrays|computation-models|parallel-computing| |
Every recursion formula of the form $T(n) = T(n-k) + f(n)$ for sum fixed $k$ can be turned into a sum: $T(n)$ is the sum of $f(n - i\times k)$ for those $i$ where $f(n - i\times k)$ is not known, plus the first known value. In your case you would need to know $T(1)$ and $T(0)$ without the recursion formula.
Note th... |
Given a range of "K" bit numbers, we want to identify the whole range by using a subset within that range, with the following criteria -
1. If there are > "n" consecutive 0s, it becomes the 1st [00] prefix identifier value - **case (a)**
2. If there are <= "p" consecutive 0s, (where p < n), that value has to ... |
Binary range identification in terms of subset |
|sets|binary|pattern-recognition| |
Given a range of "K" bit numbers, we want to identify the whole range by using a subset within that range, with the following criteria -
1. If there are > "n" consecutive 0s, it becomes the 1st [00] prefix identifier value - **case (a)**
2. If there are <= "p" consecutive 0s, (where p < n), that value has to ... |
I am interested in finding an efficient algorithm for the following problem:
Let $x \in [0,1]^n$ be some vector, with $x_n = 1$.
We want to recover $x$, solely by asking queries of the form $\texttt{argmax}(x + v)$ where $v \in \mathbb{R}^n$ is an arbitrary additive shift.
A simple algorithm is to do binary se... |
Recover unknown vector through shifted argmax queries |
|algorithms|time-complexity|sorting| |
Here, `flip()` is a function that returns `0` or `1` with equal probability. It can be proved function `Random(n)` returns a number from `0` to `n-1` with identically distributed probabilities (using loop invariant).
```
function Random(n):
v = 1;
c = 0;
loop
v = 2v;
c = 2c + flip();
... |
How many random-bits does this algorithm use on average? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.