instruction
stringlengths
0
29.8k
⌀
What does $O_n(1)$ mean?
|complexity-theory|asymptotics|notation|
null
I'm trying to read the following [article](https://arxiv.org/abs/2010.06554), and in the abstract they write: Let $\xi$ be a non-constant real-valued random variable with finite support, and let $M_n(\xi)$ denote a $n\times n$ random matrix with entries that are independent copies of $\xi$. For $\xi$ which is not unif...
null
In the book "Introduction to the Theory of Computation, 3rd Edition" by Michael Sipser, he provides arguments for why two conditions follow( you can check theorem 2.34). Additionally, he mentions these arguments in his online lectures, which can be found here: https://www.youtube.com/watch?v=IycOPFmEQk8. Essent...
null
null
null
null
What does $o_n(1)$ mean?
null
In initializing codebook embeddings, a common practice is to employ random initialization due to its simplicity and effectiveness in various contexts. A widely adopted method among practitioners is to sample values uniformly from a specified range. Specifically, the range is typically chosen to be between $-1/K$​ and $...
I have asked it already on math.stackexchange.com and stackoverflow.com but they said it was off-topic and could not help me. They pointed me to cs.stackexchange.com so hopefully somebody here can help me or atleast point me in the right direction. We have been using a bayesian average on a website of ours for a cou...
Is this bayesian average calculation right?
|algorithms|sorting|
Group theory is used all over the place in quantum computing. Some examples: - The set of reversible quantum logic gates on $n$ qubits is the group $SU(2^n)$. - Some important finite groups of quantum logic gates include the Pauli and Clifford groups which are essential constructs in quantum error correction, and t...
null
Is there an algorithm that would fit in the following situation: I have a sub image A of a larger image, and a set of sub images B that could (but not necessarily) share border with A. Now the algorighm should find likelyhood of A sharing a border with a sub image in B. There may be errors or small gaps between the...
Algorithm to find most likely continuation of image over border from set of possible next images
|image-processing|matching|
Is there an algorithm that would fit in the following situation: I have a sub image A of a larger image, and a set of sub images B that could (but not necessarily) share border with A. Now the algorighm should find likelyhood of A sharing a border with a sub image in B. There may be errors or small gaps between the...
What theoretical concept lies behind the strong restriction of acquire semantics - to reads, and release semantics - to writes? (With papers titles and authors, if possible.) Is it related to provision of correctness of more complex approaches than lock-based synchronization (as lock-free, wait-free algorithms)? ...
null
In Julia Robinson's "General Recursive Functions," she proves that all recursive functions can be obtained using only substitution (composition) and minimization, *provided* the initial functions are extended with additional members. In particular, she uses the two functions: > $S(x, y) = x + y$ > $Q(x) = \begin{case...
Consider vector\<int\> C I aim to calculate $\displaystyle \sum_i i*C[i]$ using some stl library. In there any stl function there to do that?
Calculate sum(position*element) for a vector array in C++
|programming-languages|c++|
I have a directed graph (DAG) containing many nodes, all with various attributes (node attributes not edge attributes). I have a single target (finish) node and a set of source (start) nodes. I want to find a path through this graph that minimizes the sum of all the attributes on said path, and return the top N minimiz...
Path Through Graph That Minimizes Node Attributes
|graphs|network-analysis|network-topology|path|
Given positive function $f(n)$ and $G(n)$, |Operands | Meaning| | -------- | ------- | | $f(n) = O_n(G(n))$ | $\displaystyle \lim_{n\rightarrow \infty} \frac{G(n)}{f(n)} > 0$ | | $f(n) = o_n(G(n))$ | $\displaystyle \lim_{n\rightarrow \infty} \frac{G(n)}{f(n)} = 0$ | | $f(n) = \Theta_n(G(n))$ | $f(n) = O(G...
It's NP-hard with a single source and a single target, and looking for a single path. Reduction from SAT. Let $\phi = C_1 \land C_2$ where $C_1 = x \lor y$ and $C_2 = \neg x \lor y$. See attached picture. There is a path collecting exactly #variables many attributes if and only if $\phi$ is satisfiable. In th...
null
I have been reading this site with a great deal of interest, but I find a lot of it goes over my head. This has made me wish to learn a lot more about algorithms and CS in general. As far as I can tell from my research, there are two main ways of doing this. 1. I can buy a nice thick heavy book and work my way thro...
null
null
Consider the RWM online algorithm as defined in [this Wikipedia article](https://en.wikipedia.org/wiki/Randomized_weighted_majority_algorithm#Randomized_weighted_majority_algorithm_(RWMA)); this version is with multiplicative update. Let us assume that we define our weights as a fraction; that is, $w_i^t = 1 ...
Randomized weighted majority with rational weights
|algorithm-analysis|randomized-algorithms|online-algorithms|
I have a tree, $T$, with $n$ nodes. My goal is to assign a non-zero weight to each node such that the following condition is met: > Upon removing any arbitrary node, the total weight of nodes in each resulting connected component should be equal. Consider the following tree as an example: ``` 1 -- 2 -- -3 -- ...
Seeking a Polynomial Time Algorithm for Balanced Weight Assignment to Nodes in a Tree
|graphs|trees|graph-traversal|
There are a few related posts and papers (see summary below), but they don't quite answer this particular question. This post mostly answers it: 1. For multi-tape TMs, all non-trivial cases are undecidable. 2. For 1-tape TMs, all non-trivial cases with $f(n) \ne O(1)$ and $g(n) = \Omega(n\log n)$ are undecidable...
There are a few related posts and papers (see summary below), but they don't quite answer this particular question. This post mostly answers it: 1. For multi-tape TMs, all non-trivial cases are undecidable. 2. For 1-tape TMs, all non-trivial cases with $f(n) \ne O(1)$ and $g(n) = \Omega(n\log n)$ are undecidable...
null
There's nothing wrong with the formula. It's doing exactly what you told it to do. I suspect you might have a misunderstanding of how to apply the Bayesian average. By setting `$avg_num_reviews` to a huge number like 6264, you've basically told the Bayesian average that you have extremely high confidence that the ...
null
null
We can weight vertices such that the entire tree has a fixed sum of weights; for example, zero. Let us design a recursive procedure that assigns weights to the vertices of a tree $T$ with root $r$ such that the weight of $T$ is zero, and after removing $r$ from $T$, weight of every remaining component is ...
null
Using the idea of @Mahyar, I think there is another way to find a solution to the problem. Given a tree $T= (V, E)$, find a [bipartition](https://en.wikipedia.org/wiki/Bipartite_graph) of $T = (X\sqcup Y, E)$ (using a simple graph traversal). Consider the following weighting function: $$w : \begin{array}[t]{rcl} ...
null
There are a few related posts and papers (see summary below), but they don't quite answer this particular question. Here we mostly answer it: 1. For multi-tape TMs, all non-trivial cases are undecidable. 2. For 1-tape TMs, all non-trivial cases with $f(n) \ne O(1)$ and $g(n) = \Omega(n\log n)$ are undecidable. ...
I'm currently studying the rubik-cube-solving algorithms developed by Kociemba, Korf, and Thistlethwaite and I'm interested in understanding their computational complexities. Could someone please explain or provide the Big O notation for the time complexity of these algorithms? Any insights or resources on this ...
Time Complexity O-Notation for Kociemba, Korf, and Thistlethwaite's Algorithms? (Rubik cube)
|asymptotics|big-o-notation|
I'm currently studying the 3x3x3 rubik-cube-solving algorithms developed by Kociemba, Korf, and Thistlethwaite and I'm interested in understanding their computational complexities. Could someone please explain or provide the Big O notation for the time complexity of these algorithms? Any insights or resources on...
null
Recall that the time complexity of an algorithm is expressed in terms of its input size. The growth rate of this complexity measure is usually expressed in terms of an asymptotic notation such as Big-oh. For a fixed-sized cube, any reasonable algorithm would take a constant amount of time to solve; however, the constan...
The runtime of $0/1$ knapsack problem using dynamic programming is $O(nW)$. Now assume that $W = 2^n$, then the runtime of the above algorithm is $O(n2^n)$, which is not a polynomial runtime in $n$. The runtime of the algorithm depends upon $n$ and $W$.
Using the idea of @Mahyar, I think there is another way to find a solution to the problem. Given a tree $T= (V, E)$, find a [bipartition](https://en.wikipedia.org/wiki/Bipartite_graph) of $T = (X\sqcup Y, E)$ (using a simple graph traversal). Consider the following weighting function: $$w : \begin{array}[t]{rcl} ...
null
In my studies of discrete mathematics, I've learned that a tree graph is inherently bipartite. I'm interested in finding an algorithmic approach to determine its bipartition. It seems to me that Breadth-First Search (BFS) could be a reasonable method for this task. However, I'm struggling with the formal proof of th...
Proving that Breadth-First Search (BFS) results in a bipartition of a tree
|graphs|trees|graph-traversal|breadth-first-search|
Let $r$ be an arbitrary root. Denote by $d(v)$ the distance from $r$ to $v$. As you might know, every edge goes either between vertices of the same layer, ie, vertices of same $d(v)$, or between vertices in consecutive layers. Now, there cannot be an edge going from one vertex in layer $\ell$ to another vertex in...
Given any number $N$ find a positive integer $k$ such that: $N + 12 k$ is a square. And the second case when we add an additional constraint that $k$ must be as small as possible.
What is the computational complexity of the following problem
|algorithms|complexity-theory|
As I understand it, this $o_n(1)$ is meant as the standard “little o” notation (when $v_n$ takes non-zero values, $u_n = o(v_n)$ means $\frac{u_n}{v_n} → 0$), except that because several variables are involved ($n$, $ξ$, $p$), they added the $n$ subscript to clarify that the limit is as $n$ goes to infinity, for fixed ...
null
If we have a finite (directed) graph G, and a set of paths P in G. And assume that there exists and n so that all paths of lengths greater than n have at least one p in P as subpath, how would be find n? Does anyone know a polynomial time algorithm in |G|? For example if we have the graph 1 -> 2 -> 3 -> 4 and ...
How to find smalles n so that all paths of length greater or equal to n include set of paths
|graphs|
If we have a finite (directed) graph G, and a set of paths P in G. And assume that there exists and n so that all paths of lengths greater than n have at least one p in P as subpath, how would be find n? Does anyone know a polynomial time algorithm in |G|? For example if we have the graph 1 -> 2 -> 3 -> 4 and ...
This question is an extension of [this one][1]. Let - $D(V, A)$ be a $k$-partite DAG; - $P = \{ p_k : 1 \leqslant k \leqslant |P| \}$ such that $p_k \cap p_l = \emptyset$, $\forall k,l : k \neq l$, and $\bigcup_{1 \leqslant k \leqslant |P|} p_k = V$ be the set of partitions; - $c_p \in \mathbb{R}^{+}$ be the pro...
Profitable sequence in a $k$-partite DAG
|shortest-path|partitions|dag|topological-ordering|
> In computational complexity theory, decision problems are typically defined as formal languages, and complexity classes are defined as the sets of the formal languages that can be parsed by machines with limited computational power. https://en.wikipedia.org/wiki/Formal_language Can [function problems][1] also b...
I am studying this ERD: [![ER Model from an exercise by Neso Academy][1]][1] The bank and the customer are obviously strong entities because they are a bank and a person. The bank branch is clearly a weak entity because it depends on the bank associated with it. How are a account and a loan not weak entities? Sin...
A variable $x$ in a λ-term is bound, wherever it is contained, as a subterm, of any λ-term of the form $λx·(⋯)$, otherwise it is free. If it is bound, then it is bound to the $λx$ of the smallest such term it is contained in. If the smallest such term be written as $λx·T$, then (by definition) that particular occurrenc...
No, they are not. A C compiler typically compiles to machine code, which is not statically typed. While machine code is not really a programming language, this should be enough to convince you that the language the compiler compiles to doesn't need to be statically typed, or typed at all. Examples: - C compil...
null
I've been reading the [wikipedia article](https://en.wikipedia.org/wiki/Probabilistic_context-free_grammar) about probabilistic context-free grammars (PCFGs), and they state that > PCFGs have application in areas as diverse as natural language processing to the study the structure of RNA molecules and **design of pr...
How are PCFGs used in programming language design?
|formal-grammars|programming-languages|
You're asking what the value of $λx·xy$ as if the expression, itself, were a math problem to somehow be solved. The situation is similar to asking what the value of "4/3" is, as if it were to be treated as the math problem of "divide 4 by 3". However, there's nothing in this that excludes the expression "4/3", itself, ...
Current problem is $\mathrm{NP}$-hard, because directed Hamiltonian path problem can be reduced to the current one. (Taking the same graph with empty set of forbidden paths, or adding some new arcs and making each of them a forbidden path. Hamiltonian path exists if and only if the answer is at least $|G|$.) On the ...
I have a dataset with 1055 samples and 168 features. I want to remove some features in order to train a model on my dataset. The model should output a binary field (either 0 or 1 that is known). Some features are fake, so I want to only keep the relevant features for my training. I think sensibility analysis can he...
There are a few related posts and papers (summarized down below), but they don't quite answer this particular question. Here we mostly answer it. Consider the problem for an arbitrary pair of functions $f$ and $g$. **Theorem 1 (lower bounds).** *For multi-tape TMs, the problem is either trivial or undecidable.* ...
There are a few related posts and papers (summarized down below), but they don't quite answer this particular question. Here we mostly answer it. Consider the problem for an arbitrary pair of functions $f$ and $g$. **Theorem 1 (lower bounds).** *For multi-tape TMs, the problem is either trivial or undecidable.* ...
There are a few related posts and papers (summarized down below), but they don't quite answer this particular question. Here we mostly answer it. Consider the problem for an arbitrary pair of functions $f$ and $g$. **Theorem 1 (lower bounds).** *For multi-tape TMs, the problem is either trivial or undecidable.* ...
My textbook (Saurabh's *Introduction to VLSI Design Flow*) mentions while discussing formal verification that a representation of a Boolean function is said to be canonical if the following holds: > If a representation is canonical, then the two functionally equivalent functions are represented identically. Converse...
What is special about a canonical representation of Boolean functions?
|boolean-algebra|formal-methods|
I have a directed graph (DAG) containing many nodes, all with various attributes (node attributes not edge attributes). I have a single target (finish) node and a set of source (start) nodes. I want to find a path through this graph that minimizes the sum of all the attributes on said path, and return the top N minimiz...
Yes. Two functions with the same representation will be functionally equivalent. The question is whether there can exist a function with two different representations (i.e., two different representations but they are functionally equivalent). Consider $(x \lor x \lor x)$ vs $(x \lor x)$. Those are two different r...
I am not aware of applications in programming language design, and I am a bit skeptical. However, PCFGs *are* useful for generating test cases, for program testing.
I have a directed graph (DAG) containing many nodes, all with various attributes (node attributes not edge attributes). I have a single target (finish) node and a set of source (start) nodes. I want to find a path through this graph that minimizes the sum of all the attributes on said path, and return the top N minimiz...