instruction stringlengths 35 29.1k |
|---|
Given an undirected weighted graph $G = (V, \{E,F\})$, how to find the shortest walk that passes through all edges $e \in E$ exactly once?
I'd like to know if there is a general approach to this problem. However, additional constraint may be added for my specific scenario.
The graph $G_0 = (V, E)$ initially has only e... |
My definition says
A clique is a graph that has an edge connecting every pair of vertices
but as I understand, an edge connects only two vertices. Like $A-B$.
If we want to connect three vertices, we need at least two edges. For example, $A-B-C$.
I don't understand how an edge can connect every pair of vertices.
|
How can I prove that this language isn't regular using the pumping lemma for regular language?
$$L = \{a^nb^m| n,m > 0, \gcd(n,m)=1\}$$
I've already checked this answer: Proof that a language involving $gcd$ is not context-free but don't understand this part.
"Let s' be $a^{(n+ik)}b^m \ with \ k \geq 1$. Then s' e L if... |
I have a constraint in a linear programming formulation with two variables: $X \ge Y$
To which I want to apply the following if-else conditions:
if Y=1:
X=1
else:
X=0
Where $X$ and $Y$ are binary.
How can I fit this if-else into linear programming? Do I need to define another variable? It looks as an AND opera... |
Disclaimer: I'm not a CS so I basically have no idea what I'm talking about
I have a large (>1000) set of directed acyclic graphs with a large (>1000) set of vertices each; the vertices are labeled.
I want to identify substructures that appear frequently over the whole set of graphs.
A substructure is a graph of at le... |
How can I construct -- or better to say what type of circuit can be like this -- a circuit that takes 3 binary numbers (a, b, c) and then calculates two binary numbers (d, e) in a way that a + b + c = d + e The circuit should be of constant depth and furthermore, a, b, c, d, and e are as follows;
a=a_n−1…a_0
b=b_n−1…b_... |
So, $G$ is a connected claw free graph. How can i prove that if $M$ is a maximum matching in $G$ then $M$ exposes $at$ $most$ one vertex of $G$ ?
Any ideas ?
|
The R-Tree creates 'rectangles' to index 2D data. How is their size calculated exactly? What happens to the performance by changing this parameter i.e. the size of this rectangle/MBR? Number of overlaps, area covered change but can this speed up some kind of queries or build a smaller index?
|
I wish to calculate the number of nodes within a certain distance of a particular node in a tree such as the one below:
Let's assume I'm looking for all the distances to node 2. What would be the most efficient (in terms of time complexity) method of computing the distances? Can it be done in linear time?
For this ins... |
I was given the following algorithm:
PARTITION(A,p,r)
x <- A[p]
i <- p
j <- r
repeat
while A[i]<x
do i<-i+1
while A[j]>x
do j<-j-1
if i <= j
then exchange A[i] <-> A[j]
until i>j
return i,j
quicksort(A, p, r):
if p<r
then i,j <- PARTITION(A,p,r)
QUICKSORT(A, p, j)
QU... |
The problem is to find $C = AB$, where $A$ and $B$ are $n \times n$ matrices that may be sparse. Let $n$ be around 1000. The elements of $A$ and $B$ are real values, though, for practicality's sake, let's say we use floating-point numbers. Ideally, the approach would be fast enough for small $n$ and, of course, should ... |
My question is the following. Assume that $\Pi$ is an NP-hard problem. Given an arbitrary instance $I$ of $\Pi$ and assume that an adversary knows that this instance is easy to solve, is it possible to find a deterministic polynomial-time algorithm to solve this particular instance $I$?
For example: Suppose that $\Pi$ ... |
I'm having a really difficult time understanding the logic behind reduction of the halting problems to other problems in order to prove them undecidable.
Here's my reasoning:
Let's say that we want to find out if the following problem is decidable: given any machine $M$ and a string $y$ find out whether the machine $M$... |
I am reading the classical book "Compilers. Principles, techniques and tools" by Aho et alii. On chapter 9.3 they talk about a general framework to solve data-flow analysis problems that use a framework which is monotone and of finite height.
The technique is shown to be useful for live variable and reaching definitio... |
I need help identifying what algorithm I need to solve a problem. I'm not asking for programming help here, just identifying the algorithm.
Each row of a matrix represents a state. Each element corresponds to the count of how often the current state transitions to another state. Some states are final states and do not ... |
For example: $O(-e^{-x} +1)$. Basically as the size of the input increases, the time it takes to run converges.
|
I do not understand the difference between the All Pairs Shortest Path problem (solved by the Floyd–Warshall algorithm) and the Shortest Path problem (solved by Dijkstra's algorithm).
|
Let there be $N$ positive numbers given as $\lambda_1\geq\dots\geq\lambda_N$. Now I am interested in the following numbers given as $$\alpha_i=\exp(\frac{\lambda_i}{\lambda})$$ for some positive constant $\lambda$. Define the function $\mathcal{S}(..)$ which takes a subset of these numbers (let me call me them as a seq... |
I am preparing for a coding interview and I can't really figure out the most efficient way to solve this problem.
Let's say we have two arrays consisting of numbers that are unsorted. Array 2 contains a number that Array 1 does not. Both arrays have randomly located numbers, not necessarily in the same order or at the ... |
Here is an algorithm to output a subset of activities S such that no activities in S overlap and profit(S) is maximum.
Define $p[i]$ to be the largest index $j$ such that $a_j$ does not overlap $a_i$.
$\#$ Return maximum possible profit from $a_1,...,a_n$
def rec_opt(n):
if n == 0:
return 0
else:
... |
I'm currently working my way through An Efficient Algorithm for the “Stable Roommates” Problem by Robert Irving (Journal of Algorithms, 6:577–595, 1984).
On page 7 the paper starts with describing the algorithm for phase 2. The only thing that phase two does is reducing all-or-nothing cycles. The paper seems to assume... |
Here are two ways to output a subset of activities S such that no activities in S overlap and profit(S) is maximum.
I can't see what's the difference between these two algorithms except the first one use a if statement and the second one use a for loop. They both store result in OPT[n] first.
|
Not sure if this question should be here, or on math.se.
That said, let me proceed:
On the Wikipedia page for the Ackermann function, it is mentioned that by passing the inputs of 0, 1 and 2 to the third parameter one could perform the three fundamental operations of addition, multiplication and exponentiation, respect... |
I want to transform a general rooted, node-labeled tree into a related binary tree. I came up with four different schemes ("left shallow", "right shallow", "left deep" and "right deep" binarization) that are illustrated by an example in the diagram below. They all preserve certain aspects of the original structure. Chi... |
Let $A$ be a collection of strings over the alphabet $\{0,\ldots,m-1\}$ that in total contain $n$ symbols.
Your task is to sort each of the strings internally, and then sort the resulting strings in lexicographic order. (Your algorithm doesn't have to operate this way.)
Example:
Input: 33123 15 1 0 54215 21 12
Output:... |
I am creating a simple program to detect if the given pushdown automaton accepts the given word, and I have a problem in finding an algorithm that does that.
My thought at first would be to go through all possible transitions, and check if we didn't match this word in accepting state, but got in problem with (epsilon,... |
I have a finite collection of finite sets $\{A_i\}_{i \in I}$. There is a relation $R$ defined on the elements of those sets (which is not transitive, it is irreflexive, and it is symetric). Suppose we define a related partial choice as a set $\{a_j\}_{j\in J}$ such that:
$J\subseteq I$
$a_j \in A_j, \forall j \in J... |
I am looking for a recursive algorithm to find the max sum of 2 numbers in an array, and the numbers can't be "neighbours" ( for example $a[0]$ and $a[1]$ or $a[4]$ and $a[5]$, in general $a[i]$ and $a[i+1]$ )
example:
for the array 5 8 3 9 20 1 4,
the result will be 28.
|
Suppose I have a quantum state represented by a Complex vector, arbitrarily:
$[~-0.538, 0.044 - 0.323i, 0.706, 0.044 + 0.323i~]$
With each value in that vector corresponding to some classical state:
$[~ |00\rangle, |01\rangle, |10\rangle, |11\rangle ~]$
What is the correct mathematical formula to derive a probability d... |
I have been given the following implementation of basic list functions in LISP:
nil = (lambda (k) (k ’none ’none))
(cons x y) = (lambda (k) (k x y))
(car l) = (l (lambda (x y) x))
(cdr l) = (l (lambda (x y) y))
(null? l) = (l (lambda (x y) (= x ’none)))
As an intent to show that data can be constructed using only pure... |
This question stems from this question and this answer. I also want to preface this question by stating that this question is done from the perspective of a RAM (or PRAM if it's more accurate term) model.
From the comments in the answer, it seems like when doing algorithm analysis for the solution:
$O(n)$ solution (... |
I understand in open addressing hash tables some clustering will always happen just by random chance, even if the input data is perfectly random, leading to some "best possible" lookup performance hit (for an open addressing scheme).
If the hash function is of low quality, and we use linear or quadratic probing, we may... |
I will soon be starting a part-time job within a start-up and I've been assigned to a project where I'll have to build a CNN that recognizes and counts people in various kinds of videos.
My CEO knows I have no training or experience in Computer Vision and he suggested that I should spend all my working hours in the fir... |
I have been searching on the internet how to multiply a function but I cannot find any. I have only found solution in adding but not in multiplication.
$add(2,3) = s(s(s(add(2,0)))) $
$add(2,3) = s(s(s(I(2))) $
$add(2,3) = s(s(s(2)) $
$add(2,3) = s(s(3)) $
$add(2,3) = s(4) $
$add(2,3) = 5 $
For example, Using the multi... |
I know the difference between deadlock prevention and avoidance. But i want to know the difference between deadlock avoidance and detection. ?
|
I was checking this question and wondered how to apply it to the following language to prove it is in $RE$:
$$ L = \{ \langle M \rangle : \exists P \text{ such that } M \text{ halts on every input } w \text{ within } P(|w|) \text{ steps} \},$$
where $P(x)$ is a polynomial with coefficients $a_1,\ldots,a_n \in \mathbb{... |
I have the following notes that introduce how lambda calculus handles lists. They go as follows:
A list is something we can match on and deconstruct if it is not
empty:
list match{
case Nil => M
case Cons(x,y) => N(x,y)
}
A list value is given by how it interacts with two terms M and N
(1) For starters I don't und... |
Given a DAG $G=(V,E)$, with non-negative weights $ w_e \, \forall e\in E$, we want to modify (increase/decrease) the weights such that:
$\forall u,v\in V$ and $\forall p_1\neq p_2 $ paths from $u$ to $v$, the weights ratio of $p_1$ and $p_1$ is at most 2.
After modifications, the weights are non-negative
The cost of ... |
I am reading Automata Theory book by Hopcroft, Motwani and Ullman 2nd ed.
In this book, there are these sentences:
In general, if we have an algorithm to convert instances of a problem $P_1$ to instances of a problem $P_2$ that have the same answer, then we say that $P_1$ * reduces to *$P_2$. We can use this proof to ... |
I have problem of interpreting Context-free grammar notation in making LL(1) parse table.
To make LL(1) parse table. Two rules are shown below:
If A -> α is a production choice, and there is a derivation α =>* aβ, where a is a token, then add A -> α to the table entry M[A,a].
if A -> α is a production choice and there... |
When was big O first used in computer science and when did it become standard? The Wikipedia page on this cites Knuth, Big Omicron and Big Omega And Big Theta, SIGACT April-June 1976, but the beginning of that paper reads
Most of us have gotten accustomed to the idea of using the notation
$O(f(n))$ to stand for any ... |
I'd like to show that the language DISCONNECTED-SET, defined by $$ \{\langle G, k\rangle | \text{$G$ is an undirected graph that contains a disconnected set of size $k$}\},$$ is NP-complete. (A disconnected set $S$ is defined as a set of vertices such that for every pair of vertices $u,v \in G$, if there is no edge bet... |
Given a dictionary of words, and given a string which is an anagram of concatenation of group of words from the dictionary, is there an efficient algorithm to find valid set of words that can form this string ?
eg1: dict = [ 'dog', 'cat', 'cow' ]
s = 'ocdgatcta'
ans = [ 'cat', 'cat', 'dog' ]
If we join the words in t... |
im having some problems when it comes to Pumping Lemma of Context-free Language ... this is the Language :
$$L = \{a^n b^n c^m | n\ge 0 , 0 \le m \le 2n \}$$
Here is my attemp to prove that the language is not context-free:
Assume $L$ is context-free. Let $p,r>0$ be the pumping length given by the lemma.
Let $z=a^p b^... |
The best approximation algorithm for vertex cover is randomly choosing an edge and removing its vertices (picking the largest degree vertex actually is a worse approximation), but the best approximation algorithm for almost the identical problem of set cover does take the largest set.
How can we explain intuitively wh... |
I know that the formula for the evaluation function in A* Search is given by:
$f(n)=g(n)+h(n)$
I was wondering what would happen if I made h(n) negative. I suppose it doesn't make sense to have path costs that are positive but an estimate that is negative so maybe I shouldn't be asking this question?
However, let's tak... |
I am given a list of processes with their arrival time, CPU, time and Priority. The time quantum is given as 2 seconds. A lower priority number translates to a higher priority.
(process #, arrival time, CPU time, Priority)
-P0: 0, 8, 5
-P1: 2, 2, 4
-P2: 4, 1, 6
-P3: 6, 3, 3
So the priority ranks P3,P1,P0, P4.
would my... |
In the Wikipedia page on P vs. NP problem there is an algorithm that "solves" SUBSET-SUM in case P=NP in polynomial time. (It's idea is to find a TM that gives a certificate). But it gives "yes" in polynomial time and runs forever if the answer is "no". It can be obviously fixed to give "no" in exponential time (just t... |
If I may summarize how I feel about collapse of the polynomial hierarchy:
Are intractable models of computation, including collapse of $\mathbf{PH}$ or $\mathbf{PSPACE}$ above but not down to $\mathbf P$ useful for any reason besides the off chance they might collapse? Obviously "useful" is broad - I would gladly be ... |
A process executing machine instruction Y right after machine instruction x.On executing x It causes a page fault. what is the next instruction that is executed immediately on restarting the process. ? assume that instead of page fault the process receives timer interrupt while executing x. what is the next instruction... |
http://dickgrune.com/Books/PTAPG_1st_Edition/BookBody.pdf
The book by Grune and Jacobs presents an example of a grammar that is $LL(K + 1)$ but not $LL(K)$
The example is $S -> a^kb/a^ka$
The grammar of this type is $LL(K + 1)$ but not $LL(K)$.
I have an example based on the grammar shown. Is this also $LL(2)$ ?
$S-> ... |
Can someone tell me where we use Dynamic/Greedy algorithm and how we trace from the question that it will solved by any one of the above?
Thanks
|
I need to fit a low-degree polynomial $p$ (with $\text{deg}(p) \leq k$) to a function $f$ evaluated on the grid $\{0, 1, ... n-1\}$, so as to minimize the $L_\infty$ norm, i.e. minimize $\text{max}_{0 \leq i < n}{\left| f(i) - p(i) \right|}$.
Now, I know that for $L_2$, this can be solved using a system of linear equat... |
What would be the problem of running the following scala codes assuming we are working with dynamic scoping and a global stack to store environments as some variants of Lisp do?
def fact(n:Int,f:() => Int):Int =
if(n == 0) f()
else fact(n-1,() => n*f())
fact(7,() => 1)
def incrementer(x:Int) = y => y+x
increment... |
I am developing an application, which performs combinatorial function as described below. Could anyone point out a suitable algorithm (or direction)?
== Basic scheme: ==
There are fixed amount of slots (say air tickets), a few hundreds of workers, and a few dozens of jobs. Every time, a bunch of workers (the "crew") ar... |
In Thomas Sudkamp's book, Machine and Languages, there is a depth-first top-down parsing algorithm (please see the algorithm here).
My main question is:
1) Is this algorithm a (backtracking) recursive descent top-down parsing?
This is because I am confused with the difference between the terms depth-first top-down pa... |
A sequence of positive integers $a_1, ..., a_n$ is given. Compute the
length of the largest continuous subsequence such that the number of
even integers is equal to the number of odd integers in the subsequence.
I have thought that we could take all those integers mod 2 and store those in an array, then take two ... |
Intuition suggests that SAT is definitely not sparse. For any well-formed SAT problem $\phi$, we have $(\phi \in SAT) \vee (\neg\phi \in SAT)$, and $\exists \phi : (\phi \in SAT) \wedge (\neg\phi \in SAT)$ (perhaps "many" such $\phi$ satisfy this).
The set of well-formed queries is not sparse, consider $a_1 \wedge \cdo... |
Consider the decision problem Bip[3–1], define as follows:
Instance: $G = (S,T;E)$, bipartite graph, with $d_G(s) = 3$ for all $s \in S$.
Question: Does there exist $S' ⊆ S$ such that in $H = [S'∪T]_G$ we have $d_H(t) = 1$ for all $t \in T$?
I should prove that 3SAT reduces to Bip[3-1].
I understand what the problem... |
My question is, is comparison based sorting problem, in time complexity, a superlinear problem or a sublinear problem?
In more details: we know that sorting using comparison have the achievable lower bound of $O(n\ln n)$ where $n$ is the number of items to be sorted. Now the question of superlinear and sublinear is dep... |
We all the time write and talk about mathematical problems in plain English. For example, we define "the traveling salesman problem". But what is the actual, underlying structure of a "mathematical problem"? Can arbitrary mathematical problems be expressed exactly, in a formal language? Is it meaningful to talk about a... |
The language in question is $L = \{M : M \text{ is a Turing machine that halts in } 100n^2 + 200 \text{ time}\}$.
Attempt 1
Suppose $L$ is decidable. Let $M_1, M_2, \ldots$ be the Turing machines in $L$. Now construct a new Turing machine $M$ that works as follows:
on input of length $n$ run $M_n$ and output the oppos... |
Let $A$ be a randomly generated matrix. Let $I$ be the identity matrix. $\times$ is the matrix multiplication operation, $/$ is matrix division (multiplying the first matrix by the inverse of the second).
$$
I \times A \times A = B
$$
Provide $B$ and $I$ to the recipient. To create encrypted message $E$ from unencrypte... |
I am looking for a data structure to represent non-orientable manifolds (i.e. meshes like Moebius Strip, but without self-intersection). I will then implement other algorithms using this DS such as, but not limited to, Catmull-Clark Subdivision, Offsetting, Minkowski Addition and Minimal Surface. I know that I cannot u... |
I have a constraint $X \ge Y$ in a Linear programming formulation, where both $X$ and $Y$ are binary. I want to check this constraint on a condition like:
if (Y==1)
then check the constraint
else
Don't care about the constraint
How to do it.
|
Given a universal set of elements $\mathbf{U} = \{a_1, a_2, .., a_n\}$, a set $\mathbf{R} = \{a_i\} \subset \mathbf{U}$ where $i ϵ \{1, .., n\}$, a set $\mathbf{P} = \{R_1, .., R_m\}$ and a set $\mathbf{C} = \{P_1, P_2, .., P_l\}$, how do I go about finding a set $\mathbf{S} = \{a_1, .., a_n\} \subset \mathbf{U}$ such ... |
I want to show that for every deterministic pushdown automaton with the language of the empty stack there is a deterministic pushdown automaton that always halts.
my transition function of $P$ is
$\delta: \Gamma \times Q \times \Sigma_\lambda \to \Gamma^* \times Q$
I tried to use look ahead pushdown method. I think I s... |
My understanding of the halting problem in layman's terms is that there is no algorithm which will accept an arbitrary program as input and return true if it halts and false if it does not.
For a Turing machine does the question, "Does this Turing machine halt for all inputs?" always have an answer in the first place?
... |
In a graph, an edge dominating set is a subset D of the edges such that any edge in the graph is either in D, or shares an endpoint with an edge in D.
The Minimum Edge Dominating Set problem is to find an edge dominating set
of minimum cardinality. The decision version of this problem is known to be NP-complete, but I ... |
I was referring to slide 4 of this, which states following:
It is decidable whether a given CFG accepts a non-empty language?
Then I was reading Intro to Automata theory book by Ullman et al. It states following:
Let $L_{ne}$ be the language of all codes for Turing machines that accept atleast one input string.
$... |
The automaton has to recognize the language $(a^n)(b^m)$ so the number of $b$s is at least the number of $a$s and at most twice that number.
The only thing I have achieved is to get an automaton that recognizes
$(a^n)(b^n)$ but that's only part of what I need.
Thanks a lot for your help.
|
I am trying to learn the binary number system but I keep coming up against a barrier to my comprehension. To people who are in the know this will no doubt seem an extremely elementary error so please be kind :). The problem concerns the eighth count. I’m going to explain my reasoning up to that point alongside the cou... |
In traditional bloom filters, each item is hashed some fixed number of locations. One variant of this is to hash items a varying number of locations within the same bloom filter.
This idea is presented in Zhong et al., Optimizing data popularity conscious bloom filters, PODC '08 and Bruck et al., Weighted Bloom filter,... |
I'm currently writing some code to generate binary data. I specifically need to generate 64-bit numbers with a given number of set bits; more precisely, the procedure should take some $0 < n < 64$ and return a pseudo-random 64-bit number with exactly $n$ bits set to $1$, and the rest set to 0.
My current approach invol... |
Design a pushdown automaton that can accept
$$\{w|w\in\{a,b\}^*\text{ and $w$ has twice as many $a$s as $b$s}\} \, .$$
I have a solution as the following. The notation seems to follow "An Introduction to Formal Languages and Automaton" by Peter Linz, where $\delta$ is the transition function with three arguments: cu... |
We have that MIMA (Neumann MInimal MAchine) has the following commands:
I want to implement the Mima-command EQL adr (equal?) with the other Mima-commands.
We have that for that command it holds the following: $$\text{Accu} \leftarrow \left\{\begin{matrix}
-1 , &\text{ Accu }=M(adr)\\
0 , &\text{otherwise}
\end{m... |
In a related post: Algorithm for solving binary quadratic Diophantine equations (BQDE) and its CTC there was a conclusion that with regard to general binary quadratic diophantine equation (with all non-zero coefficients), the solutions (if existent) can be found in exponential time.
However, is this also the case for ... |
Candy Allocation Problem: Suppose there are $n$ candies, each with a weight $w_i$ gram. There are $m$ kids, and each kid needs to eat at least $\omega$ grams of candies to be full. Candies cannot be cut into pieces. Is there a candy allocation algorithm such that at least $k$ kids can be full?
Is the above problem NP-c... |
How can machine learning help extract a Boolean relationship in a given binary input-output data set?
Let us assume that the given data set is exhaustive - ie. it cover all possible input combinations, can we derive the boolean relationship between inputs and outputs? (Say we assume x inputs and 1 output)
Further, if t... |
In Sipser's text, when proving that there exists an oracle $A$ such that $P^A \ne NP^A$, he writes:
Let $M_1, M_2, \ldots$ be a list of all polynomial time oracle TMs.
I understand that there are countably many Turing machines, but aren't there uncountably many oracles?
|
I'm working on trying to make an "entropy pool" that will be fed as input into an RNG (as in, ex, Fortuna). In order to do so, I need to take various collected data and extract as much entropy as possible to turn it into unpredictable bits. I've read many papers about extracting randomness, but I haven't understood how... |
I read in this assembly programming tutorial that 8 bits are used for data while 1 bit is for parity, which is then used for detecting parity error (caused by hardware fault or electrical disturbance).
Is this true?
|
I have an implementation of a data structure I have to study for a group project (Fibonacci heaps if you're interested).
I'm asked to compare the theoretical results of the operations in amortized time, with the running times of my implementation.
Now my question: since amortized times are based on the fact that we loo... |
Let $L = \{\langle M \rangle \mid \text{M is a TM which accepts only the string "010"}\}$. Prove that $L$ is undecidable.
This is my solution, reducing $A_{TM}$ to $L$:
$R(\langle M,w \rangle)$ outputs $M'(x)$, such that:
if $(x == "010")$: run $M$ on $w$ and do on $x$ what $M$ does on $w$
else reject $x$
The langua... |
While doing the current assignment for my formal languages and automata course, I kind of got stuck on exercises involving unary languages (I hope that's the right term), i.e., languages which build upon a single letter. I don't want to ask about the specific exercises, though, but rather about a much more general conj... |
Regarding the last step of the proof of the lower bound of comparison based sorting, there is the following implication for the runtime T in my book:
$T \ge n \log_2 n - n \log_2 e \implies T \in \Omega(n \log_2 n)$
I tried to verify this by proof, is my conclusion correct?
For any real value $x, a$ element of the exte... |
I have to use only bitwise operators to compare two numbers (represented in two's complement), and return $-1$ (represented by all $1$'s) if the numbers aren't equal or return $0$ (represented by all $0$'s) otherwise.
Say $a$ and $b$ are $W$ bits long ($W$ is not necessarily $2^n$). I find it easy to find out if both n... |
According to this source, Chaitin's constant $\Omega$ is normal.
Each halting probability is a normal and transcendental real number that is not computable, which means that there is no algorithm to compute its digits. Indeed, each halting probability is Martin-Löf random, meaning there is not even any algorithm which... |
I'm looking for a formal definition of file that does not only include storage but also abstractions like procfs or /dev/null (or any fuse-based file) that do not relate to storage.
So far I know that all files are abstractions that
can be identified
can have names (usually organized in hierarchical structures)
can be... |
In DFA/NFA the automaton halts when it finishes reading the string.
In a PDA there's the string and the stack. When the string is finished and there are symbols on the stack does it ignore them? Or does it have to pop them?
Or maybe does the behavior depend on whether the PDA is deterministic or not?
Here's an example... |
I have an even number of points, each with coordinates $(x, y, z)$. I need to group these points into pairs. The cost of pairing two points is the Euclidean distance between them. I'd like to find the optimal pairing such that the total cost is minimized. What would be a good way/algorithm to solve this?
For example, i... |
We have that MIMA (Neumann MInimal MAchine) has the following commands:
I want to write a MIMA program that takes the value $2^{23}-24=8.388.584$ to the memory cell $y$.
We have to take attention at the number of the bits, that we need for the representation of the number in two's complement.
I have done the foll... |
Self-organizing maps undergo unsupervised training to produce a low-dimensional, discrete representation of the input space. Why is this useful?
I think the results of the self-organizing map would have to be combined with some other machine learning algorithm or neural net in order to solve problems. Is this the case?... |
Suppose we have a set of equations like this
p7=f(p1+p6); p6=f(p2+p5); p5=f(p3+p4); p4=f(p3); p3=f(p2); p2=f(p1); p1=f()
It can be represented by computational graph below
If each intermediate value takes 1 unit of memory, you need at least 4 units to compute p7 without any duplicate computation.
Is there an algorit... |
Suppose I have a regular rectangular weighted grid with multiple agents and obstacles. Agents cannot be in grid sites that contain obstacles, and for simplicity assume multiple agents can be in the same grid site.
If I select a single location on the grid and want to find the nearest agent to that location, a good solu... |
I am trying to learn the Rice–Shapiro theorem on my own. Here is the theorem:
Let $Γ$ be a set of computable functions such that the set $R_Γ$ is recursively enumerable. We have $f ∈ Γ$ if and only if there exists a finite function $θ ∈ Γ$ such that $θ ⊆ f$.
I will appreciate if anybody helps me to make the theorem c... |
I was wondering whether I can solve the following problem by using a greedy strategy: Let's say that I have a set of containers with 2 dimensions (width and height) and a set of items also with 2 dimensions. Can a solution be found where each item is assigned to a container so that it fits inside? I can have containers... |
I trained an XGBoost model that classifies 50 different classes, therefore it generates a lot of boosters (trees). Also, I wrote a script that turns trained model to C++ code and it works really fast because every tree is simply nested if-else statement. What I noticed is that many trees are similar and I was wondering... |
I am wondering if a constrained insert-only form of Levenshtein distance has been implemented before by someone? In my particular use case, all other operations should not count as they are not possible. Only parts of the strings can be stripped off. As an example, if our library has "Hello" and "complex".
These string... |
I am trying to understand the difference between these two but it looks like as if they are calculated the same way. What is the difference?
R precision:
R precision is the precision at the Rth position in the ranking of results for a query that has R relevant documents.
Precision at K:
Precision at K is calculate f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.