instruction stringlengths 35 29.1k |
|---|
To prove that a problem $\Pi_2$ is NP-hard one has to:
select a known NP-hard problem $\Pi_1$;
from an arbitrary instance of $\Pi_1$, create an instance of $\Pi_2$ in polynomial-time; and
show that solve $\Pi_1$ with the given instance $\iff$ solve $\Pi_2$ with the created instance.
Now, my question is the followi... |
I need some clarification regarding how the process address space is organized in memory. I went through basic concepts of virtual memory and adress translation and according to the size of the page, it seems that a virtual adress can have its equivalent physical address located anywhere in RAM, it that right ?
I saw t... |
Let's say I have the lambda calculus extended with set! for assignment.
e ::= x
| (lambda x . e)
| (e e)
| (set! x e)
What I would like to do, is walk through a program in this language, and add an annotation to each lambda expression denoting all of the assigned variables in it.
So for example, we could p... |
Is it true that for all DFA that if $A$ is an accepting state and $B$ is not, that $B$ is always distinguishable from $A$.
I don't think it's true, just because I think I can create a DFA.
$B$ reads b -> $A$
$A$ reads b -> $A$
If you start at $B$ while reading a b and at $A$ you read a b you end up in the accepting sta... |
I have a set of $n = $ 100 million strings of length $l = 20$, and for each string in the set, I would like to find all the other strings in the set with Levenshtein distance $\le d = 4$ from that string. The Levenshtein distance (also called the edit distance) between two strings is the number of insertions, deletion... |
I have asked few days ago this question. Now I am simplifying the problem a little bit.
Given two sets $A=\{a_1,\ldots,a_n\}$, and $B=\{b_1,\ldots,b_n\}$ of non-negative integers, a positive integer $k<n$ and a positive integer $\Delta$. The question is: is there a subset of $S$ of $\{1,\ldots,n\}$ of size $|S|\leq k$ ... |
I'm trying to build a grammar that violate only the 3rd rule. I'm trying to figure out what kind of grammar would not respect that.
I think the grammar has to be left-recursive to not respect it.
if $\beta \Rightarrow^* \epsilon$ then $\alpha$ does not derive any string beginning with a terminal in $\mathop {FOLLOW}(A)... |
I have a deterministic function $f(x_1, x_2, ..., x_n)$ that takes $n$ arguments.
Given a set of arguments $X = (x_i)$, I can compute $U_X = \{ i \in [1, n] : x_i \text{ was read during the evaluation of } f(X) \}$
Would it be valid to use the set $K_X = \{(i, x_i): i \in U_X\}$ as a memoization key for $f(X)$?
In part... |
As the title of the question suggests, let $x$ and $y$ be two adjacent vertices in the cycle $C_5$. How many $(x, y)$-paths of length $20$ are there?
|
Consider the following inequalities:
$\sum_j a_{ij}x_{ij}=1 \;\;\; i=1,...,n$
$\sum_i a_{ij}x_{ij} \le y_i \;\;\; j=1,...,n$
$x_{ij} \ge 0 \;\;\; i,j=1,...,n$
$y_i \in \{0,1,2\} \,\,\,\, i=1,...,n$
$a_{ij}$ are 0-1 coefficient
$x_{ij}$ are unknowns.
$y_i$ are integral unknowns. Each $y_i$ can only take on integer val... |
I am currently attempting to work out the number of comparisons that is done by insertion sort when the elements are already in sorted pairs, for example
$$4,5,22,23,1,2,19,20, \dots$$
Currently working to solve for the worst and average case number of comparisons done when a sentinel is used.
For worst case where each... |
While defining the following time hierarchy theorem (for deterministic case ) :
If $f(n)\log{f(n)}=o(g(n))$ then there are languages decidable in $O(g(n))$ which cannot be decided in $O(f(n))$
The $\log$ factor comes due to the overhead of simulation by universal Turing machine, as the universal Turing machine has on... |
I was asked the following question:
Consider the language $S^*$, where $S = \{ab, ba\}$, write out all the words that have seven or fewer letters?
How do I go about calculating the number of words? Are there any resources that break this down to the most basic level?
|
I would be surprised if this isn't a well-studied problem, but I'm not sure what else to search for at this point: you're given a set of binary $n$-vectors $S \subset \{0,1\}^n$. The problem is to find another set of binary $n$-vectors $B \subset \{0,1\}^n$, with minimal size $|B|$, such that every vector in $S$ can be... |
I'll start with the definitions:Let $S = s_1s_2...s_n$ be a sequence of $n$ integers. A double increasing subsequence of $S$ is a sequence $P=p_1p_2...p_k$ (not necessarily continuous) where for each $2<i\leq k$ we have $p_{i-2} < p_i$. For example, if $S = 1 \space 4\space 2\space 7\space 1\space 6$, a possible double... |
In other words: is a homomorphism always guaranteed to exist between two arbitrary regular languages? If not (which I suspect), are there only a finite number of classes of languages, for which we can find a homomorphisms? And if not that, are there maybe a finite number of families of homomorphisms which divide all re... |
I have a weighted, undirected graph, $\mathcal{G}=(\mathcal{V}, \mathcal{E}, \mathcal{W})$. Let say that the edge connectivity value of my graph is $\lambda(\mathcal{G})=\alpha$.
$\lambda(\mathcal{G})=\min \lambda(u,v) \ \forall \ u,v \in \mathcal{V}$
$\lambda(u,v)=\min \sum_{i=1}^{n} w_{ij}\delta_{ij}$
$\delta_{ij}... |
$\lambda M_{ac}$ = family of languages generated by matrix grammar with appearance checking and with erasing rules
$\lambda M$ = family of languages generated by matrix grammar without appearance checking and with erasing rules
$M_{ac}$ = family of languages generated by matrix grammar with appearance checking and with... |
Is there an intuitive meaning of XOR of two numbers not involving binary and just decimal? Or is is always converted into binary and then XORed?
|
Let square denote a concatenation of two identical, nonempty
strings. Given a string $w$, devise an $O(|w|)$
algorithm that counts the number of prefixes of $w$ that are squares.
My initial idea was to use the prefix function $P$ from the Morris-Pratt algorithm ($P[i]$ is the length of the longest proper prefix o... |
I am learning about the Conflict Driven Clause Learning method to solve SAT problems. In this method it is possible to learn clauses and add these in the set of the initial clauses. I understand a learned clause as the negation of a conjunction of clauses such that these make a formula false (conflict).
I have thinkin... |
I want to verify if I am correct in my interpretation of the $\mathrm{NC}^i$ model.
In this model the input is given to at most $O(n^k)$ processors and each processor takes at most $O(\log^i n)$ time to arrive at a solution.
Can the processors communicate on any intermediate data?
How is the result whether accept or re... |
I was asked this question a while ago and I'm very stuck:
You have a sequence of 0's and 1's, and you can perform one operation it: removing at least $K$ consecutive 0's or $K$ consecutive 1's from the sequence. After performing one of these operations, the ends of the sequence that are on the sides of the removed por... |
A deterministic universal Turing machine $U_D$ can simulate a deterministic turing machine $M_D$ in $O(T(n)log(T(n)))$ where $M_D$ runs in $O(T(n))$. But I came across an exercise in Sanjeev Arora and Boaz Barak that a non-deterministic universal Turing machine $U_{ND}$ can simulate a non deterministic Turing machine $... |
I want to know whether Post Correspondence Problem (PCP) is recognizable. I learnt how to demonstrate the undecidability of PCP. I thought to use the similar approach for recognizability too i.e. to considering MPCP and show whether it is recognizable. I am not sure if it is a good approach.
|
Suppose I have $N$ sets $S_1,\dots,S_N$ each with elements from set $\{1,\dots,M\}$.
1.) What is a good algorithm to find $S_1\cap\dots\cap S_N$?
2.) I am also looking for a good parallel and a good distributed algorithm.
|
I'm wondering if choosing K in the Nearest Neighbors Classifier can be stated as model selection, since the computational complexity is getting higher, the higher K is.
My understanding is: since the complexity increases it means, that K is a hyper parameter.
Am I getting the concept of hyper parameters correctly?
|
Which functions performed by the brain equal which parts/functions of a computer? For example, human memories are like data saved to a hard drive?
|
We have a Directed Graph with 100 vertexes. v1 --> v2 --> ... v100 and all edges weights is equal to 1. we want to used bellman-ford for finding all shortest paths from v1 to other vertexes. this algorithm in each step check all edges in arbitrary order. if in each step the shortest distance v1 to all others vertexes i... |
I am training a problem such that my output (y) could be more than one class. For example, the SVM could say, this input vector is class 1, but it could also say, this input vector is classes 1 AND 5. This is not the same as a multiclass SVM problem, where the output could be ONE of multiple classes. My output could be... |
In my CS computer organization textbook, there's this blurb on the advantage of assembly over a high-level language.
Another major advantage of assembly language is the ability to exploit specialized instructions - for example, string copy or pattern-matching instructions. Compilers, in most cases, cannot determine th... |
I'm trying to reconcile the differences/similarities between regular expression from formal language theory and automata, and the "regex" offered by programming languages.
These two differ not just in "syntax" (the union + in regular expressions means | in regex, and there's no such meta-character as . in regular expre... |
Why ternary computers like Setun didn't become popular despite being cheaper and more reliable than binary computers, and also having important computational advantages? We could have had cheaper computers for everyone.
Edit: The answers to question about binary system do not resolve my question, since Setun, as I unde... |
I've read in many papers on higher-dimensional nearest neighbor search that KD-Trees are exponential in K, but I can't seem to determine why.
What I'm looking for is a solid runtime-complexity analysis which explains this aspect of the problem.
|
Do operators in the Scheme programming language have associativity. For example, the code (- 5 2 1) evaluates to 2, but it could evaluate to 4 if it was evaluated right-associative. However, it is unambiguous if you were to write the expression as (- (- 5 2) 1). The first example, however, leads me to believe that Sche... |
In general, what is the difference between a function and a procedure when talking about programming languages?
|
I've got a question that asks me to explain how if a language L is regular, then so is:
$M=\{s \in \{a, b\}^* |\ \exists\ t \in L\ such\ that\ |s|_a = |t|_a\}$
I believe I would have to get M into the form: $M=\{a^i |\ i\geq0\}$ since we know that any equation of that form is regular, but I'm not quite sure how to go a... |
Is the random forests algorithm Turing-complete? As in, can any algorithm be represented by a given "tree" in the forest?
|
I was reading the proof that for every arithmetic circuit of size $s$ and depth $d$ we can find a circuit $D$ of size $\mathcal{O}(s)$ and depth $\mathcal{O}(d)$. I do not understand what is meant when we say that we can construct a circuit which 'simultaneously computes' all partial derivatives of a function. Does sim... |
Can somebody please help me understand ways I can attempt to find two functions f(x) and g(x) in which f(x) is in big O of g(x) but not big theta of g(x). I get that this is asking me to prove that f(x) isn't in big omega of g(x) but I really don't know where to start with this one. I tried to look for scenerios where ... |
I want to be able to represent a set of operations in sequential order such that they will represent what is traditionally called a "function" (which is not always the mathematical definition of a "function"). However, I'm trying to define more primitive terms:
object - Anything that can be manipulated throughout the ... |
The following is an exercise which I am stuck at ( source: Sanjeev Arora and Boaz Barak; its not homework ) :
Show that there is an oracle $A$ and a language $L \in NP^A$ such that $L$ is not polynomial-time reducible to 3SAT even when the machine computing the reduction is allowed access to $A$.
What I tried was, t... |
Given a linear equation system of $n$ equations with unknowns $a_1,a_2,...,a_n\in [0,1]$, where the left hand side of each equation consists of not more than $k$ variables (so there are at least $n-k$ zero terms in each matrix row), what is the fastest way (in terms of time complexity) to solve such a system.
I know th... |
I stumbled upon this file on scribd, which gave some interesting problems on constructing DFA. So I went on solving them, until I came across one for which result DFA is not drawn but are described in words and I feel the description is incorrect.
The first language reads like this:
$L_1=\{w:(n_a(w)–n_b(w)) \text{mod ... |
I have been practicing with some Machine Learning algorithms for OCR, but I have a doubt about the glyph concept. For example in the UCI repository:
https://archive.ics.uci.edu/ml/machine-learning-databases/letter-recognition/letter-recognition.names
where it says:
4. Relevant Information:
The objective is to ident... |
Let $\mathbf{X}$ be a $n \times n$ matrix. Given that we can only keep $k$ rows ($k << n$) or columns of the matrix in memory, how can we compute $\mathbf{X}^T \mathbf{X}$ while minimizing the number of disk accesses?
Are there known algorithms for this problem? I searched for external matrix multiplication etc. but c... |
Let $C$ be a linear code with minimum distance $2k$. I want to show that there is a coset of $C$ that contains at least two vectors of weight $k$.
Firstly, it holds that the minimum distance of the code is equal to the lowest non-zero weight of a codeword. So this means that the weights of the codewords are greater tha... |
I'm trying to decide on what algorithm I should use for my machine learning project. I need Turing-completeness. What supervised learning algorithms are Turing-complete? Of those, what are the best?
Thanks
|
So each matrix has $N^{2}$ elements, and so just by comparing each element we would be doing $O(N^{2})$ operations. Is there any other way to compare these two matrices such that the number of operations is less than $O(N^{2})$ or is the matrix comparison lower bound also $\Omega(N^2)$?
|
If I'm given 2 unsorted arrays A and B of n distinct integers and an integer z, how can I determine if there exists an integer in A and an integer in B that add up to z with an expected run time of O(n)?
I'm pretty sure that I would have to use a hash table(s) of some sort since I'm dealing with expected run time but ... |
I understand that the length of y must be greater than 0 but I do not understand how to show B_2 is a regular language or why pumping up does not work in part ii.
|
I understand that the following nested for-loop:
for(i=0; i<n/2; i++)
for(j=0; j<n/2; j++)
print(j)
has the runtime complexity of
which has a simplifed complexity of
but what is the resulting complexity of making j bound to i/2 in the inner loop? For instance:
for(i=0; i<n/2; i++)
for(j=0; j<i/2; ... |
Given multiset of integers $a_1,\dots,a_{m}$ where $|a_i|\leq\log^cm$ for some $c\in\Bbb R^+$. Is it $\mathsf{NP}$-complete to decide if there is a cardinality $\lceil m^\alpha\rceil$ submultiset for some $\alpha\in(0,1)$ whose sum is $0$?
How many submultisets of such cardinality can we expect to have vanishing sum?
|
Let $L = \{ w^m \mid m = 2k +1, k \ge 1 \}$. Please give some idea to write a Context sensitive grammar for $L$. Will it be like $L' = \{www \mid w \in \{a, b\}^*$? Then for each $w$ we have to introduce one nonterminal?
|
I came across the notion of topology and topological distance in the context of image processing several times (especially when it came to mathematical morphology). I looked for a not too abstract explanation of "topological distance" but haven't found one yet. Can you please explain (in layaman's terms) the notion of ... |
Question: Suppose you have a finite state machine that accepts only strings with an equal number of zeros and ones. Show that you can then construct a finite state machine that accepts only strings of the form 0^n 1^n, i.e., an arbitrary finite number of zeros followed by the same number of ones.
My attempt at a respon... |
In implicit complexity theory we construct languages that characterize what can be computed in various complexity classes. One major result is Bellantoni and Cook where they show that $FP$ can be characterized by such a language (called system $B$).
I have the following beliefs about system $B$
System B can encode al... |
Problem:
We'll define a binary tree as a tree where the degree of every internal node is exactly 3. Show that the set of all binary trees is countable.
My attempt:
A set is countable if it is finite or there is a one-to-one correspondence with the natural numbers. So we need to show that a strategy for an enumeratio... |
Let $S\subseteq \{0,1\}^n$, $S$ is a $(n,k)$-universal set if for every subset of indices $I$ of size $k$, projecting $S$ to $I$ yield the $2^k$ binary strings (all the possible strings of $I$). $S$ is of minimum size if there is no other $(n,k)$-universal set $S'$ where $|S'|<|S|$.
is there a known algorithm to const... |
I recently began working as a tutor with my college, helping younger students struggling in intro classes get their footing.
Many of my students particularly struggle with basic data structures (linked lists, heaps, binary [search] trees, hash tables, etc.); I'll call them DS's for short. I can often explain a DS where... |
Let's say we have a tree like this:
Suppose we are given $N$ distinct elements, $N$ being the number of vertices in the tree (in this case, $N=13$).
In how many ways can we distribute the given $N$ elements in the tree so that it has the max-heap property (any vertex is larger than its children)?
|
Let's say I have a closed walk $W$ in a directed graph $D$. Represent $W$ as a list of arcs $(a_1, a_2, \dots, a_k)$. Since it's a closed walk, there may be repeated edges, but the source vertex of $a_1$ must equal the target vertex of $a_k$. My claim is that the multiset of arcs $W'=\{a_1, a_2, \dots, a_k\}$ can be pa... |
A problem $\Pi$ is NP-hard if I can prove this:
a known NP-hard problem $\Pi'$ reduces to $\Pi$ in polynomial time; and
$f(x) \in \Pi\iff$ $x \in \Pi'$.
If I can show only one way implication, that is $f(x) \in \Pi\Rightarrow$ $x \in \Pi'$. Is this reduction known, correct and why?
For me it is correct because, if... |
$S \rightarrow Sa \mid S \mid \epsilon$
This is a weird case where I have only one non-terminal. I'm trying to apply the algorithm 4.19 in the dragon book. It don't think it should be applicable but I think it gives something like that :
$S \rightarrow S'$
$S' \rightarrow aS \mid S' \mid \epsilon $
but this is equivale... |
Suppose we have a TM $M$ with alphabet $\{0, 1 \}$ with n states. Say $M$ halts in standard position if it is scanning the left-most $1$ of a non-broken string of $1$s (and everything else on the tape is $0$.
Suppose the tape is initially consists of a bunch of $1$s, a $0$, a bunch of $1$s, a $0$, and so on for a finit... |
Question:
Let language $E$ = {$\langle M \rangle$ | $M$ accepts no inputs whatsoever}
Let language $H$ = { $\langle M \rangle$ | $M$ halts on an empty string input}.
Is it possible to show that $H$ is undecidable by reducing $E$ to it? (You can take it as a given that we know $E$ to be undecidable.) If so, show the wor... |
What is the output distribution of a GI/M/1 (general input process and exponential service times) queue.
The GI/M/1 is according to Kendall's notation: arrivals are independent but we do not know the distribution of intervals, service time follows an exponential distribution, and there is only one server.
For the M/M... |
What are the major approaches in implementing a Knowledge-based System (KBS)? Approaches used to take decisions in a KBS that I have come across so far are the case-based and rule-based reasoning approaches. I would like know about other approaches and implementations. I would appreciate any recommendation about helpfu... |
I wrote a simple stack based language, and am looking to exhaustively generate all programs for it, to find the shortest program that generates a particular output.
Given a program fragment, I can determine if it is terminated, and, if not, how many operands it requires. Currently, my search strategy is:
If program i... |
As the number of Turing Machines is countably, we can create some list of them and number them 1, 2, 3,... Suppose turing machine k
computes some function $f_k$.
Is there a turing machine S
that can computer $f_k(k)$?
It seems like there should be, as I am fairly confident that you can write such a program in a turi... |
When do we say that a artificial neural network is a multilayer Perceptron?
And when do we say that a artificial neural network is a multilayer?
Is the term perceptron related to learning rule to update the weights?
Or It is related to neuron units?
|
$$(abst) \:\frac{\Gamma, x: t_1 \vdash t_2: t_3 \quad \Gamma \vdash (x: t_1) \to t_3: s}{\Gamma \vdash (x: t_1. t_2): (x: t_1) \to t_3}$$
In this rule, why is $(x: t_1) \to t_3$ required to be an inhabitant of some sort? Isn't assuming $t_1: s$ enough?
|
I am trying to find reasonable algorithm for 3D grpah visualization. So far I've been using Force directed graph with octree for optimization. But the speed of computation is very bad.
My dataset is network traffic record and consists of thousands of nodes that are randomly distributed within it, so nodes that are conn... |
A computer has 2 GB of RAM of which the operating system occupies 256 MB. The processes
are all 128 MB (for simplicity) and have the same characteristics. If the goal is 99% CPU
utilization, what is the maximum I/O wait that can be tolerated?
My professor said that there are 14 processes in the memory before proceedi... |
I have to write a grammar for the following language:
$$\{1^{n^2} \mid n\geq 1 \}$$
I am having trouble figuring out the production rules. I was thinking of using the fact that $n^2$ can be written as the sum of first $n$ odd numbers but couldn't proceed any further.
|
Let's define the two variants of the Travelling salesman problem:
$TSP_{opt}$ : Give me the shortest tour
$TSP_{dec}$ : Is there a tour of $l$ or shorter (Yes/No)
Now assume $P \neq NP$:
Since $TSP_{dec}$ is NP-complete, there is no polynomial time algorithm to solve it. Now given a solution to
$TSP_{opt}$ with optima... |
I'm not a scientist nor am I math savvy, but I'd like to know what the feasibility would be of solving a shallow water flow equation using massive parallelization. CUDA and stuff like that.
Im referring to this paper: http://www.3di.nu/wp/wp-content/uploads/2014/03/Stelling_ice_2012.pdf
Would such an algorithm be suit... |
Early note: This is not homework. I simply regularly create ideas in an attempt to teach myself a language. For what it's worth I'll be using Javascript for this.
That said, I haven't been able to come up with a solution/algorithm outside of brute force. I've searched for various puzzle algorithms but any assumption... |
x and y are 4 bit signed numbers (2s complement..)
x - y can be obtained by:
!(!x + y)
I know that in 2s complement
-y = (!y + 1)
So I can pretty much understand how this works:
x - y = x + (!y + 1)
But, what sort of magic is going on in here, how does this work:
!(!x + y)
I mean, when I do the math with pen and ... |
I have a problem that smells like it is NP-complete, but at the same time it feels like maybe you can solve it by just keeping track of column-wise Hamming distance or something, or that it's equivalent to some spanning tree-like problem. The problem is as follows.
We have some binary matrix $M \in \mathbb{F}_2^{n\time... |
I was not able to find a similar question in the archives, so pardon this relatively elementary question if it has been asked before.
Let $E_n$ be some event that depends on the sample size $n$ and suppose we are looking for an upper bound on $n$ that guarantees $Pr(E_n)\geq 1-\varepsilon$ for some $\varepsilon\in(0,1)... |
Suppose that I have a polynomial-time algorithm to solve the graph embeddability problem.
$k$-embeddability problem :
Given an edge-weighted and undirected graph $G = (V,E)$, can we assign coordinates to each $v \in V$ in $k$-dimensions such that Euclidean distance between $u,v \in V$ is equal to the weight of the edge... |
I was trying to come up with a case where one would need rebalance the following case in an AVL tree:
I think that case impossible to happen during an insert. It seems to me that its impossible to get to case 2 with only inserts (might be possible with deletes) since to get to that state we need B and C to have the sa... |
I was studying AVL trees and was wondering if the only reason one propagates upwards to the node in an insert is to change the height. It seems to me that rebalancing does not recursively propagate back with only inserts but one might have to go back to change heights (since only nodes on the path from insertion point ... |
For a school project, I'm planning to compare Spiking Neural Networks (SNNs) and Deep Learning recurrent neural networks, such as Long Short Term Memory (LSTMs) networks in learning a time-series. I would like to show some case where SNNs surpass LSTMs. Consequently, what are the limitations of LSTMs? Are they robust t... |
Recall the standard argument for showing an AVL free is of size $\log n$:
Let $n_h = $ be the minimum number of nodes of an AVL tree of height
$h$. Then we have:
$$ n_{h} \geq 1 + n_{h-1} + n_{h-2} \implies n_h > 2n_{h-2}$$ $$ n_h > 2^{\frac{h}{2} } \implies h < 2 \log n_h $$
so the height of the tree is $O( \log n)... |
In dependent-types, Miller pattern unification is used to solve a decidable fragment of higher-order unification. This allows dependently-typed languages to contain metavariables or implicit arguments.
There are many papers which describe, given a unification problem in the pattern fragment, how to find a solution if o... |
I have a background in physics and have taken some few classes online in Machine learning. But I really do not understand how this Robot lawyer can work:
A 19-year-old made a free robot lawyer that has appealed $3 million in parking tickets
I am very interested in this type of artificial intelligence but I have no id... |
I'm trying to show that for every frequency vector $(p_1, p_2, p_3, p_4)$ such that $\sum_{i=1}^4 p_i=1$, the average word length outputted by Huffman algorithm is bounded at 2: If $(w_1,w_2,w_3,w_4)$ is the outputted code, then $\sum_{i=1}^4 p_i |w_i| \le 2$.
I've tried looking at the tree that is generated by Huffman... |
I am making a game in Unity3d and I need a pathfinding algorithm that can guide enemies towards the player on a 3d surface. The problem is that the 3d surface can take any shape, so it can be a 3d sphere, cube, torus and many more shapes.
I tried using A* but for that formula I need the distance between the two points,... |
I want to know if this problem is NP-hard?
The problem: Given a non-negative integer-valued matrix of size $3\times n$ of the form
$$
\begin{bmatrix}
a_1 & \ldots & a_n\\
b_1 & \ldots & b_n\\
a_1b_1 & \ldots & a_nb_n\\
\end{bmatrix},
$$
where $a_i,b_i$ are non-negative integers. Given four non-negative integer number... |
I mathematically understand $f(n) \in O(g(n))$ : $f(n)$ does not grow faster than $g(n)$. More formally, $\exists c, n_0$ s.t. $f(n) \leq cg(n) \forall n \geq n_0$.
Similarly, $f(n) \in \Theta(g(n))$ means that $f(n)$ grows approximately as fast as $g(n)$. i.e. $f(n) \in O(g(n)), \Omega(g(n))$.
What I don't get is why... |
Is there an algorithm to find the minimum set of edges required from a new node in order to make a disconnected directed graph initial?
Example -
input:
a -> b;
b -> c;
b -> d;
e -> f;
f -> g;
output:
n -> a;
n -> e;
Result:
Thanks!
|
Given a non-negative function on the hypercube $f : \{0,1\}^n \rightarrow \mathbb{R}_{\geq 0}$ one says that it is of "SOS-degree" of $d$ (denoted as $deg_{SOS}(f) =d$) if $d$ is the minimum $k$ such that one can find some finite number (say $p$) of polynomials on the hypercube $g_i : \{0,1\}^n \rightarrow \mathbb{R}$ ... |
MY question is about storage complexity of a suffix array. According to textbooks it is O(n) with an exact cost that approximates 4n. However a suffix array of a string of length n is an n-size integer array, along an index that maps each substring to the appropriate position of the array. This index has size $1+2+..+n... |
I am in a class that is going over NFAs. The way they are described is a set of states, one of which is the start state, zero or more are accept states, and one or more transitions between them, which consume a symbol of the language or a lambda transition which does not consume a symbol from the string.
One thing that... |
I am trying to justify the big-O order of a runtime complexity by finding a $c$ and $n_0$ that hold for it. Does the left side of the justification need to be one or higher, or can it be any value so long as it is a real number and less than the right side? For instance, is the following valid:
$$n^2/4 + 1/2 \leq c\cdo... |
I have liner programme with set of $x_{3n}$ variables where $x_{ij}$ are {0,1}. I am solving this linear programme using LP-Solve.
Using these variables, I want to form following constraint :
$max(x_1 , x_2.., x_n) + max(x_{n+1} , x_{n+2}.. , x_{2n}) + max(x_{2n+1} , x_{2n+2}..., x_{3n}) >= q$
Constraint is :
Sum of m... |
To my understanding, the notion of Turing-computability of a partial map $ℕ_0 \dashrightarrow ℕ_0$ depends on the encoding of $ℕ_0$.
Say $Σ$ is an alphabet and $γ \colon Σ^\ast → ℕ_0$ is a bijection. A partial map $f\colon ℕ_0 \dashrightarrow ℕ_0$ is then called computable with respect to $γ$ if its conjugation $γ^{-1}... |
I want to create a matrix where each entry itself is a random matrix.
What would be a good way to represent this?
It is not necessary but some hints on how to implement your proposed solution in Python would be useful.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.