instruction stringlengths 35 29.1k |
|---|
I am trying to prove the NP-Completeness of problem [A].
I know there is a well-known NP-Complete problem called problem [B].
I can model [A] into an instance of [B] ([B] is a very general problem and when I assign some edges a weight value then it becomes [A]).
Is this sufficient to say [A] is NP-Complete?
|
I have:
A programming language (P). Programs should take no input and produce a sequence of integers as output.
A way to enumerate all valid programs in this language (R) in a way that each program is at least as long as all programs before it.
I execute in order each entry in R. Each time I encounter output I have n... |
Can there be a function HALT(f, y) so that:
There are some x such that f(x) halts iff there are some y such that HALT(f, y) return true;
There are some x such that f(x) doesn't halt iff there are some y such that HALT(f, y) return false;
HALT always halt and return a boolean
? It makes lots of old conflict don't work... |
Given positive constants: $c_1, c_2, ..., c_k, c^\prime$, assume that
$T(n) = T(c_1n) + T(c_2n) + ...+ T(c_kn) + c^\prime n$
There are two cases:
$c_1 + c_2 + ...+ c_k < 1$
$c_1 + c_2 + ...+ c_k = 1$
As I observed (from some problems), in case 1 $T(n) = \theta{(n)}$, in case 2 $T(n) = \theta{(n\log{n})}$
But I didn'... |
I learned that recursive language are decidable; correct me if I am wrong. However, I have found some arguments that seem to contradict this. These may or may not be correct; please let me know.
If a language is an REL (recursive enumerable language), I know that there exists a TM (Turing machine) that accepts it (reg... |
Given $k$ arbitrary words, such as $\{\text{"fjqke"}, \text{"gbqig"}, \text{"a"}\}$, is there a way to mergesort these words in linear time so that the final output would be "abefgggijkq"? I tried to approach it by first sorting all the words independently and then merging the words into the final output, but sorting a... |
Is the optimization of a linear classifier convex?
Is there any local optima or saddle points for a linear classifier?
|
I have a question regarding the quotient of two regular languages, $R$ and $L$.
I saw the answers to this question: are regular languages closed under division
and the proof sketch is not constructive, because $L$ can be any language.
I'm thinking about a constructive proof when $L$ is regular: how can we construct th... |
i have found the equivalence classes of given $R_L$ and i need to find the separating words between the equivalence classes(which i don't know how to do). would appreciate if you could explain to me how to do so. also, if you can, would appreciate if you could check if i obtained the correct equivalence classes for bot... |
i had a question and its
"A man has 5 female and 7 male friends and his wife has 7 female and 5 male friends. In how many ways can they invite 6 males and 6 females if husband and wife are to invite 6 friends each? Answer. 267,148."
i tried to have cases by that each person invited six and total of 6 females and 6 ma... |
I know that generalized suffix tree can match substring for a given pattern.
But I have need a data structure which is able to
match prefix of many strings.
match sub string of of many strings.
For example:
The strings I have:
abc, abcd, bcxabc,
If the pattern is abc, I should match all three strings.
If the pattern... |
Let $G$ be a graph with total vertices $|V(G)|$. Let the maximum degree of the graph be $\Delta$. Let us assume the graph is total colourable( no adjacent vertices, adjacent edges and an edge and its incident vertices receive same colour) with $\Delta+1$ colours. Let the vertices be properly coloured with $\Delta+1$ co... |
I was thinking about TM (Turing Machine) as a computation model, and I came up with the following question :
Is it possible to make a TM that answers binary search (tell wether $x$ belong to a sorted array $A$) in $\log$ time ? That is, is it possible to simulate random access on a TM ?
My thoughts so far are that it ... |
this question came up while a group of students at my school were studying for our qualifying exams. The question on an old exam was:
Prove that every context free language $A$ is in $\mathrm{SPACE}(n)$. You can assume that $A$ is given in CNF (Chomsky Normal Form)
I saw CYK algorithm but it's space complexity is $O... |
I have been thinking about some problems in combinatorics and I came across a problem I'm having trouble with.
Suppose you have a list $L$ of length $n$ (wlog the elements of the list are 1,2,3,...,n) and you want to sort it circularly (meaning [3,1,2] is sorted) with swaps of adjacent elements, but you are also allowe... |
There are instances when WL algorithm fails. For example graphs G1 and G2 below have the same coloring after WL-1 algorithm.
However, one of these graphs is disconnected. So what are the instances of undirected connected graphs for which WL algorithm fails?
|
You are given a tree with $n$ nodes and $n-1$ edges. Each edge has a weight. There are $m$ queries. In each query you have to answer the following question:
How many edges are there in the path between node $a$ and node $b$ with weight less than $k$?
$a$, $b$, and $k$ vary in each query. You're allowed to preproces... |
Q) Consider 1MBps hard-disk is interfaced to the processor in a cycle stealing mode of DMA whenever $64$ bytes of data is available in the buffer,then it is transferred to main memory (1 word = 64 bits) and machine cycle time is 2 micro sec. Then,
1.) Percentage of CPU time consumed for DMA operation is ?
2.) Percent... |
I am trying to invert a matrix using Woodbury identity. The inversion using Cholesky decomposition has the following pseudo-code:
For $t=1,2,...$
$(1)\;\; \text{Read}\;x_t\in\mathbb{R}^n$
$(2)\;\;D_{t-1}=diag(|\theta_t^1|,...,|\theta_t^n|)$
$(3)\;\;A_t=A_t+x_tx_t'$
$(4)\;\;A_{t}^{-1}=\sqrt{D_{{t-1}}}\left(a\mathbf{... |
$(a^n)^mb^n$ for $m,n\ge 1$
This can be rewritten as $a^{nm}b^n $
i.e. number of $a$'s is a multiple of number of $b$'s, or for every m $a$'s there is one $b$. I thnk this language can be accepted by NPDA. For every m $a$'s one a can be pushed into the stack, and similarly one can be popped on encountering a $b$. Bu... |
On page 17 on the paper Online Learning with Predictable Sequences, we find a regret of an algorithm equal to
$$
\text{Reg}_T=\frac{R^2}{\eta}+\frac{\eta}{2}\sigma^2(T+logT+1)
$$
where $T$ is the entire time, $\eta$ is learning rate, $R$ is constant, and $\sigma^2$ is the variance of data. The above using arithmetic me... |
I am having a confusion. Empty stack pda will always accept episilon. Therefore a language not accepting episilon will still be accept episilon, so how can we avoid this?
|
I am reading the Artificial Intelligence: A Modern Approach book and in the chapters about logic i noticed that in propositional logic the Modus ponens inference rule (used by the forward and backward chaining algorithms) requires the KB to be a conjunction of Horn clauses, while in first order logic the Generalized Mo... |
I'm learning about Turing reductions at the moment and I'm just wondering is there any difference between an oracle and a decider, As they seemingly do the exact same thing. I understand the point of a oracle is that we don't have to know how it gets its answer but it will always give us the right answer.
An oracle fo... |
For an algorithm I need to be able to iterate over all bit strings where $k$ bits are flipped given a bit string with length $n$ and $n \geq k$. For instance let's say I have the bit string $1001$ and I want to have all bit strings with $2$ bits flipped. That should result in the following bit strings:
1010
1100
1110
0... |
The SLR(1) parses AFAIK does not have any lookahead with it then why do we write it as SLR(1) and not as SLR(0). The thing about parsers which I read online taught me that if it's LR(K) then K represent the number of lookahead symbols. Thereby it's not making much sense to me.
Kindly help me here
Thanks in advance!
|
We know that the decision problem of whether an arbitrary context-free grammar is ambiguous is undecidable. My question is how are made the unambigous grammar of programming language? My guessing is that maybe starting from a simple grammar, which is easy to prove that is not ambigous, then adding some rules for which ... |
I am trying to optimize a program, where I need to know whether a given set of keywords present in the set of words. I believe using the dictionary is the only way to optimize it. Any other technique so that I can get better time complexity? The below python script is my version of the code, this works for a small sent... |
Why don't we consider them as linear? I don't understand. You just have to check for factorization up to sqrt of n. So it's even faster than linear.
I assume it's not linear only if we compare the number of operations relative to the input in terms of binary representation. But why would we do so?
It seems to me wron... |
I am doing a project in applied math, which involves counting spanning trees and selecting spanning trees uniformly at random for near-maximal planar graphs with ~430 vertices, as part of a larger Markov process. Though I am aware of theoretical methods for both of these tasks, I was unable to find even rough estimates... |
Definite clause grammars have been around a long time and are included in logic languages such as Prolog.
They can be translated into (are just syntactic sugar for) Prolog programs and are therefore I assume turing complete (unless I have missed an important limitation of DCGs relative to full Prolog).
Prolog is a logi... |
I'm working on an object tracker where I need to report the azimuth and elevation of targets. Both values should be scaled from degrees to unsigned 32-bit integers. For now I can ignore lens distortion, assume Z=0, and make an arbitrary North (the center of the image?).
The images are single frames taken at 60fps. I do... |
Given a 4-regular graph, is it NP-complete to test whether it can be decomposed into two edge-disjoint Hamiltonian cycles?
|
The wikipedia page on meta-heuristics states that they are "heuristics designed to find, generate, or select a heuristic".
The wikipedia page on hyper-heuristics states that they are "heuristic search methods that seeks to automate [...] the process of selecting, combining, generating or adapting several simpler heuris... |
Consider the following grammar:
Stmts -> Stmt | Stmts;Stmt
Stmt -> Var =E
Var ->id[E] | id
E-> id | (E)
in accepting state we get
S' -> stmts .
stmts -> stmts . ;stmt
isn't it a conflict ?
|
This question stems from my effort trying to learn ASN.1.
After I went through the PKCS#1 standard for RSA cryptosystem and X.680~X.683 side-by-side, I noticed that, they've defined
ALGORITHM-IDENTIFIER as a class, and
AlgorithmIdentifier as a sequence type that can be encoded using BER the basic encoding rule.
I'... |
Consider below two Languages
$L1=\{<M>|$M takes atleast 2000 steps on some input $\}$
$L2=\{<M>|$M takes atleast 2000 steps on all inputs$\}$
Where for each Turing machine M, $<M>$ denotes specific encoding of M.
Here I think both are recursive, because let's say I bound the number of steps the Turing machine runs to 2... |
Count the number of literals in the following expression :
F = AB' + BC' + CD' + DE'
According to me, the answer should be 8. But my solution suggests that the answer should be 6. Can anyone help me out. What am I doing wrong?
Thanks in advance!
|
I am trying to go through the proof of the Master Theorem in Introduction to Algorithms of Cormen, Leiserson, Rivest, Stein (CLRS). The theorem providers an asymptotic analysis for recurrence relations $T(n)=aT(n/b)+f(n)$ where $a\geq 1, b > 1$ and $f(n)$ is an asymptotically positive function.
The authors create a fo... |
Is there is an efficient algorithm to solve the following optimization:
$\mathbf{x}^* = \arg\min_\mathbf{x}\sum_i ||\mathbf{A_i x} - \mathbf{b_i}||_1$
for given $\mathbf{b_i}, \mathbf{A_i}\ \forall i$, where $|| \mathbf{y} ||_1$ is the $L_1$ norm (i.e. $\sum_j |y_j|$) and $\mathbf{A_i}$ are big matrices which we don't ... |
I am going through Antonin Guttman's paper on R-tree. It mentions the max no of nodes given N index records in an R-tree is |N/m| + |N/m^2| + 1.
If there are N index records and if we choose to have minimum number of entries (m) in each node, wouldn't we just need N/m nodes at max? Why do we also have N/m^2 + 1?
Here's... |
Consider the following SQL Queries executed on the relation Employee:
Employee (Eid, Ename, sal)
Eid is the primary key
Queries:
S1:SELECT count (*) FROM Employee;
S2: SELECT count (Eid) FROM Employee;
Will these queries return the same result or different results?
According to me, these queries should return same ... |
In a language supporting CPS, but no built in global state, we can represent a state based computation using a function. We call this function a state function. Assume the function takes three arguments, get, put, and cont. The intended interpretation of these functions is that get takes a continuation, and applies tha... |
I was reading The Algorithm Design Manual by Steven Skiena, and I noticed his use of "process functions" in depth-first search and breadth-first search. Consider the following pseudocode for depth-first search:
DFS(G,u)
state[u] = "discovered"
process_vertex_early(u)
entry[u] = time
time = time + 1
... |
What I wonder is what exactly would it entail. Would it,for instance imply that P=NP or would there be different consequences,I haven't found any assorted consequences so far in my research.
Thank You,
Akash
|
I have been confronted with two meanings of the term "optimization" or "optimization algorithm":
to find the absolute maximum in a set $X$ according to some criterion $f:X\to \mathbb R$
to find a "relatively high" or "increasingly high" or "locally maximum" element in a set $X$ according to some criterion $f:X\to \mat... |
I'm just looking for the general idea on how to approach the following problem:
Find a term $\Delta=\lambda x.xUV$ such that:
$\Delta\Delta=K$
$\Delta K=S$
(it's a system of 2 equations, I didn't know how to format it properly)
Where $K=\lambda xy.x$ and $S=\lambda xyz.xz(yz)$
I think I need to use Bohm theorem but I... |
The online lecture I am watching stated a proof idea:
The set of all possible programs is countably infinite, yet
the set of irrational numbers is uncountably infinite.
I don't think this is sufficient, it assumes one program can only return one irrational number.
How to show that I can not write one program that ret... |
I have a Problem with an Optimal Loading a Hopping Airplane example . This is the Part of Minimum Cost Flow Problem.. .. I dont understand a Picture at all. I should to make one example with numbers and i need to show, how could i send flow along the Airline with bigger Revenue und possible smallest cost... Thank you f... |
I just wanted to make sure if I'm reasoning correctly. So, if two computers are solving the same mathematical puzzle i.e. SHA-256 function of Bitcoin (finding nonce that satisfies difficulty target), the computing power used by each of them can be compared in units of Gigahashes, Terahashes etc. and we know which one u... |
I don't understand the use case of count min sketch.
Based on Count–min sketch, it says "serves as a frequency table of events in a stream of data.".
If I know there are N types of events, why can't I just allocate an array of N slots or a hashmap to keep track of the event frequencies as the stream is ingested?
Am I r... |
Let $\Sigma=\{0,1\}$ and $L=\{u \in \Sigma^* : u \text{ has odd number of 0's and odd number of 1's}\}$. How can I build a regular expression or an automaton for this language? I have no idea, and I guess $L$ is not regular, but I haven't been able to prove it with the pumping lemma.
If it is not regular, can you give ... |
I want to show that $A_\mathrm{LBA}$ is PSPACE-Compelte.
Say we proved it is in PSPACE. Now for PSPACE-HARD:
I had an idea, which was very similar to some solution i found on the web- say we have a TM M which decides some language A in PSPACE. Then given an x in A we can simulate M on x to determine the number of step... |
I haven't found anything in the literature that suggests what would happen if that is the case.
Thank you,
Akash
|
I'm trying to find a formal definition of an algorithm but I only found this. I don't know if it is the accepted one, or even the only one, and I would like some literature on the formal definition(s?). Any help would be appreciated. Thanks.
EDIT:
I'm asking about the formal mathematical definition, not the definition ... |
If I am a Bitcoin node, I can evaluate two blockchains in terms of each one consisting of more Terahashes than the other and thus deduct which one is the "correct" one. There is impartial source of consensus - hashes done.
But what if I had two blockchains, each one making a different function, e.g. one is Bitcoin and... |
A rectangular board with three rows and $n$ columns is filled with $3n$ counters, of which $n$ are red, $n$ are white, and $n$ are blue. The object is to rearrange the counters to have counters of each of the three different colors in every column. The only operation allowed is to swap counters in the same row. Design ... |
I am creating a two-tape Turing machine to recognize the language $\{0^{2^n}|n\geq 0\}$. My idea is to put an input string, such as 0000, at the first tape, and use the second one to count the number of 0s in binary form (as a suggestion at A two-tape deterministic Turing machine that recognizes an exponential string).... |
K-means clustering is the problem of partitioning a set of points in a metric space into $k$ sets (clusters), such that the sum of squared distances between each point and the center of its cluster) is minimized overall, i.e. the clusters as as "tight" as possible.
While NP-hard in the general case, I know it is $\text... |
The problem is:
Given 2n distinct endpoints of n chords on the unit circle, count the number of intersections between chords (if k chords intersect at one point,
that point counts as $\binom{n}{2}$ intersections). What is the complexity of this problem as a function of n?
The solution algorithm is given in this paper. ... |
Consider the following inefficient algorithm that decides if there is a path between two vertices s and t of a directed graph G. Show that the algorithm is correct. In addition, analyze its complexity and compare it with the other path between two vertices algorithms (Dijsktra, Bellman-Ford Algorithm, etc.) and explain... |
Is there some one who know any algorithm for word ladder problem with words of different length?
Actually we have some strings with same length and some strings with one length longer but not from any size(any size means: one string with size 10 and one string with size 1000).
any link or advise is acceptable.
my solu... |
I need to perform a spatial index search while also sort the results by one of the dimensions.
Backstory:
I have a map with lots of 2D objects and when the user interacts with the map I need to filter only those objects that are inside the screen rectangle and at a visible distance (not bigger than the whole screen, ... |
Let's say we have a simple connected and undirected graph $G(V,E)$. The game is played with two players. For each game, player A starts at a node $t$, and player B at a node $v$. There is also a node $d$ which is the same for every game.
In the game, player A always plays first. His goal is to reach node $d$ before pla... |
I am trying to understand the purpose of using the instanceof operator as a way to properly downcast an object in java. I really hope someone can help. Below is more code:
public class Test {
public static void main(String [] args) {
Dog k = new Dog();
Animal v = new Dog();
if (v... |
The Hilbert curve and other space-filling curves I've read about seem to have mapping operations from 1-D index to N-dimensional coordinates that are efficient, but amount to a log-ish tree search IIUC.
Are there any space-filling curves that have constant-time conversion from 1-D to N-D space (maybe relying on constan... |
Is $O(T+\log T)= O(T\log T)$?
I think this is true but I do not know how to show it mathematically?
Please show it using the definition.
Also, if it is true, is the following true?
$O((T+\log T)^{1/n})= O((T\log T)^{1/n})$
|
Let T be a tree with root r and S a set with an even number of vertices of T. Design a polynomial time algorithm that finds |S|/2 simple and disjoint paths in edges matching pairs of vertices in S. The following figure shows an example in which S consists of the six vertices enclosed in circles and three paths (denoted... |
I am tring to find the simplest method of generating a random minimum spanning tree.
My intention is to randomly generate a Level in a game where there are n amount of fixed sized rooms existing on a grid which all connect together in a random way.
One method I have come across is to generate random points on a grid ... |
Suppose $x \in \mathbb{R}^d$ and $M \in \mathbb{R}^{d \times k}$.
Why $xx^TM$ requires $O(dk)$ operations?
|
I recently thought of the following problem:
Given a set $A$ of sets find a minimal set $B$ of pair-wise disjoint sets such that each set in $A$ can be expressed as a union of sets in $B$.
For example, if $A = \{ \{ 1, 2 \}, \{ 1, 2, 3 \}, \{3, 4\}, \{4\} \}$ then $B = \{ \{ 1, 2 \}, \{ 3 \}, \{ 4 \} \}$.
I designed th... |
I have a directed graph with vertices $V$, and I need to find a strict subset $U$ of its vertices such that:
$U$ contains at least two vertices, and $U \neq V$
There is at most one vertex in $V \setminus U$ connected to a vertex in $U$
There is at most one vertex in $U$ connected to a vertex in $V \setminus U$
(assum... |
I have two conditions A and B in a form of "ast tree".
How can I check that B is more strict than A?
I.e. if B is true then A is always true.
Example
A:
x = 1 and (b = 2 or c = d)
B:
y = 5 and x = 1 and (b = 2 or c = d)
Does B include A -> true
A:
x = 1 and (b = 2 or c = d)
B:
y = 5 and x = 1 and (b = 2 or c = d)
Do... |
I came across following problem:
Consider following code:
()
{
[] = ;
([]);
/* */
[] = ;
/* */
}
Let flag is declared as Boolean flag[2] and Pi denote one process while Pj denotes other process and i=1-j. Both processes execute concurrently, then does the progress requirement of t... |
Assume that we have an anti-symmetric matrix that consists of 1's and -1's and 0's. All the elements of the main diagonal are 0 and each row and each column has exactly one 1, and one -1. Design an algorithm that replaces all 1's with -1's and vice versa only by swapping some rows and some columns.
|
Given only input and output(e.g. runtime), how do you know if an algorithm is running at O(nlogn) time complexity?
For example, how does LeetCode detect my code is running at O(nlogn)?
https://leetcode.com/problems/sort-list/description/
Sort a linked list in O(n log n) time using constant space complexity.
Here's... |
To be precise I am here for RAW hazard.
Consider a 5 stage pipeline .
In case of $I_4-I_1$ dependency , I am not sure if it is an $RAW$ hazard as $I_4$ does not depends on value of
$R_1$ that $I_1$ gives. and even if it fetches it ,it still be a wrong value as per the instruction sequence as $I_2$ is modifying it. ... |
I'm reading about the algorithm of finding the ranks of all points in a 2D plane, I don't understand the time complexity formula for it. It has four steps:
Compute the median of x-coordinates of all point, and divide the plane into two half Left, and Right.
Recursively do 1. then when there is only 1 point, rank(that ... |
When changing the write enable signal, of a memory element, from 1 to 0, what effect does the pipeline's register's output glitch have? Glitch that all of digital logic has, for the time of propagation delay $t_{pd}$. Won't it cause an unnecessary write?
|
I'm reading the definition of polynomial time reducible:
Let $L_1, L_2$ be two language. If $L_1$ is polynomial time reducible to $L_2$ then exists $f:\{0,1\}^*$ s.t. $\forall x\in\{0,1\}^*$ $$x\in L_1\iff f(x)\in L_2$$
For me this means the $L_1$ may be bigger (in cardinality) than $L_2$, but $L_2$ is more difficult... |
I have several hundred objects that will move in a fixed area throughout the day. Frequently the objects will cross over another object's path, either at the same time (eg. a collision) or within a few seconds or minutes, the time window tolerance. How can I determine how many times that happens throughout a fixed pe... |
We know $P^{NC}=P$ and $FP^{FNC}=FP$ hold. Do $FP^{NC}=FP$ and $P^{FNC}=P$ hold?
|
I don't understand a step in my book proving the fractional knapsack problem:
Let value of items $v_1\ge v_2\ge \dots\ge v_n$, and assume $X=\langle x_1, \dots,x_n\rangle$ are the solution by greedy, where $0\le x_i\le 1$ is the fraction packed into the knapsack.
Assume $j$ is the first index s.t. $x_j<1$. Let $Y=\lan... |
A common left recursion:
A -> Aa | B
can be solve by transforming it into:
A -> BA'
A' -> aA' | E
However, I face another similar yet different left recursion when I'm writing my compiler:
A -> (A|B) a
So, my question is, how to solve such left recursion?
|
In Adleman's 1994 paper (archived), he describes a method of manipulating DNA molecules in a lab that results in a solution to the Hamiltonian Path problem with high probability.
He claims that "The number of different oligonucleotides required should grow linearly with the number of edges", and this makes sense given ... |
I am very new to PROLOG so it might be a very trivial question, but I absolutely have no idea how to solve it. There are 4 sentences I need to formulate into PROLOG code:
All hounds howl at night.
Anyone who has any cats will not have any mice.
Light sleepers do not have anything which howls at night.
John has either... |
Consider these two equation.
$$
m_1+m_2+m_3+m_4 = M_m\\
|m_1|+|m_2|+|m_3|+|m_4| = N_m
$$
where $\{m_i,M_m,N_m\}\in \mathbb{Z}$.
Given the value of $(N_m,M_m)$ we can find the different solutions for $(m_1,m_2,m_3,m_4)$. The solutions are ordered in a particular way which is best explained by giving a few examples.
For ... |
I want to prove the NP-hardness of an scheduling problem. The problem seems to be NP-hard in the ordinary sense, so I am trying with the Partition Problem, precisely the Equal Cardinality Partition (ECP). So we have:
(ECP): Let $X = \{x_1, x_2, \dots, x_{2n}\}$ be a set of positive integers, does there exist a partitio... |
I have a book statement says the title, I don't understand it. From my current understanding if a problem A can be reduced to a problem B then it only means B is at least as difficult as A.
|
I know that DCFL are unambiguous languages and DCFL languages have one-to-one correspondence with LR grammars.
But I wanted to know if there can be an instance that deterministic context free grammar is ambiguous.
|
Does ford fulkerson only use whole numbers? I tried to understand this but without success
Thank you
|
Define an $(m,q,d,k)$-(block) code $C$ to be a code with block size $m$, alphabet $0\ldots ,q-1$, and (non-relative) rate $k$. Meaning: $k=log_q (|C|)$ (if we think of $C$ as a set of legal codewords) ($d$ is the distance which isn't important for this particular question). Such a code could also be thought of as a fun... |
I am attempting to create an algorithm which given the value of $a \in \mathbb{R}$ and $b \in \mathbb{N}$, calculate $a^n$.
So for example, using the Java language pattern, the algorithm will be defined as follows:
public double exp(float a, int n) {
...
}
But I am unable to determine what would be possible sub-pr... |
Is it true that if a given edge e is in the min cut of a graph that there exists a max flow of the graph that has e with its full capacity?
|
I need an algorithm to explore every node in a graph (starting at any given node). Each node can have multiple parent nodes and multiple child nodes.
The following algorithm (in psuedocode) appears to gather every node but results in duplicate nodes (I think because the recursive 'paths' crossover at some points):
rFin... |
I have a list of sorted arrays ("sets") of integers $A_1..A_n$ where each element is unique w.r.t. the other elements in the same array:
$A_i = \{x_{i,1}..x_{i,c_i}\}$
$x_{i,p} < x_{i,p+1}$
$A_i$ has length $c_i$ and the average of $c_i \ll n$. For example in one of the runs, the average $c_i$ ranged from $10$ to $15... |
Assuming that f(n) >= n.
If possible, I'd like a proof in terms of Turing machines. I understand the reason why with machines that run on binary, because each "tape cell" is a bit with either 0 or 1, but in Turing machines a tape cell could hold any number of symbols. I'm having trouble why the base is '2' and not some... |
S-> aAb | aBd
A-> ab | Bd | e
B-> ab | d | f
I am getting a loop during CNF conversion but in question it stated that it's a finite language.
|
So I understand that in every computer, the Operating System, the BIOS, or both will determine the physical addresses of the hardware devices and then translate that into virtual addresses. What I don't get is....how? Is there a special piece of hard drive that contains those addresses? Is there a special assembly inst... |
The definition of weakest precondition is familiar (let me use Isabelle's syntax here):
definition "wp c Q s ≡ ∃t. (c,s) ⇒ t ∧ Q t"
the weakest precondition ensuring Q when executing a command in an initial state s is given by the formula in the RHS.
Now, Dijkstra, for instance in, "Nondeterminacy and Formal Derivatio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.