instruction stringlengths 0 29.8k ⌀ |
|---|
null |
null |
I am trying to find (without success) a sample complexity lower bound for PCA. The concrete problem I am considering is -
$X_{1}, X_{2}, \cdots X_{n} \sim D(0, \Sigma)$ are $d$-dimensional vectors sampled IID from a distribution with zero-mean and covariance matrix $\Sigma$. Our objective is to compute an $\epsilon... |
Sample Complexity Lower bound for PCA |
|optimization|information-theory|lower-bounds|statistics| |
I have two arrays that both contain $n$ elements (positive, non zero, not negative)
$\{x_1\dots x_n\}$
$\{y_1\dots y_n\}$
I want to pair them up optimally, one from each array, so that the pairs come out as even as possible, when paired up optimally. I want the difference between the highest sum of pair valu... |
null |
null |
Let $G$ be a connected undirected graph, e.g.:
```
u -- v -- w
\ /
x
```
I would like to determine the number of sequences in which every vertex of the graph is visited. This is supposed to work as follows:
- The starting vertex is fixed
- The next vertex to be visited must be a neighbor of one of the a... |
Find the number of all possibilites to visit all vertices in a connected graph |
|algorithms|graphs| |
null |
This is a made up question not seen somewhere so I am not sure if a good solution exists but here it is anyways.
Given an array $ A $ of $ N $ non-negative integers, find the longest non-decreasing subsequence of this array such that every adjacent pair in the subsequence is co-prime, ie. $ gcd(a_{i}, a_{i + 1}) = 1... |
Longest Increasing Co-Prime Subsequence? |
|data-structures|optimization|dynamic-programming|number-theory|longest-increasing-subsequence| |
null |
One of my favourites is the "brothers paradox":
https://en.wikipedia.org/wiki/Boy_or_Girl_paradox
I tell it as I learned it*, as follows:
in a village, each family has two children, elder and younger. The children are born with probability $\frac12$ for either boy or girl.
I knock on a door, and a boy opens it ... |
Let $G$ be a connected undirected graph, e.g.:
```
u -- v -- w
\ /
x
```
I would like to determine the number of sequences in which every vertex of the graph is visited. This is supposed to work as follows:
- The starting vertex is fixed
- The next vertex to be visited must be an unvisited neighbor of o... |
Find the number of all possibilities to visit all vertices once in a connected graph |
|algorithms|graphs|graph-traversal| |
I'd like to compute the inverse of a matrix of size $S^2N \times S^2N$ over complex numbers that is composed of tri-diagonal $S\times S$ size blocks of tri-diagonal $S\times S$ block matrices. This leads to a matrix with tri-diagonal stripes.
I know that there exist algorithms with speed-ups for tri-diagonal matric... |
Algorithm for the inversion of a striped matrix with tridiagonal stripes |
|algorithms|complexity-theory|matrices|linear-algebra| |
null |
Designing a datastructure which supports the following operations on integers (It can also be visualized as a datastructure on strings, if the alphabets/characters have total ordering)
Operations on the (integer/character) string.
1. Insert an element with value $v$ at index i.
2. Delete an element from index ... |
Data Structure for strings on integers |
|data-structures|strings| |
Consider the following grammar $G$:
$$S \rightarrow SA \ | \ AS \ | \ aXb \ | \ bXa, \ \ \ X \rightarrow \# \ | \ BXB, \ \ \ A \rightarrow a \ | \ b \ | \ \#, \ \ \ B \rightarrow a \ | \ b$$
Decide if complement of $L(G)$ is also a context-free language.
My approach was to find a word not in the language, such t... |
Decide if complement of context-free language is also a context-free language |
|formal-languages|context-free|formal-grammars| |
With 12 bits, apparently you can represent $2^{12}$ different days or 11 years. But how?
If you have 6 characters YYMMDD and each character represents 8 bits, how can this represent $2^{48}$ days?
|
How can you represent 4096 days with 12 bits? |
|storage| |
Designing a datastructure which supports the following operations on integers (It can also be visualized as a datastructure on strings, if the alphabets/characters have total ordering)
Operations on the integer string.
1. Insert an element with value $v$ at index i.
2. Delete an element from index $i$
3. Inc... |
There should be solution based on a weight balanced binary tree such that every node keeps its weight (number of descendants). For an insertion or deletion, you will find the $i^{\text{th}}$ node using the weight information. Then perform standard insertion or deletion.
The increment operation is trivial.
The sea... |
Designing a datastructure which supports the following operations on integers (It can also be visualized as a datastructure on strings, if the alphabets/characters have total ordering)
Operations on the integer string.
1. Insert an element with value $v$ at index i.
2. Delete an element from index $i$
3. Inc... |
Designing a datastructure which supports the following operations on integers (It can also be visualized as a datastructure on strings, if the alphabets/characters have total ordering)
Operations on the integer string.
1. Insert an element with value $v$ at index i.
2. Delete an element from index $i$
3. Inc... |
This is a made up question not seen somewhere so I am not sure if a good solution exists but here it is anyways.
Given an array $ A $ of $ N $ non-negative integers, find the longest non-decreasing subsequence of this array such that every adjacent pair in the subsequence is co-prime, ie. $ gcd(a_{i}, a_{i + 1}) = 1... |
If I am right, there are $36524$ legal dates in the format YYMMDD in a complete century ($36525$ every fourth centuries).
The information content is about $15.16$ bits, which is $2.53$ bits per character.
|
$2^{12}$ days is indeed $11$ years, $2$ months and a few days (depending on the starting date). Convert from day number to YYMMDD date.
----------
If I am right, there are $36524$ legal dates in the format YYMMDD in a complete century ($36525$ every fourth centuries).
The information content is about $15.16$... |
null |
$2^{12}$ days is indeed $11$ years, $2$ months and a few days (depending on the starting date). Convert from day number to YYMMDD date.
----------
If I am right, there are $36524$ legal dates in the format YYMMDD in a complete century ($36525$ every fourth centuries).
The information content is about $15.16$... |
I'm reading the [Wikipedia][1] article on Backpropagation and have some questions on the math.
$$
\frac{d C}{d a^L}\cdot \frac{d a^L}{d z^L} \cdot \frac{d z^L}{d a^{L-1}} \cdot \frac{d a^{L-1}}{d z^{L-1}}\cdot \frac{d z^{L-1}}{d a^{L-2}} \cdot \ldots \cdot \frac{d a^1}{d z^1} \cdot \frac{\partial z^1}{\partial x}
... |
Neural Net Back-propagation: Question on Wikipedia math |
|neural-networks| |
null |
I was reading a bit about $NP$-problems and how it is widely assumed that $NP\neq co$-$NP$. This also implies that the complement of $NP$-complete problems are not in $NP$.
What is known is that the complement of a $co$-$NP$-complete problem is $NP$-complete and it could be that either $NP=co$-$NP$ or $NP\neq co$-$N... |
Could there theoretically exist a problem $A$ which is in $co$-$NP$, but its complement $A^{C}$ is $EXPTIME$-complete? |
|complexity-theory|np-complete|p-vs-np| |
{"Voters":[{"Id":154939,"DisplayName":"questionmaster"}],"DeleteType":1} |
{"Voters":[{"Id":154939,"DisplayName":"questionmaster"}]} |
{"Voters":[{"Id":154939,"DisplayName":"questionmaster"}],"DeleteType":1} |
{"Voters":[{"Id":154939,"DisplayName":"questionmaster"}]} |
[Selectors][1] and [combinators][2] from CSS are a form of [combinatory logic][3]. This can be reduced to the [SKI calculus][4].
I think it is also possible to see CSS rulesets as a form of [lenses][5] from functional programming. E.g. a CSS ruleset is a functor of `DOMElement -> DOMElement` which changes how it loo... |
To solve multi-armed bandit problem, the common approaches are UCB or TS and there are many variants of these algorithms. I am wondering if it is possible to model and solve this problem as a linear program? If yes, is it possible to derive regret bound for the algorithm?
I have seen some papers that use LP, primal-d... |
How to solve MAB by linear program? |
|linear-programming|reinforcement-learning| |
I was reading a bit about $NP$-problems and how it is widely assumed that $NP\neq co$-$NP$. This also implies that the complement of $NP$-complete problems are not in $NP$.
What is known is that the complement of a $co$-$NP$-complete problem is $NP$-complete and it could be that either $NP=co$-$NP$ or $NP\neq co$-$N... |
I was reading a bit about $NP$-problems and how it is widely assumed that $NP\neq co$-$NP$. This also implies that the complement of $NP$-complete problems are not in $NP$.
What is known is that the complement of a $co$-$NP$-complete problem is $NP$-complete and it could be that either $NP=co$-$NP$ or $NP\neq co$-$N... |
null |
I did some thinking and analysis this evening and I'm wondering if what I'm pointing out here is interesting:
https://medium.com/@nwcodex/invocation-asymptotics-runtime-cost-based-on-the-anticipated-invocations-of-code-paths-in-the-ed3e0d401970
Could it be that asymptotics are typically only interesting in the c... |
Asymptotics Accounting for Invocation Frequency in the Context of the broader system |
|complexity-theory|time-complexity|asymptotics|runtime-analysis| |
null |
I have come across what seems to be a collapsed loop.
parallel-for i, j = 1...n
What would be the work and span/depth/critical path length be of loops like this? Would it be the same as that of the following:
parallel-for i = 1...n
parallel-for j = 1...n
**EDIT**:
**Work** = the asymptotic... |
I was reading the section of _Data Structures for Disjoint Sets_ from the text _Introduction to Algorithms_ by _Cormen et. al_. I made it through the proof, but I'm not sure I understand the very last sentence (and it seems a little handwavy to me)
---
The prerequisites:
> $$level(x)=\max\{k:rank[p[x]]\geq A_k(... |
Difficulty in last sentence in proof of "Amortized cost of $\text{Find-Set}$ operation is $\Theta(\alpha(n))$" from CLRS |
|algorithms|data-structures|amortized-analysis|union-find|disjoint-sets| |
I was reading the section of _Data Structures for Disjoint Sets_ from the text _Introduction to Algorithms_ by _Cormen et. al_. I made it through the proof, but I'm not sure I understand the very last sentence (and it seems a little handwavy to me)
---
The prerequisites:
> $$level(x)=\max\{k:rank[p[x]]\geq A_k(... |
I was reading the section of _Data Structures for Disjoint Sets_ from the text _Introduction to Algorithms_ by _Cormen et. al_. I made it through the proof, but I'm not sure I understand the very last sentence (and it seems a little handwavy to me)
---
The prerequisites:
> $$level(x)=\max\{k:rank[p[x]]\geq A_k(... |
I was reading the section of _Data Structures for Disjoint Sets_ from the text _Introduction to Algorithms_ by _Cormen et. al_. I made it through the proof, but I'm not sure I understand the very last sentence (and it seems a little handwavy to me)
---
The prerequisites:
> $$level(x)=\max\{k:rank[p[x]]\geq A_k(... |
I was reading the section of _Data Structures for Disjoint Sets_ from the text _Introduction to Algorithms_ by _Cormen et. al_. I made it through the proof, but I'm not sure I understand the very last sentence (and it seems a little handwavy to me)
---
The prerequisites:
> $$level(x)=\max\{k:rank[p[x]]\geq A_k(... |
null |
First, let's separate `styles` (which existed **before** css) and `css`.
Styles are just how things should look and I'm not going to delve deeper into it.
CSS on the other hand is a system of applying styles according to rules.
The core concept that CSS introduced is Aspect Oriented Programming (AOP). AOP is u... |
Decode controls to a Karnaugh map, then let A vs B choose.
K00 = XOR(cont_0,cont_1)
K01 = cont_0
K10 = cont_0
K11 = NOR(cont_0,cont_1)
Two input gates less than when controls do the choosing...
|
Decode controls to a Karnaugh map, then let A vs B choose.
K00 = XOR(cont_0,cont_1)
K01 = cont_0
K10 = cont_0
K11 = NOR(cont_0,cont_1)
Two input gates less than when controls do the choosing...
No input gates required to decode after the 1st slice. All may share the same Karnaugh map. |
Decode controls to a Karnaugh map, then let A vs B choose.
K00 = XOR(cont_0,cont_1)
K01 = cont_0
K10 = cont_0
K11 = NOR(cont_0,cont_1)
Two input gates less than when controls do the choosing...
No input gates required to decode after the 1st slice. |
I want to calculate average hours worked from below bar graph and following this method but I feel this method is not correct to find average working hours
<img src="https://i.stack.imgur.com/eJqRc.png" />
Procedure A:
( 4*1+4*2 +6*3+7*4 + 13*5 +8*6 ) /(1+2+3+4+5+6)sum of worked hours
average= 171/21... |
How to calculate average hours worked from bar graph |
|algorithms|data-structures|average-case| |
null |
Neither of the above mentioned procedures gives the correct average working hours.
Average working hours is the ratio of the total working hours of employees to the number of employees.
I don't understand the reason for posting this question in this platform it is in no way related to computer science and you could p... |
null |
Shouldn't this statement be false? To be true the implication should be P=NP or am I wrong?
I can't find a formal proof
|
if it were shown that every algorithm that solves SAT must have complexity Ω(n^(log n)) then P≠NP? |
|complexity-theory|np|satisfiability|co-np| |
With regards to the first question: "I wonder though if a complement of a $co$-$NP$ problem (not necessarily $co$-$NP$-complete) $A^C$ can be $EXPTIME$-complete?
The complement of a $co$-$NP$ language is, by definition, a $NP$ language. Hence, you are asking if there can be a $NP$ language which is $EXPTIME$-comple... |
I want to implement the algorithm [provided in this answer](https://stackoverflow.com/a/1106968):

(Please see original post for details.)
It calculates every combination of making a provided amount by using coins from a provided list of denominations.
I think I have ... |
Please help me decipher the symbols in this closed-form |
|algorithms| |
I was reading the section of _Data Structures for Disjoint Sets_ from the text _Introduction to Algorithms_ by _Cormen et. al_. I made it through the proof, but I'm not sure I understand the very last sentence (and it seems a little handwavy to me)
---
The prerequisites:
> $$\alpha(n) : \text{Inverse of a very ... |
I was reading the section of _Data Structures for Disjoint Sets_ from the text _Introduction to Algorithms_ by _Cormen et. al_. I made it through the proof, but I'm not sure I understand the very last sentence (and it seems a little handwavy to me)
---
The prerequisites:
> $$\alpha(n) : \text{Inverse of a very ... |
null |
Let $G$ be a connected undirected graph, e.g.:
```
u -- v -- w
\ /
x
```
I would like to determine the number of sequences in which every vertex of the graph is visited. This is supposed to work as follows:
- The starting vertex is fixed
- The next vertex to be visited must be an unvisited neighbor of o... |
It is possible to get a bound of OPT + 0.5C * OPT assuming that the cost of the MST is less or equal than OPT and that the cost of the perfect matching is at most 0.5C * OPT which can done by constructing a tour in the set of odd degree vertices by shortcutting the general optimal tour. |
null |
null |
Intuitionistic logic(s) are usually defined in a purely synthetic way, with their own deduction rules different from classical logic, but they also have semantic interpretations.
One of them, more known in mathematical logic, is Kripke semantics, originated in modal logic, in which a formula is valid iff it holds i... |
Relation between Curry-Howard isomorphism and Kripke semantics for intuitionistic logic |
|logic|type-theory|curry-howard| |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.