instruction stringlengths 35 29.1k |
|---|
I am currently trying to solve a task with memoization. I have following recursion:
A (i, j) = f( A (i, j-1), A (i-1, j-1), A (i-1, j + 1) )
I am not sure in which order the sub-problems should be solved best, so that multiple calculations are avoided.
Does someone have an idea which order is best?
|
Edit: This question has been reasked on TCS.
We first consider the search version of the subset sum problem: Given a set $S$ of $n$ naturals, find a subset of $S$ that sums to exactly $W$. My question concerns this problem, with an additional restriction on set $S$: For all possible values of $X$, there exists at most... |
Is anybody can help me please to determine is this language is Context-free language or not?
L={wvw | w,v∈{a,b,c}+}
for example:
part of the language: acbac, abcab, bbcbb
not part of the language: abab, aa, abcc
I tried to prove using pumping lemma for context-free languages like that:
I take this word from language w... |
The definition of P is a language that can be decided by a polynomial time algorithm. The definition of P/poly can be taken to mean a language that can be decided by a polynomial-size circuit (see http://pages.cs.wisc.edu/~jyc/02-810notes/lecture09.pdf). Now, why can't a polynomial-sized circuit be simulated in polynom... |
We have n points given as $(x,y)$ coordinates and m triangles given as triples of $(x,y)$ coordinates, and want to count the number of times that one of the points is inside one of the triangles. The triangles may overlap so each point may be counted multiple times.
The naive way is to check each pair of a point and a... |
The idea of a Zeno machine is pretty interesting to me, but I can't seem to find a formal definition for how a Zeno machine would work. I can find a couple of definitions around but they are all about the same (I suspect that everyone is cribbing off of each other) and lack any real formalism. A fairly representative... |
So let's say I have a 4x4 image with 3 channels. So we have 3 4x4 matrices where each matrix represents a channel. Now let's say I also have a 3x3 kernel. I know that for convolution layers, I have to slide the kernel over the image and take the dot product. So for two 3x3 matrices, would I perform matrix multiplicatio... |
I am playing with a simple implicitly typed functional language and have implemented type checking using a Hindley Milner style system. In order to guide code generation, I want to tag each term with its type during type inference.
Of course my language uses lambda expressions and the implicit typing should enable nic... |
First of all, I know there are many questions like this on the site. But I think this case is a bit different.
Consider the following code:
int i, j, k;
for (i = 1; i <= n; i++){
for (j = 1; j <= (n-i); j++) {
System.out.print(" ");
}
for (k = 1; k <= (i-j); k++) {
System.out.print(i);
... |
Background:
I am working with IoT devices which broadcast status messages over a wireless channel periodically and at a rather high rate (500-5000 Hz). Receiving every message is not crucial but the more that are received, the better. I previously had nodes continuously synchronise clocks in order to adhere to a TDMA s... |
I'm searching for good resources on different graph labelling, especially Graceful, Antimagic and Antibandwidth Labelling. Could anyone please help me with that? It will be very much appreciated. Thanks in advance.
|
Let's assume you are in 2D space and you have a set of fix points FIX_POINTS = [(x1, y1), (x2, y2)]. I want to interpolate the y value for a given x value using the provided points as fix points for a piecewise linear interpolation.
Caveat: The x-axis is cyclic, so it wraps around at a certain known value.
I'm searchi... |
Is it possible for a Turing machine with input of a DFA that accepts a finite language and a string to decide whether the string is in the language without "fully simulating" the DFA on the string?
More formally, Is there a TM $M$ with a constant $C_M$ that can decide $L$, where for every input it halts at most $C_M$ s... |
I am trying to solve problem of generation of so called activity-on-edge (activity-on-arc) network graph given based on given activity-on-node network graph.
So, I found this paper proposing an algorithm solving the problem, but I don't really understand the example given on pages 5-6, namely the partition of the graph... |
Let $A$ be a nondeterministic automaton. Let $X(A)$ the set of words for which there at least two accepting paths.
In one of the previous exam, for which no answers are available, it is required to prove that there exist a deterministic automaton whose language is $X(A)$. Furthermore, if the original automaton has $k$ ... |
I am trying to design a greedy algorithm that has to take in multiple factors when making a greedy choice.
Any item has an item weight of Iw and item size of Is, these are both numerical values. Item sizes are originally translated from the values very small, small, medium, large, extra large to .1, .5, 1, 2, 2.5, res... |
Suppose someone finds a polynomial solution to weakly-NP Complete problem does that mean P = NP.
|
I have been looking at the Until operator and the release operator and when introduced to the release operator it was suggested that it is equivalent to:
$\phi R \psi \equiv \neg(\neg\phi U \neg \psi)$
But when trying to get from the semantic definition of the Until operator to the semantic definition of the Release op... |
Recently I've encountered an interesting case of dominating set problem: given an unweighted and undirected graph $G(V, E)$ and knowing that it contains a dominating set of size $k$, find any such dominating set in time $O(2^k\ \vert V \vert\ \vert E \vert)$.
During my research, I found only some algorithms to find fi... |
Suppose we have a token and our language allows the compiler to build two different derivation trees. However, it can happen that there exists two semantic ways to interpret our token. So ambiguity is not a problem in this case.
Am I correct?
|
At the moment I'm trying to understand nested word automatons but I don't get the point quiet right. Let's say I have the alphabet $\Sigma = \{c,r\}$ and I want ot recoginize the languge $\mathcal{L} = \{ \langle c^n r\rangle^n \}$. On slide 14 of this presentation I found the following automaton which should recogni... |
#include <iostream>
int main() {
int arr[10]{10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 9; j++) {
if (arr[j] > arr[j + 1]) {
std::swap(arr[j], arr[j + 1]);
}
}
}
// now the array is sorted!
return 0;
}... |
How would the ALU in a microprocessor differentiate between a signed number, -7 that is denoted by 1111 and an unsigned number 15, also denoted by 1111?
|
What is the particular reason for which we use sparse matrix X in dictionary learning equation Y=DX where Y is the signal matrix, D is dictionary and X is the coefficient matrix?
|
A schedule is called conflict serializable if it can be transformed into a serial schedule by swapping non-conflicting operations. Then,
My question is: Can a schedule be conflict serializable but not serializable?
Please explain why.
|
I am attempting to make a regular grammar over alphabet {a, b, c} where there is at most one c. So far, I have the regular expression ((a|b)*|c)(a|b)* but am unsure where to go from here; my previous attempts have ended up allowing multiple c's.
The solution I has gives (N={s,t}, T={a,b,c}, s, R), s→є, s→as, s→bs, s→ct... |
I was looking at some problems about graphs, and I got stuck on this one. Namely, we have given matrix of size $N \cdot N$ representing the length of the shortest path in undirected graph between some pairs of nodes in the graph $(i,j)$.
We don't have the original graph, we instead only have the all pairs shortest path... |
Given (n) , what is the Count of (x,y) pairs that satisfy the equation x^2+y^2 = n^2.
Is there any way I can re-write this code just without using nested loop?
int counter=0;
int x=0;
for (int i =(int) n-1; i>=0 ; i--){
if(i == x)
break;
for (int j = 1; j< (int)n ; j++){
... |
I found a question in Mathematics Stack Exchange which asks a very similar question
(https://math.stackexchange.com/questions/1023812/hypercomputation-higher-dimensional-variants-of-conways-game-of-life)
It asks whether there are Game of Life models with 3 or more dimensions and if there are Game of Life models relate... |
This question is my best attempt to get at a more general question about what one can get from terms in the lambda calculus.
Using the church encoding, we define booleans by
$\texttt{true} = \lambda x,y.x$ and $\texttt{false} = \lambda x,y.y$
Define the set of terms $Bool = \{\texttt{true}, \texttt{false}\}$, and
let ... |
In labmda calculus, true = $\lambda x,y.x$ and false = $\lambda x,y.y$.
Is there a term $f$ such that for any other term $x$, $f x$ normalizes to true or false BUT $f$ does not have the same output for all inputs?
|
As the title mentioned, how can I judge the searching precision of PSO? Is this depending on the velocity of the particles? I would like to give an example to clarify my question: For a 2-D searching, the precision of grid ergodic searching is the searching step. But what the precision should be using PSO searching. Fr... |
If I have an incoming stream of integers how can I best maintain a sorted list of them? The only way I can think of is to binary search for the position and shifting the remaining elements to the right. This would amount to $O(N + \log N)$ time. Is there a better data structure that can help me achieve the same in bett... |
I have a question regarding the Condensed Nearest Neighbor algorithm from chapter "Nonparametric Methods" in the book Introduction to Machine Learning (OIP), by Ethem Alpaydin, Mit Press, 2004. pp. 174–174.
Ultimately, I am supposed to return the subset Z to be a local minimal subset to use for training set in KNN. Wh... |
(This is HW.) Suppose I have these following proof rules given.
I am currently considering if I can prove the conjunction rule (given below) from the above given Hoare logic rules.
My answer would be "no", because from the proof rules of Hoare logic, I can neither use the Implied rule to prove it (because from $A$ I ... |
Background info
I'm a beginner in ML, let me start there. I'm trying to implement an intelligent system that can route a ticket (in a ticketing system), to the appropriate place based on a few parameters, 5-10.
How the algorithm should work
For example, ticket '1234' gets sent to 'accounting' by human, normally by read... |
I am wondering how to prove that Subgraph Isomorphism is NP Complete. Wikipedia indicates that the CLIQUE problem can be used to demonstrate this, but I can't figure out how. I also found this link that demonstrates how Subgraph Isomorphism reduces to CLIQUE, but I can't figure out how to reverse it. Subgraph isomorp... |
I was wondering whether it is possible to prove $\{a^p \mid p \in \text{Prime} \}$ is a non-regular language without using the pumping lemma. I'm having trouble choosing an alphabet that completes the proof using Myhill-Nerode and figuring out other methods to use generally.
|
Knuth has a neat algorithm that uses matrix exponentiation to compute the $n$th Fibonacci number in $O(\log_2 n)$-time 1. However, there doesn't seem to be a lot of resources on generalizing his idea to other linear recurrences. Is it a generalizable idea, or is it just a special technique only applicable to the Fibona... |
Here I have the method for pumping lemma to prove that a language $L$ is not regular:
Suppose to the contrary that L is regula, then $\exists$ DFA $A$, s.t. $L(A) = L$.
Let $n$ be the number of states in $A$.
So, $\forall w ∈ L(A)$, if $|w| \ge n$, then $w = xyz$,
where $x$, $y$, and $z$ as in Pumping Lemma.
Choose a ... |
I'm trying to understand the motivation behind the idea of order-$k$ (edge) expansion for partitions of a graph, defined below:
For simplicity, let's focus on $d$-regular graphs. The definitions I'm working with are:
The edge expansion of a subset of vertices $S$ is $$\phi(S) = \frac{E(S,V \setminus S)}{d \cdot |S|},$$... |
i have a dataset with movies review. I wish cluster my element but inside i have a
categorical / ordinal values.
i seen that exist:
MCA (Multiple Correspondence Analysis)
https://www.utdallas.edu/~herve/Abdi-MCA2007-pretty.pdf
K-Models
I seen both the implentation in Python but seems not very used. (i seen poor exa... |
If we were to have a connected directed graph that has X edges and Y vertices and all the edge weights are either 1 or 2. Would it be possible to somehow achieve a time complexity of O(X+Y) using Dijkstra's algorithm, when finding the shortest path between the two given vertices A and B from the graph.
|
I know how to identify the parts of the Master Theorem, and I know that it is a recurrence relation. I don't understand how to make the "b" value greater than 1.
Please see the image. I know the math is easy, but I am not seeing it. Can someone help?
|
So we have an unsorted array, we need to find the first $m$ elements in ascending order (or $m$ smallest elements) where $m = \mathrm{array.size}/2$ (or $n/2$). How would we do this in linear $O(n)$ time.
What I was thinking of doing was use the SELECT algorithm to find the kth smallest element until $k = m$, but this ... |
I am not a computer scientist or even a student of CS. I just want to find more information and would like if someone could put if in right direction about how actually computer works. I understand that when we write program in C++, it's been compiled to assembly language and then into machine code. How can all this fu... |
My textbook asks:
Consider the sets of strings on $\{0,1\}$ where the 4th symbol from the right end is different
from the leftmost symbol. Construct an accepting FSA.
The answer it provides is below. However, I don't understand how you can have one transition for 0,1 and another for 1 from the same state. What... |
Assume that we have a data type $stack$ which has two operation $push$ and $pop$, both operations' time complexity is $O(1)$ in worst case. The $stack$ also has a property $size$ indicate how many elements are in the $stack$, and can be accessed in constant time.
I want to emulate a $queue$ by using two stacks $queue =... |
Given a subset $A = \{a_1, a_2, \dots, a_k\}$ of numbers $\{1, 2, \dots, n\}$, find another subset $B = \{b_1, b_2, \dots, b_t\}$ of numbers $\{1, 2, \dots, n\}$ of minimal size (that is, minimise $t$), that every sum of subset of $A$ can be acquired as a sum of some subset of $B$, in time $O\left(2^{\log^2 n}\right)$.... |
I tried to find information about how features of a CRC polynomials influence computation speed of implementations.
It is obvious that (depending from the CPU architecture the algorithm runs on) algorithms can be optimized for special CRC widths.
However, even when comparing CRC polynomials of the same width there sti... |
Define $L=\{\langle D,R \rangle \mid D$ is a DFA, $R$ is a regular expression, $L(D)=L(R) \}$
Is $L$ decidable?
Is $L$ decidable in polynomial time ($L \in P$)?
I am trying to ask: can a TM analyze a DFA encoding to output with a regular expression encoding on its tape and how fast can it be done?
|
I have a US-based telephone number (in the format 000-000-0000) and need to convert it to a "shorter" representation. Using base32/64 produces too long of a string. I've discovered CRC-16, which produces a string of length 4, however, I'm not sure it's a suitable tool for the job (I want to prevent collisions).
Basical... |
Is there any specific (and well known/famous) model/theory that proposes that the universe is an oracle machine?
Physicist Roger Penrose said his book "The Shadows of the Mind"
It would be just as possible, in principle, to have a universe that runs deterministically as an oracle machine as it would to have one that r... |
Let $v$ be a vertex with in-degree 0 in an (acyclic) DAG $G$, and let $F$ be a subset of $G$'s vertices (the "forbidden") vertices. Now suppose $U$ is a set of vertices such that every path from $v$ to $F$ intersects $U$.
Is there a commonly-used term for such sets? I was thinking about using the term "Front", but a (c... |
I recently read the first question and answer in this homework solution https://cseweb.ucsd.edu/classes/sp08/cse105/hw2s.pdf However, I am not sure if for example, you have two accepting states originally, one in which you leave the accepting state if you read 1 and the other in which you do not leave the accepting sta... |
In this set of notes, they claim that there is a size $O(2^{\sqrt n})$ depth-3 circuit (OR -AND -OR) that implements XOR.
I tried for a little bit to figure out how to do this, but couldn't find such a construction. How do you do this?
|
The solution is to find the upper and lower bounds from:
2T(n-2) < T(n) < 2T(n-1) + 10
So I have to find
T(n) > 2T(n-2)
and
T(n) < 2T(n-1) + 10
My question about this solution method is not how to solve those recurrence relations. It's about why this method can be used in the first place. I thought solving a recurr... |
How would you go about solving this problem? Is it something that could be expected to be computed/solved within a couple of hours of given a starting area with (32) threads on 3.0GHz Xeon cores? (Assuming sizes between 8x8 and 30x30. Using C or C++ if that matters) Or, is this so complex that it would take way lon... |
I've tried but I can't figure out any solution. Is there any hint for me to solve the question?
|
The max-flow min-cut theorem guarantees that the min-cut of a directed network equals the maximum flow. And we can compute $S$ and $T$, are disjoint subsets containing source node and sink node respectively from the residual graph.
What will be $S$ and $T$ if the max-flow from source to sink is 0, that is, there is no ... |
I'm working on a school assignment which is defined as a variant of the longest common subsequence problem and which is presented in the context of dynamic programming.
The problem is defined as follows:
suppose that you are making a spell-checker with suggestions for misspelled words. You would like to be able to fin... |
Q) Consider an ordinary binary max-heap data structure with n elements that supports insert and extract-max in $O(log(n))$ worst-case time. Give a potential function $\Phi$ such that the amortized cost of insert is $O(log(n))$ and the amortized cost of extract-max is $O(log(n))$, and show that it works.
solution
The f... |
Consider the following special case of SUBSET SUM
Inputs: Positive integers $a$ and $b$ with $a \ne b$, and positive integers $k$ and $t$, with $k$ specified in unary.
Encoding: These inputs (compactly) encode a list $L$ of length $2^k$ where there are exactly $\binom{k}{i}$ terms of the form $a^{k-i}b^{i}$, for $i=0,... |
Let $A$, $B$ and $C$ be 3 discrete random variables. If $A$ and $B$ are independent ($I(A;B) = 0$, where $I$ represents the mutual information), how can we prove that $I(A;B|C)=0$? When I draw a Venn diagram this seems trivially true, but I just cannot find a way to prove it.
|
Consider any problem in NP-hard, then it has a polynomial reduction from a problem in NP in polynomial time. Though, it isn't clear by this definition whether there are decision problems in NP-hard that are not in NP.
Are there any known ones?
|
I have developed an algorithm to determine if two rooted trees are isomorphic, which is based on the following conjecture:
Let $S_{u}$ be the number of vertices in the rooted subtree of vertex $u$.
Namely, the size of the subtree of $u$. Now Let $L_{i}$ = {$S_{u}$ : $lvl(u)$ = $i$}.
Here, $lvl(v)$ denotes the level of... |
How would I prove that the statement
$10n^3+3n=Θ(n^3)$
is true/false?
|
Given the grammar $G = (Ν, Σ, Π, S)$, where $Ν = \{S\}$, $Σ = \{0, 1\}$, $Π = \{S → ε, S → 0, S → 1, S → 0S0, S → 1S1\}$, and $S$ is $S$. What is the language generated by the grammar?
|
Here is the problem: Given a tree $T$, I need to visit every node in the tree once. I can start and end anywhere I want. I would like to travel the least distance possible when doing so. I don't have to return where I started.
As my specification is not really clear I made up an example: Consider the graph (which is a ... |
Given a set $M$ of $m$ points in $R^n$, where the number of points $m$ is much larger than the dimension $n$, and given a point $x$ in $R^n$ that we may assume is in the convex closure of $M$, is there an (efficient) algorithm that finds $n+1$-subset of $M$ with smallest convex hull that contains $x$ (or, $k$-subset fo... |
Context: I've been working through Cracking the Code Interview and on page 70 the book asserts that there is a O(B) solution to this problem.
If
s = little string and S = len(s)
b = big string and B = len(b)
then I believe it would be something along the lines of (pseudocode):
hs = hash(s)
for every position, substr... |
I'm trying to solve a question which requires me to
prove that an instance of 3SAT where each literal appears in exactly 3 clauses (positive and negative appearances combined) and each clause contains exactly 3 literals is always satisfiable.
Find a polynomial time algorithm to find a satisfying assignment for it.
... |
Given an undirected graph $G = (V, E)$ and an integer $k$, is there a partition of the vertices into two (nonempty, nonoverlapping) subsets so that $k$ or more edges
have one end in each subset?
I'm a little confused on showing how the problem is NP, in terms of a certificate and certifier.
|
Consider an ordinary binary max-heap data structure with $n$ elements that supports insert and extract-max in $O(\log n)$ worst-case time.
Question: If extract max is $O(1)$ amortized does that mean worst case is $O(n)$?
My answer: No, A sequence of $n$ EXTRACT_MAX will cost $O(n\log n)$. This is because in a Heap th... |
I am trying to prove that the fooling set method does not give a good lower bound for the communication complexity of the inner product function. Specifically, I am trying to show that the best bound we get using the fooling set method is $$D(IP) \geq \Omega(\log n) $$
$D(IP)$ is the deterministic communication complex... |
In the hospital-resident assignment problem we have to match a large set of med students with a small set of hospitals. Hospitals may accept multiple students, but the number of students is much larger than the total number of residency slots available - several students are left unmatched.
If a particular student's pr... |
If there are 16 leaves in a full binary tree and two nodes $a$ and $b$ chosen at random, then what is the expected value of the distance between $a$ and $b$ in T?
My question here is, how do I correctly approach this question?
(Also tell me how to develop numerical skill in algorithm?)
|
Can anyone tell the meaning of the bold portion?
Float: It is used to store decimal numbers (numbers with floating point value) with single precision.
|
I have these $n$ equations, with $n$ variables. Variables are first $n$ positive integers, constants can be any rational number including zero. Given that there is always a solution, how do we find a solution to the system:
\begin{align}
ax^{1}+by^{1}+cz^{1}+\cdots&=k_{1}\\
ax^{2}+by^{2}+cz^{2}+\cdots&=k_{2}\\
ax^{3}+... |
Given $n \in \mathbb{N}$, a divisor $p\vert n$, I would like to efficiently find $e\in\mathbb{N}$ with $p^e \vert n$, and $e$ maximal with this property. I will assume that multiplication/division of two $b$-digit numbers has time complexity $O(b^{\log_{3}{5}})$. (Ie. I use the Toom-Cook algorithm.)
Then it can be show... |
Brzozowki's algorithm is cited widely. Several questions here give examples or discuss its complexity. But I haven't been able to find a proof of correctness for the algorithm. How do we prove it correct?
Any proof accessible to CS undergraduates would be very welcome.
|
In his article Software Development for Infrastructure Stroustrup states the following:
Hardware improvements make the problems and costs resulting from
isolating software from hardware far worse than they used to be. For a
typical desktop machine,
3/4ths of the MIPS are in the GPU;
from
what’s left, 7/8ths are... |
This is a geographic problem, where we have several connected graphs embedded on the plane, where none of them have overlapping edges/nodes.
How can we divide the plane using line segments in such a way that each subdivision contains exactly one connected component?
I was thinking of generating a voronoi diagram using ... |
How to find the big o running time if the recursion function have different cases of recursion with different fraction of n?
If I have a recursive function like this for example (This is just an example, its not a real thing, it just demonstrates my question):
someFunction(n){
base case:
return 0
if (some case)... |
I am reading algorithms in a CS book where a potentially nil value is passed to a function, but neither the caller nor the callee check if the value is nil. Is this a common practice in algorithms?
To be more precise, I am implementing a red-black tree and the grandparent of a node is passed to a rotation function, but... |
Is it possible to find an optimization to the following theoretical case?
Given is a cellular (phone) system with hexagonal cells, where the volume of transmission and the size of the cells are designed such that the same band (frequency) can be used by two cells that don't share a common edge. It can be assumed that t... |
I have read several Algorithm books where it is been told brute force approach of Longest Common Subsequence takes 2^n which is exponential time complexity. Whereas, I've noticed that while I am applying my brute force technique it's taking O(mn) (from my personal observation).
I would like to request you please read ... |
I have the following exercise:
Prove that $\{ab,aba\}^*=\{\epsilon\} \cup \{a\}\{ba,baa\}^*\{b,ba\}$.
My idea was to write the words of each of the languages in the following way,for example for the left side:
$(ab)^{n_0}(aba)(ab)^{n_1}(aba)...(aba)(ab)^{n_k}$
And then I try to make assumptions to $n_i$ and $k$. I thin... |
I was thinking maybe I can make it 2T(n/2) + C split the list into two halves and work on them recursively to partition the list.
|
Problem:
I have 2 sets, one of drivers and one of riders. All my participants need to reach one common destination. I wish to calculate the shortest combined distance in order for all participant to reach said destination. Although the goal is not to reduce the number of cars, drivers can be considered as passengers if... |
I've found a simple algorithm to interleave two halves of an array in place. It involves swapping the first 1/2 of the items into the correct place, then unscrambling the permutation of the 1/4 of the items that got moved, then repeating for the remaining 1/2 array.
Unscrambling the permutation uses the fact that left... |
Say we have the following language, some number of a's and b's followed by three a's followed by some number of a's and b's
Show how you can create a finite state machine that will accept the words in the language and reject words, not in the language. Show the transition rules.
Show how you can create a PDA or push d... |
I have 2 classes Car and Owner, they have weak preference to each other. After I assign nil to one object. That object is still not deallocated. Like code bellow, as far as I understand object vinfast (Car) must be deallocated because its reference count equal zero.
Especially is if I change james (Owner) to optional, ... |
Given two sets $S_1$ and $S_2$ of $n$ elements each. Each set $S_1$ (resp. $S_2$) has a revenue $R_1$ (resp. $R_2$). Each element $i$ of $S_1$ (resp. $S_2$) has a gain $g_{i1}$ (resp. $g_{i2}$). From set $S_1$ (resp. $S_2$), choose a subset of elements $O_1$ (and $O_2$) such that:
$\sum_{i\in O_1}g_{i1}\geqslant R_1$;... |
Let us say there is a program such that if you give a partially filled Sudoku of any size it gives you corresponding completed Sudoku.
Can you treat this program as a black box and use this to solve TSP? I mean is there a way to represent TSP problem as partially filled Sudoku, so that if I give you the answer of that ... |
There are examples of algorithm implementations that contain nested loops but are of complexity O(n), and some of them have corresponding implementations that contain no nested loops. So here comes a question, can all such implementations be simplified or converted to an implementation with only top layer loops? Namely... |
According to nLab, M-types are the dual of W-types. What are the introduction and elimination rules for M-types?
Edit: For example, the formation/introduction/elimination rules for W-types are:
$$\frac{A:Type\quad x:A⊦B:Type}{(W x:A)B(x):Type}-\text{W-Formation}$$
$$\frac{a:A\quad t:B(a)\rightarrow W}{sup(a,t):W}-\text... |
I often read statements such as "the run-time of algorithm X is polynomial in m and n". Indeed, when a problem has two parameters, it is possible that the run-time of an algorithm is polynomial in one parameter but not the other one, so if this is not the case, it is important to emphasize that it is polynomial in both... |
I'm aware of a large amount of literature on the problem of graph layout. Usually this involves taking a list of nodes and edges, and choosing locations and paths for both respectively. Are there any algorithms that take graphs where the node locations are already known, and produce paths for the edges?
|
This is an example of an assignment question, there are 3 of them so I created my own in order to better understand it.
First, we have the variable m which is a binary encoding such as 100#001#010 which is translated to [4, 1, 2]
Next is the variable n = the total length of the input/encoding
And k which is the largest... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.