instruction stringlengths 35 29.1k |
|---|
Description
Say I have a source list like: ["a","b","c","d"] and want to run a capitalization filter so if I change, "b" to "B", my derived list looks like ["B"]. Next, if I change my source list's "d" to "D", the derived list should look like ["B","D"].
Is it possible to make the insertions and removals in the derive... |
Sorry if this question is either obvious or ignorant. I am a high school student with only the computer science knowledge I have taught myself.
Calculators have a function that can convert numbers from decimal to fractional equivalents. For example, 0.5 becomes 1/2, and 0.666666667 becomes 2/3.
I doubt that the calcula... |
I was struggling with this paper about codes which can correct single deletion and re-ranking in permutations, http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=6875337
[Published in:
Information Theory (ISIT), 2014 IEEE International Symposium on
Date of Conference:
June 29 2014-July 4 2014, Page(s):
... |
In most statically typed languages, each expression has an intrinsic type. E.g. in Java, 3 is an int, 3.0 is a double, 3+3.0 is also a double. Types do not depend on the context of the expression.
However, in the CSS type system described in the spec, some expressions have a type depending on the context. For example, ... |
Roughly, in Ruppert's Delaunay Triangulation refinement algorithm, so called encroached edges are split until no more encroached edges remain.
The algorithm specifies splitting the edges at their midpoint (except in the case of small input angles where concentric circular shells as suggested. This question is unrelat... |
I have two lists where each item in the first list has a rating for each item in the second. I need to determine an optimal matching (or the best x scenarios) where items are matched, but each item can only be matched once.
For example, there are 150 movies available, 100 people, and each person has rated each movie b... |
I cannot determine why the Celsius values in this code are producing rubbish values. (Look at second statement in the first for-loop).
CODE:
/* The program will output two columns with the temperature in degrees Fahrenhiet
and equivalent temperature in degrees Celcius. The range will be 0 to 300 farenhiet in
20 deg... |
consider integers represented as base 2 (strings). define a relation called "n-msb matching" that is true when the 1st n msbs (MSB is "most significant bits") match (of two integers). what is a pragmatic way of searching/ computing the following?
given n2, find x, n such that n·3x is "many msb matching" (with n2).
no... |
I need to compute a large linear optimization problem very often after recieving updates to my optimization problem.
That is I have a linear problem to find an x such that
$x_1 * c_1 + ... + x_n * c_n$ is as small as possible
under the conditions that $Ax \# b$ (where $\#$ can be $<=$, $>=$ or $=$ on each row).
At som... |
A safe is protected by a four-digit $(0-9)$ combination. The safe only considers the last four digits entered when deciding whether an input matches the passcode.
For instance, if I enter the stream $012345$, I am trying each of the combinations $0123$, $1234$, and $2345$.
Clearly, a 40000-length string $000000010002..... |
Given that the two generals problema is unsolvable, which means that both parties involved cannot agree that both know something, i ask something simpler. Is it possible for both parties to agree that a message Exchange occurred? In other words, is it possible for both parties to agree that a "conversation" occurred?
... |
I want to create a PRNG for an integer only (with a max of 32767) system and tried to use an LCG. So I've chosen as $m = 32767$ and $c = 3$ and I tried to figure out a good $a$. However for the full period I have to choose $a = 32768$ which cannot be used since the maximum is 32767.
Can anyone help me creating a "good"... |
I have $n$ people each of which can meet on certain days of the week. I want to group them into $\frac{n}{k}$ groups of size $k$ such that all people in a group can meet on a day.
eg - Suppose there are 3 people who are free on (M,T,W,Th,F), (M,W) and (W,Th,F) respectively. They can all be placed in the same group sinc... |
Here is my solution:
S-> Sab|Sbb|Saa
S->aS
S->bS
S->ε
Is this solution right?
|
I'd like to find an efficient algorithm to answer this question:
For each node in a directed graph, find whether it is on a non trivial cycle (length > 2)
It sounds simple at first, but I still don't have an efficient sub-quadratic solution. I have some ideas but I'm pretty sure I'm trying to reinvent the wheel. Is th... |
In The Art Of Computer Programming, Volume 3, Chapter 5.3.1, Problem 26, Knuth asks one to construct a sorting method that achieves the minimum number of average comparisons for n=7. This means that one needs to find a sorting tree that minimises the total length of all paths from root to every leaf (also known as exte... |
Efficient way to find the sum of all elements of all subsets of size $k$ for a given set $s=\{1,2\dots,n\}$ ($n\ge k$). Example:
$s=\{1,2,3\}$, $k=2$.
$s_1=\{1,2\}:\;1+2=3$
$s_2=\{1,3\}:\;1+3=4$
$s_3=\{2,3\}:\;2+3=5$.
And the sum is $3+4+5=12$.
|
This being used in data bits transmitted by GLONASS Satellites. I am sure it is different from other codes like 'Binary Code' which the search engine throws up
|
I want to prove that the following program is correct. The code takes an array i of length N and a number x. At the end, the value of found should be true if the array contains x and false otherwise.
found := false;
i := 0 ;
while i < N do {
found := found || (a[i]=x);
i:=i+1
}
The given preconditions are that... |
Is there a way to get complement? Following is my solution for CFG of all strings that DON'T contain bbb.
S -> aA | aaB | aB | bA | bbA
A -> aA| aB
A -> epsilon
B -> bA | bbA
B -> epsilon
Is this right?
|
Say I have a "semi" directed, weighted, graph (some edges are undirected, some are directed).
Consider two nodes, A and B. Consider the set of all paths that take me from node A to node B.
I essentially want X samples of all these paths. I don't want these samples to be "too close" to the ideal path. Essentially, I wa... |
I read here that a proof has been offered that a Turing Machine with 2 states and 3 symbols can be universal (in that it is capable of arbitrary finite computations). Even if this proof is accepted, it is based on a Turing machine that doesn't halt.
If we consider only computations that do halt (that end on an addition... |
Why would it be impossible to draw an undirected graph G that has 12 vertices, with 3 connected components if G had 66 edges?
|
The self-information of an event of probability $p_x$ is defined as $I(p_x)=-\log_2(p_x)$.¹
I fully understand this for equiprobable events of the form $p_x = \frac{1}{2^k}$.
In that case, we want to encode $2^k$ events so we need $\log_2(2^k)=k$ bits.
So $I(p_x)$ should be $\log_2(\frac{1}{p_x}) = -\log_2(p_x)$
Howev... |
I need to select a given number of nodes from a weighted directed graph such that the nodes selected are the closest to a given starting node. This seems like a common problem to need to solve, but I haven't found much material on it. Does anyone know if this particular problem has a name, or any published material (... |
I have a question to find out that $L = \{a^m b^n\mid n>0, m - is prime \}$ is CFL or not. I know that it is not a CFL. But I don't know how to prove that. I know how to prove that $L = \{a^m\mid m - is prime \}$ is not CFL, by taking a random length for $vx$ ($uvwxy$) and prove that the length of the whole word is not... |
Suppose I define a global variable and I define an automatic variable within a function definition with the same name as the aforementioned global variable.
What would happen to the global variable if I altered the automatic variable within the function body?
|
For a given set of nodes, I can find optimal paths that visit all nodes using various traveling salesman algorithms. As a subset of this problem, I would like to be able to find shortest partial solutions as well. For example, if I simply don't have enough time to visit all n nodes, what's the shortest path that connec... |
I see nowadays XML is used to structure any file or data. It can represent both flat and hierarchical relationships. For example, it can be used to show the parse tree of a sentence in a natural language.
I am not familiar with different types of data and knowledge structures, but I would like to know if XML is theoret... |
I have this language: $L = \{a^{n+2} b^m a^{2n} b^{3n}\mid n,m >=0 \}$ and I am trying to prove that it is not CFL.
I assumed that my word is $a^{p+2} b^m a^{2p} b^{3p}$ (where $p$ is the pumpung length) and I applied the pumping lemma. I can find a contradiction for every case except for the case when the part that I ... |
i'm reading the article of J. L. Massey and M. K. Sain, "Inverses of Linear Sequential Circuits" (Date of Publication -
April 1968) (here) and i cannot understand - what is "feedforward inversion"?
They give a short description of circles in convolution codes and a little bit description about catastrophic codes (cod... |
For my case I have starting point and several cities.
I want the shortest route to visit all cities without returning starting point.
I have read several TSP algorithm and all include the return a full cycle.
So what TSP variation should I look for to solve my problem?
|
I generate some simple graphs based on usage stats of a website, and they may look like these:
I call the 'pattern' on the left 'convergence', and the 'pattern' on the right 'divergence'. The terms 'convergence' and 'divergence' are loosely and visually defined, and they simply means that the two curves either become... |
I have been reading the paper Towards a Cognitive System for Decision Support in Cyber Operations. And I have been trying to understand the role of two ontologies proposed here, cyber security ontologies and scenario ontologies.
I have asked a question on CGS SE, What are the practical uses of ontologies? and the role ... |
If I have a locally finite graph (every node has finite number of neighbors) with positive edge weights, is it possible for there to be a path between some start node and goal node but no shortest path between them?
I think that it can only happen if the goal node is somewhere in the infinity, but then we wouldn't be s... |
In Algorithms, 4th Edition, I read that after the partitioning step one element is in its final position.
The entry a[j] is in its final place in the array, for some j.
No entry in a[lo] through a[j-1] is greater than a[j].
No entry in a[j+1] through a[hi] is less than a[j].
And this comes from Algorithms, 4th Editio... |
I found an implementation of Quicksort here, and now I cannot understand why it works with those left and right bounds.
Right now the link above is unavailable due to some problems with their hosting provider.
public class Main {
public static void main(String[] args) {
int array[] = new int[] {
... |
Let $R$ be a commutative ring. Let $f(x_1, \dots, x_n), g(x_1, \dots, x_n)$ be two multidimensional polynomials in $R$ with maximal total degree $\delta$.
How fast can we compute the product of $f$ and $g$, i.e. the resulting coefficients of each term?
I have only been able to find a non-trivial algorithm for when $R$ ... |
Given an unsorted array of $n$ integers, I need to find an $O(n \log k)$ algorithm that finds the $k-1$ items that divide the sorted array to $k$ equal (up to $\pm 1$ items) parts.
For example, if $k=3$, the items we want would be at indices $n/3$, $2n/3$ in the array after we sort it.
I know that you can select those ... |
I'm having a hard time tackling the following problem (perhaps some key data is missing). We have a constraint:
$A+B= C$
One is supposed to represent this one constraint using three binary constraints. Is this even possible? No domain is given, but even if it was, I really don't see how this could be achieved...
|
Prove/ Disprove:
For every nontrivial $A,B\in R$, $A\le_m B$
For every nontrivial $A,B\in RE$, $A\le_m B$
trivial set is the empty-set or $\Sigma^*$.
So basically the question is if for every two nontrivial sets there is a computable function from $A$ to $B$.
I'd be glad to get hint/guidance since I'm kinda stuck a... |
I'm playing with Akka FSM.
The declaration of a an Akka FSM consists of states + data mantained during the states (the akka doc is more clear than me) + events that trigger transitions between states.
Can we say that such a formalism is Turing-complete? I can't think of a problem that can't be solved this way.
|
I need to find a tight bound on the number of comparisons in a d-ary heapsort, in terms of d and n (the length of the array we want to sort).
Since inserting n items to a heap takes O(n) , and each delete-min takes O(d log n/ log d), I was thinking the bound is O(n d log n / log d). Am I right? If so, how do I prove th... |
I have a specific question and not sure what tools I can use to finish my projects. I know this may has been well solved, but I am quite new to the image recognition and detection area and don't know what tools I can use to productionize this work.
We are trying to find, for example, navels in humans pics:
I have 1000... |
I am new to automata theory.
Could you give me a little hand with the correct use of the pumping lemma?
I understand now how to proof a language is not context-free, but how do I use the pumping lemma to proof it is?
Do I find one way to break the word into: uvwxy so that v and x can be pumped? Is that enough and can ... |
Given a B+ tree with M=3. We assume that the tree is static and it is not necessary to update the B+ tree. Also we know that all key-value pairs are stored in the leaves of the B+ tree. Internal nodes contain copies of keys stored in the leaves.
For simplicity we can assume that an internal node with d children holds ... |
how do I prove that for every 2 languages $A,B\in R$ where $A,B \notin \{ \emptyset , \Sigma^* \}$
I can do a reduction $A \leq_m B$?
[EDIT]
My try:
$A$ is decidable therefore it has a turing machine that decides it - $T_A$
For every x, we can check whether $T_A$ accepts x or not, if it accepts then we run over the al... |
The house robber problem of leetcode can be described as followed :
A robber enters a colony of houses numbered from 1 to n. Every house has a number printed on the top of it. That number is the amount of money inside that house. However, there is one constraint. If the robber robs the i-th house, he can't rob house... |
Is there any efficient algorithm which is able to generate nearly uniform samples of permutations in case of position restrictions?
Consider $N \times N$ restriction matrices $R$, that is matrices over $\{0,1\}$. Each such $R$ defines a set of permutations $\Pi_R$ according to
$\qquad\displaystyle \pi \in \Pi_R \iff \f... |
Given a collection of sets $C= \{S_1,S_2,\cdots,S_n\}$ such that each set $S_i \in C$ is sorted and has at least $k$ elements.
What is the most efficient algorithm for finding the intersection of these sets: $\bigcap_{S_i \in C}{S_i}$
|
Suppose that $x = (x_1,\ldots,x_n)$ is a binary vector and $f(x)$ is a boolean function. Furthermore suppose $y = (y_1,\ldots,y_m)$ is a binary vector and that $F(x,y)$ is a binary formula of size $k.$ Here by size I mean the number of leaves in $F.$
Suppose I have vectors $S = \{s_1,\ldots,s_n\}$ such that for any ... |
I am trying to wrap my head around these asymptotic notations. Given $f(n)$ and $g(n)$, one can write $f(n) = \Omega(g(n))$ as shorthand for $f(n) \geq c*g(n), n\geq n_0$. But what happens when $n<n_0$. What can we then say about $f(n)$ and $g(n)$? Do we just assume that $f(n)$ is a constant and the relation still work... |
Let's consider the following MIPS (using pipelined arch.) assembly code:
lw r1,0(r2)
sub r4, r1, r6
and r6, r1, r7
or r8, r1, r9
the r1 value used in the second and third instruction will not be ready to use until the end of the 4th cycle of the pipeline, while the 2nd and the 3rd instruction need it at the 4th and 5... |
I have a file that has a number (a positive integer) on each row.
Given a number $q$, I want to find a value that's a sum of some 8 numbers in the file, and is as close to $q$ as possible.
So, supposing that I have a file that looks like this:
345
3
2
3453
1234
6
7
34
12
1111
48
413
If the giv... |
Using Herlihy's model and definition of the wait-free hierarchy, a queue (a shared object with enqueue and dequeue) has consensus number 2, because we can initialize the queue with some value, and the first process to dequeue it "wins".
However, it is also possible to do wait-free consensus with queues that start off ... |
Is this language Context Free?
$L=\{a^{n+3} b^{2m} \mid n \neq m \}$
I think that I could split the languages into $L_1$ and $L_2$ with the conditions $n<m$ and $n>m$, provide 2 CF grammars and then to make the union. But I don't know how to put the condition $n<m$ to the grammar or how to think about the conditions. T... |
The standard knapsack problem solution is O(nW) where we will increment the weight +1 at a time to get to the solution.
Is there any approach to the knapsack problem that does not require incrementing weight +1 at a time.
e.g. One way that I can think of is to divide all the numbers by its common
Capacity = 100 we... |
I try to construct a TM that accepts the language $\{ ww \mid w \in \{a,b\}^* \}$.
Between the words $w$ is no delimeter, so I don't know, how my TM can know where the first $w$ ends and the second $w$ begins.
Is there a trick for this?
|
We have two strings $a,b$. I want to find string $c$ that includes $a$ as a subsequence and includes $b$ as a subsequence and the length of $c$ is minimal. Is there an efficient algorithm for this problem?
For example, if $a=1011$ and $b=0100$, the minimal string that include both: $c=101100$. As you can see string $... |
Given an undirected graph $G$ and two pairs of vertices $(s_1, t_1), (s_2, t_2)$, the disjoint paths problem (DPP) asks for two vertex-disjoint paths, one from $s_1$ to $t_1$ and the other from $s_2$ to $t_2$.
The problem has been shown to be in $P$ even for the generalization with $k$ disjoint paths, where $k$ is a c... |
A test is consisted of $N$ multiple choice questions, each has $k$ possible answers.
A test solution is the sequence of answers $S\in[k]^N$.
Given is a black box which receives a solution as input and returns the number of correct answers. After failing a test, the student may take the test again, and the questions do ... |
As far as I know, for two undirected graphs $G = (V, E) $ and $H = (V', E')$, the following criteria is necessary for them to be isomorphic:
$|V| = |V'|$
$|E| = |E'|$
$G$ has $j$ nodes of degree $k$ $\Leftrightarrow $ $H$ has $j$ nodes of degree $k$
Are there more that are that obvious? Thanks in advance for your hel... |
I would like to find out if this language is context free or not:
$\qquad L=\{a^{i}b^{j}c^{k} \mid i<j,i+2j+3<k\}$.
I've tried to apply the pumping lemma taking out $w=a^n b^{n+1}c^{3n+6}$ which is in the language, where $n$ is the natural number given by the lemma. I can write $w=uvwxy$ such that $|vx|≥1$ and $|vwx|≤n... |
The Lowner–John ellipsoid is a minimum volume enclosing ellipsoid of some convex body $K$. This ellipsoid is unique (as is the maximum volume ellipsoid contained in $K$). I'm looking for algorithms based on those ellipsoids, or any significant practical use that requires finding them explicitly.
|
Looking for k shortest paths that do not share edges. i.e if the paths were represented as sets of edges, their intersection has to be empty.
We could use Dijkstra to find the 1st "disjoint" (edge unique) shortest path from the origin to all vertices. However, to naively find the 2nd disjoint path, one would need to cr... |
I am trying to wrap my head around ontologies and their related counterparts (RDF, OWL, etc.).
My understanding is that an ontology, at the end of the day, really boils down to some database storing objects/entries, where each entry has a set of known attributes as well as relationships to other entries.
If that's true... |
I'm having trouble proving that $S_2$ is closed under union and complement, even though in this Wikipedia article it says that:
It is immediate from the definition that $S_2$ is closed under union and complement.
I think that my problem is due to the fact that $S_2$ is defined slightly differently in my assignment. H... |
Just for fun I am trying to write a program to sort the 13 cards (from a standard pack of 52) in a Bridge hand by performing human-like moves on the hand.
A sorted bridge hand is arranged by suit, with alternating colors of suit (if possible), and the cards are sorted by decreasing rank within each suit. For example
... |
Suppose $Σ=\{0,1\}$; then $Σ^*$ is the set of all strings over $Σ$.
Is $Σ^*$ over $Σ$ finte?
|
There are multiple references about the relational algebra for modeling queries (SELECT) but I have found very very little on the expanded algebra that would include concepts in all of DML such as INSERT, UPDATE, DELETE and maybe even MERGE, DECLARE, SET (as defined by MS SQL Server, whenever I must choose). I'm looki... |
As i know the MU0 processor instruction format is as follows:
so the opcode is 4 bit, can anyone explain why it has only 8 instructions, if it could have 16 instructions, 2^4 = 16 ??
|
In the step of removing unit productions when converting a grammar to Chomsky normal form, I sometimes found that the variables may end up having the same production bodies. Is this possible? If so, can we consider these variables identical? For example, given:
S->aAA|aA|A|a
A->bBBB|bBB|bB|B|b
B->bSSS|bSS|bS|S|b
So
S... |
Is there an efficient algorithm to visit/enumerate all unique connected subgraphs of a labelled graph?
E.g., when the graph is a path, $v_1v_2\dots v_N$, there are $N(N-1)$ unique connected graphs: for any $1\leq i<j\leq N$, the subgraph $v_i\dots v_j$. For graphs with denser edge structure, the number of unique conne... |
I need some help with proving the complexity of the following problem
(I'm new here, so please excuse my "newbie-ness")
Given: an AVL tree with keys: $1,2,..,n$, such that each node $i$ in the tree has the parameter $w_i$ (which is an integer)
The task: To make an algorithm which returns an array of size $n$ such that ... |
I have a triangle and the value of the pixel intensity at each of the three corners of the triangle. I want to interpolate to find interpolated pixel intensities for a set of points inside the triangle. How can I do this?
The method I've tried is to do an value determination based on the distance of that fill-in poin... |
Is there a way to compute the size of a maximum matching
in an unweighted bipartite graph
more efficiently (e.g. faster) than computing a maximum matching?
It is a long shot but
it is often an interesting problem to avoid throwaway computations like these.
Motivation
The problem I am trying to solve is match-2
where... |
It is well known that the class of CFLs is not closed under intersection as follows e.g. from the following example:
$$L_1 \cap L_2 = \left\{ a^mb^mc^n \mid m,n \ge 1 \right\} \cap \left\{ a^mb^nc^n \mid m,n \ge 1 \right\} = \left\{ a^ib^ic^i \mid i \ge 1 \right\} \not \in \mathcal{L_2},$$
where $L_1,L_2 \in \mathcal{L... |
I have to design an algorithm to do the next task:
I have one array of booleans. For example:
Array: [0 1 0 0 1 0 1 1]
I want to obtain all the existing combinations of 1's, having in mind that it is allowed only a maximum of one 0 between 1's.
For example, in the previous case, we would have the outputs (I am using ... |
I was trying to generate maximal length pseudo random sequence using an linear feedback shift register (LFSR).
I have read from many sources that the length of the pseudo random sequence generated from the LFSR would be maximum if and only if the corresponding feedback polynomial is primitive.
I have tried to generate... |
Since a sufficiently large hash table takes constant time to both insert and retrieve data, should it not be possible to sort an array by simply inserting each element into the hash table, and then retrieving them in order?
You just insert each number into the hash table, and remember the lowest and highest number inse... |
Let's take the zip compression for example, from what scraps I can gather on the Internet, the 2 major simplified ways it works is by looking for arrangements of bits that repeat throughout the file, and by compressing certain bit orders.
So for example, we have 010111111111110101
A zip file would look something like:... |
I am currently attending the concurrent programming course in my university and we recently started talking about the concept of a monitor. While I understand the necessity of mutual exclusion, I do not understand why I would use a monitor for that.
As I understand it, a monitor guarantees that exactly one or no proce... |
Here's something that has puzzled me lately, and perhaps someone can explain what I'm missing.
Problems in NP are those that can be solved on a NDTM in polynomial time. Now assuming P$\,\neq\,$NP, PSPACE$\,\neq\,$NP etc. this means that there are NP-complete problems that cannot be solved in polynomial time on a DTM. W... |
In the TSP problem, we usually assume a complete graph. If we can only visit each city once, we need a complete graph to ensure that there will be a path from every city to every other city. This is easy to accomplish as if there is no straight path between A and B, we can simply assign a new edge whose length is the s... |
Please see below pseudo-code for finding the max-height of a b-tree
maxDepth()
1. If tree is empty then return 0
2. Else
(a) Get the max depth of left subtree recursively i.e.,
call maxDepth( tree->left-subtree)
(a) Get the max depth of right subtree recursively i.e.,
call maxDepth( tr... |
I just can't figure this question out:
Given an array of N elements, its values range are from 0 to 100.
Write a function that prints the array's elements sorted by repetition.
Time complexity : O(N)
For example: Array: [20,60,10,80,100,0,20,20,30,35]
The function should print: 20 20 20 60 10 80 100 0 30 35
|
I have a boolean function $f: \{0,1\}^n \to \{0,1\}$ that I know takes the form
$$f(x_1,\dots,x_n) = x_{i_1} \lor x_{i_2} \lor \dots \lor x_{i_k},$$
but I don't know the values of $i_1,\dots,i_k$. I am given many pairs $(x,f(x))$ for random values of $x$ (chosen uniformly and independently at random).
I'm looking for ... |
Does anyone have any complete example of a proof of program correctness? I'm talking about something that includes the usual predicate, base case, inductive hypothesis, and inductive step. But also important is the loop invariant, and termination. I'm just not sure what the proper format for something like this is.
The... |
I have a boolean function $f: \{0,1\}^n \to \{0,1\}$ that I know takes the form
$$f(x_1,\dots,x_n) = x_{i_1} \lor x_{i_2} \lor \dots \lor x_{i_k}.$$
I don't know the values of $i_1,\dots,i_k$, but I do know $k,n$. My goal is to recover $i_1,\dots,i_k$ from the value of $f$ on randomly chosen inputs, using as few evalu... |
I would like to understand why and when polynomial algorithms became of interest.
When did people realize the role and importance of efficient versus non-efficient algorithms? Did that happen when the concept of an algorithm was discovered, or the the term algorithm used.
For instance, I've looked at some textbook of A... |
I have a set of solution nodes generated over a polar grid. I would like to convert / interpolate these solution nodes onto a Cartesian grid:
That is, using the image above, for each node in the Cartesian grid I would interpolate a value from the closest existing nodes (red).
Currently, my approach is to generate a k... |
I'm curious if there is existing literature or well known algorithms out there for a problem I am working on.
Given a normalized relational database with valid foreign key constraints and a list of fields across different tables, what is a good or at least consistent algorithm for determining the (inner) joins require... |
The particular quadratic Diophantine equation:
$$
R(a,b,c) \Leftrightarrow \exists X \exists Y :aX^2 + bY - c = 0
$$
is NP-complete. (a, b, and c are given in their binary representations. a, b, c, X, and Y are positive integers).
Kenneth L. Manders, Leonard M. Adleman: NP-Complete Decision Problems for Quadratic Polyn... |
$A$ is finite, $B$ is NPC - When there's a polynomial reduction from $A$ to $B$?
Basically, I've understood that if $A$ is finite, then there's a reduction for every $B$ which isn't trivial (empty or $\Sigma^*$).
BUT, if $B$ is NPC then $B\ne \emptyset, \Sigma^*$, so in which case there's is no polynomial reduction f... |
I tried to find sources that explain multiple sequence alignment with an example using progressive alignment, but I couldn't find one.
I actually know till creating a guide tree, after creating a guide tree we use guide tree to arrange sequences. This is the critical part. Can some please help me in explaining how to a... |
I am converting cartographic objects, which have an exterior boundary (simple polygon) and zero or more interior boundaries (also simple), into a less sophisticated format that specifies exterior boundary only. To overcome this restriction, I plan to “cut through the body of the shape” — joining a pair of nodes of exte... |
I'm reading this tutorial from the University of Illinois about Turing Machines, and I don't understand something.
They give a pseudocode algorithm for an machine that accepts strings from the language
$L = {0^n1^n}$
and a diagram of the machine. Both are pictured below:
What I don't understand however is how does t... |
Quantify the effect in performance which comes from using the cache ,if We are going to use a program which is made from 500 machine instructions ,from which 100 are in a cycle which is executed 25 times.Suppose that the main memory has a memory stall of 10 units of time and the cache memory has a stall of 1 unit.
So t... |
I can't figure out how to swap boxes on a Turing Machine tape.
So for example, I have a tape that says
a 1 0 1 1 1 0
^
And I want to move that a over so that it is in the middle. (but my end goal is not important here)
How do I get the Turing Machine to do
1 a 0 1 1 1 0
^
1 0 a 1 1 1 0
^
etc...
|
How can I prove algorithm correctness ?
when i face a problem and come up with a solution the only way to know if this a valid solution or not is by trying some test cases. if they pass through the algorithm and produce the expected output then my algorithm most properly true.
but obviously this is not hold all the tim... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.