instruction stringlengths 35 29.1k |
|---|
I know that $\{a^nb^n : n\geq 0\}$ is a non-regular language. Would adding another $a$ so that it is $\{ a^{n+1}b^n : n \geq 0\}$ change things? Would this still be a non-regular language?
|
I need to create a specialized text editor capable of handling text up to billions of characters long, with no line breaks.
I've read of multiple data structures to manage the text itself, including ropes, zippers, piece tables, gap buffers, and more.
However, I also need to support annotations on the text. Like commen... |
In the lecture notes, our professor mentioned that we can take down the space taken by the FW algorithm from $O(n^3)$ to $O(n^2)$ by dropping all the superscripts in the matrices (i.e. use one $n\times n$ array $D$).
I just want to check my understanding, is it because by default $D^k=D^{k-1}$ except for the values $i,... |
Which of the following cache designer guidelines are generally valid?
The shorter the memory latency, the smaller the cache block
The shorter the memory latency, the larger the cache block
The higher the memory bandwidth, the smaller the cache block
The higher the memory bandwidth, the larger the cache block
As per m... |
I've been given the following problem in an interview (that I've already failed to solve, not trying to cheat my way past): The game starts with a positive integer number $A_0$. (E.g. $A_0 = 1234$.) This number is converted to binary representation, and $N$ is the number of bits set to $1$. (E.g. $A_0 = b100\ 1101\ 001... |
Currently studying for an Automata Theory final and can't find an answer to this question anywhere.
Can you simply let w = w!w and show that it is undecidable that way? Like this here: How do I show that whether a PDA accepts some string $\{ w!w \mid w \in \{ 0, 1 \}^*\}$ is undecidable?
Or do I have to show decidabili... |
I am trying to prove that there are a language is not BPP-Complete. There are a couple of examples online, but they are not the best examples and are a bit complicated. I spoke with one of my computer science professors about the problem and he proposed the following proof sketch:
Proof (sketch):
We know $A_{TM} \le_m ... |
The language $A_{PTM}$ is defined as the acceptance problem on a Probabilistic Turing machine.
$A_{PTM}=$ { $<M, x> | M$ on input $x$ accepts with an error probability less than or equal to 1/3}
Basically, given a probabilistic Turing machine $P$ and string $x$, a decider $D$ simulates $P$ on $x$ and outputs accept if... |
There are plenty material about bidirectional search with non-negative edge weights. One example is this paper. I am looking for any improvements using a bidirectional approach for acyclic digraphs with possibly negative weight edges.
The main approach for mono-directional search on possibly negative edge weights is Be... |
Suppose someone will prove lower bound (for NTM) for co-NP, say exp(n/d) for some constant d. Would it in some way imply lower bound (for DTM) for NP?
Thank you
|
I want to prove that the class of all Turing machines that use a logarithmic amount of space is closed under concatenation. The basic idea of my proof is this: given a word, to check if it's in $L_1L_2$, simply look at all possible $n+1$ ways to slice the word into 2 parts and check if the first part belongs to $L_1$ a... |
After looking at the definition of nondeterministic TMs, it seems that, while guessing, the machine could go to at most $|Q|\times | \Gamma |$ configurations, being in a particular one.
However, if we look at several concrete NTMs, the guessing part depends on the size of the input, i.e. it's not bounded. For instance... |
Most times I encounter this random metaphors for metaheuristic optimization they seem like a modified genetic algorithm to me. What do you think? Is there a way to remove the analogies/metaphors to better compare algorithms?
|
the following pseudo code returns the nth Fibonacci number:
if n = 0 then
return 0
a ← 1
b ← 1
for i = 1 to n − 1 do
c ← b − i
b ← c + a
a ← c + 2*i + 1
return b
I am trying to find any loop invariant for the variables a and b, (as i understand it has to be valid before and after the loop, but ... |
Berge's theorem: a matching $M$ is maximum if and only if the graph doesn't have an augmenting path with respect to $M$.
I don't understand this theorem. For instance the following matching is maximum but has an augmenting path, doesn't it?
The matching $M$ is in gold here and the augmenting path is the one in dotte... |
We can represent a simple connected graph $G$ using mathematically as adjacency matrix, $A$. There are other matrices related to the graph which is very useful is the Laplacian matrix $L=D-A$ where D is the diagonal matrix contains the degree of the nodes. It is mentioned that spectrum of the Laplacian matrix is useful... |
Full disclosure: I am trying to understand an answer from the Stanford Automata MOOC.
Why are states F and G equivalent here, such that they would get merged in a minimization process? They both differ on their transitions on 0, so I thought they were distinguishable?
0 1
->A E D
*B A C
C G B
D E A
*... |
Suppose there is algorithm that has a strong NLP module. Could it use the NLP module to read text books such as http://www.amazon.in/Artificial-Intelligence-Modern-Approach-Prentice/dp/0136042597 in text form, parse it, understand the semantics and then use the knowledge to improve the very code it's written in ?
Like ... |
I have a map, which is broken into adjacent regions. Regions do not overlap. Regions are of complex shapes (they are administrative districts).
I want to display these regions on Google Map. But the problem is that the regions are of very different sizes. If zoom level fits largest regions into map frame, then there ar... |
I'm reading the chapter on dynamic arrays in The Algorithm Design Manual book. Here is the excerpt from the book:
Actually, we can efficiently enlarge arrays as we need them, through
the miracle of dynamic arrays. Suppose we start with an array of size
1, and double its size from m to 2m each time we run out of sp... |
The title seems a little vague. So let me explain the question in detail.
Suppose you have a data base. Each record in the data base is $<\mathbf{x},data>$, where $\mathbf{x}$ is an $n$-dimensional index vector.
A query is also an $n$-dimensional vector $\mathbf{y}$. So given the query $\mathbf{y}$, the data base will ... |
Consider a simple grammar and its derivations. The derivations could be done in leftmost or rightmost patterns and can also be done in no particular order as the derivation order has no effect on the language generated by a grammar.
Apart from practical considerations, such as implementation difficulty and orderliness... |
The usual way one trains a neural network is to give it some input and provide the correct classification.
But what about letting the neural network produce its own inputs, and then classifying those?
Imagine the following "algorithm".
Use a neural network to generate 2 images (random at the beginning)
Let the user pi... |
Given a 2-SAT problem that is satisfiable. The solution to the problem can be found in polynomial time.
Adding an additional constraint:
The maximum number of positive literals that can have the boolean Value 1 is N. (i.e. a=positive literal, ~a=negative literal)
Is the problem still solvable in Polynomial time?
My a... |
How can one prove that a shunting-yard algorithm always returns a correct expression in RPN? I cannot find any proof in the internet.
|
Suppose we have a similarity measure s : String x String -> [0, 1] and sets K, L in String with |K| <= |L|. The task is to find an injection f : S -> T such that Sum({s(k, f(k)) | k in K}) is maximised. That is, f should be an injection which maximises similarity.
My naive approach would be to compute all the similarit... |
I am having a difficult time understanding big-O notation for the growth of functions. My textbook says the following.
Example 2 shows that $7x^2$ is $O(x^3)$. Is it also true that $x^3$ is $O(7x^2)$?
Solution: To detemine whether $x^3$ is $O(7x^2)$, we need to determine whether witnesses $C$ and $k$ exist, so that $... |
When reading about data types, "type definition" is often used without any prior explanation to what it means.
For example, in https://en.wikipedia.org/wiki/Type_system, we have the sentence "... since C++ has stronger rules regarding type definitions ..."
Any help in clarifying what the difference between, for examp... |
A language $L$ is in NP if and only if there exist polynomial $q$, and a deterministic polynomial Turing machine $M$ such that, for all $x\in L$, there is a string $y$ such that $|y|\leq q(|x|)$ and $M(x,y) = 1$.
My question is is it possible to exchange $M$ for a finite automaton?
Thank you
|
I have a confusion related to an algorithm for finding the orientation given three points, i.e., determining whether one line is clockwise or counter-clockwise of another.
Let's say the points are $P_1=(x_1,y_1)$, $P_2=(x_2,y_2)$, $P_3(x_3,y_3)$. The algorithm says
Let the slope of line $P_1P_2$ be $m_1$ and slope of ... |
Cormen and others in their book on algorithms in chapter "15 Dynamic Programming" repeat again and again that we need to prove that "a problem exhibits optimal substructure". A problem exhibits optimal substructure iff (if a solution to a problem is optimal, then each of its subsolutions to a corresponding subproblem i... |
Given an undirected graph $G=(V,E)$ and a weight function $w:E\to\{1,2,3,\dots,10\}$:
Let $U\subseteq E$ the set of all edges $e\in E$ that has a cycle in $G$ such that the cycle contains $e$ and all the edges in the cycle are not of heavier weight than $e$.
Find an algorithm that computes $U$.
I have found an algorith... |
You are given n nonvertical lines in the plane, labeled $L_1, ..., L_n$, with the $i^{th}$ line specified by the equation $y = a_i x + b_i$.
We will make the assumption that no three of the lines all meet at a single point. We say line $L_i$ is uppermost at a given $x$-coordinate $x_0$ if its $y$-coordinate at $x_0$ ... |
In the beginning of the Princeton algorithms course the Dynamic connectivity problem is presented (quick-find, quick-union). Here is how it's described:
The input is a sequence of pairs of integers, where each integer
represents an object of some type and we are to interpret the pair p q
as meaning “p is connected... |
There's an interview question.
In my opinion, os can calculate cache hit rate and miss rate(with the total running time of process and the number of transfer of block of memory to cache).
But how can know the size of cache? Is it possible to calculate with os's certain information? (such as size of transfer size to cac... |
Sorry if it is an obvious question, since all my searches lead to "clearly 0-BPP=P" (like Papadimitriou text book or Complexity Zoo). I understand that any P machine can be seen as a 0-BPP machine with a 0-assignment function that assigns exactly 0 or 1 to any non deterministic choice, which makes P a subset of 0-BPP. ... |
I start to learn artificial neural network and all introduction that I have found on internet present architecture with a number of input variable, so the input layer has the same number of "neurons" as number of variable. Then a number of neurons in hidden layers and only one output neurons.
Does it make sense to hav... |
Undergraduate math student here attempting to understand neural networks. Picked up a text on sale, "Neural Network Learning and Expert Systems" (Gallant), and I'm just starting on the exercises for chapter 1.
The full question is:
Prove that a network is a feedforward network if and only if its cells are numbered in ... |
What's the difference between the Cartesian product in set theory and in relational algebra?
The Cartesian product in set theory is defined as:
$$A \times B = \{(a, b) \mid (a \in A) \land (b \in B)\}$$
I think this is exactly how it works in relational databases, but Wikipedia tries to make a difference that I don't u... |
I'm taking a computational structures course and we just started going over context free grammars. I was confused when I started seeing lambda productions. What are they? Can't seem to find an answer anywhere.
|
Many programming languages support a "regular expression substitution" operation: if r is a regular expression and s, t are strings, sub(s, r, t) finds the first substring of s that matches the regexp r and replaces it with t.
Can this operation always be represented as a finite-state transduction? In particular, are ... |
I am performing some inter-procedural abstract interpretation to capture certain program properties. Following the standard way, what I am doing is to maintain a work list of to-be-analyzed functions, and pick one from the work list to perform intra-procedural analysis until the work list is empty.
Currently, I observe... |
I am looking for Input/Literature on
a readable way to represent words (which are accepted by automata)
an Algorithm, that constructs the Representation
For example, a word $w$ might contain a subsequence $v$ which is repeated $m$ times, i.e. $w= u \, \underbrace{v\cdots v}_{100} \,x$ where $u,v,w,x \in \Sigma^*$
In ... |
Over the last couple years, I built a mechanical computer powered by marbles and made a game out of it. It's similar to the old Digi-Comp II, except for two key differences:
Parts are repositionable on the board.
You can connect multiple 'bits' together using gears. When one of these bits is flipped, it flips the oth... |
I am reading a proof on CLIQUE is NP-Complete. The first step is of course to show that CLIQUE is NP.
c is the clique certificate
V = “On input $\langle\langle G, k\rangle, c\rangle$:
Test whether c is a set of k different nodes in G.
Test whether G contains all edges connecting nodes in c.
If both tests pass, accept... |
Is there a way to show $\{a^nb^nc^n:n\geq0\}$ is not regular without pumping lemma?
|
Let $a: \{0, 1\}^* \to \{0, 1\}^*$ be a $1$-way function and $b: \{0, 1\}^* \to \{0, 1\}^*$ be a $1$-way permutation.
Now, it makes intuitive sense to me that $a \circ b$ should be a $1$-way function, but I am having problems formalizing this. What would a rigorous proof of this look like? Or are my intuitions wrong an... |
I hope this question is close enough to CS to be posted here. I need to write a method that will compute the perimeter of a simplex
https://en.wikipedia.org/wiki/Simplex in any dimension given only the coordinates of its vertices. Is such a function even possible? I have tried going for it, but ended up with loads of n... |
By using Lamport timestamps, we can determine the causality of messages. It is however unclear to me how one would deduce this simply from the lamport timestamp of the message.
Take the following model situation: there is a casuality break when it comes to process 2:
Now, we add Lamport clocks (hopefully I have done t... |
Is it possible directly to reduce clique to set cover?
I know that there are some ways of direct reduction from Clique to Vertex Cover and from Vertex Cover to Set Cover, so I am very interested to know if the is a way to reduce clique to set cover directly without the use of the transitive rule.
|
What is the asymptotic behaviour, in Θ notation, of the smallest function that for any $n_1$ and $n_2$ satisfies the following:
$$t(n_1+n_2)≥t(n_1)+t(n_2)+c·\log_2(1+n_2)$$
where $n_1≥n_2≥1$ and $t(1)=1$
I tried to see what happens if $n_1 = n_2$:
$$t(2n)≥t(n)+t(n)+c·\log_2(1+n)$$
$$t(n)≥2t(n/2)+c·\log_2(1+n/2)$$
Also ... |
I have a scheduling problem that I am not sure is a known variant with known algorithms. It does appear like bin packing problem at first, but after imposing the constraints, I am not sure what it becomes.
There are $n$ atomic Jobs, $J_1, J_2, ... J_n$, each with same length, say 1-hour.
These jobs have weighs, $w_1, w... |
I want to prove that if we have a model, $A$, with unbound number of tapes, then
$A$ is stronger then Turing Machine model. Can you help me with example of such a language that $M$ will fail but $A$ will give an output? thanks.
|
Given a set of permutations $P$ of size $n$, is it possible to create a data structure that, given a sequence $s$, returns $p \cdot s$ where $p \in P$ such that $p \cdot s$ is canonical wrt. $\{\,q \cdot s \mid q \in P \,\}$ faster than $O(n)$ time?
By canonical, I mean for example such that $p \cdot s$ is lexicographi... |
Given a system of $m$ equations in $n$ boolean variables:
$$\begin{align}
a_{11}x_1 + a_{12}x_2 + \dots +a_{1n}x_n &= b_1\pmod2\\
a_{21}x_1 + a_{22}x_2 + \dots +a_{2n}x_n &= b_2\pmod2\\
&\;\vdots\\
a_{m1}{x_1} + a_{m2}x_2 + \dots +a_{mn}x_n &= b_m\pmod2
\end{align}$$
Where all $a_{ij}, x_i$ and $b_i$ are $0$ or $1$, I ... |
In what follows $K(x|y)$ is conditional Kolmogorov complexity, $xx$ is $x$ concatenated with itself. It appears to me that $K(xx|yy)=K(xx)$ should be true for infinitely many strings $x$ and $y$. In fact, it seems this should be true "generically" (in some appropriate sense). How hard is this to show (if true)?
|
I am attempting the question below:
Assume a set of processes $P_1, P_2, P_3$ and $P_4$ arrive at different times in the ready queue. The table below shows the burst time, the priority (smallest priority number implies highest priority) and arrival time for each of the processes.
\begin{array}{|c|c|c|c|}
\hline
Proc... |
I learned in class that perceptrons cannot simulate the XOR operation. My professor told me that one fix was to left the points onto a higher dimensional space. That is pretty obvious, you just use the feature $x_1x_2$. He also said that you can use multiple weighted hyperplanes and nonlinear functions to do so. I'm no... |
I had this question in an interview recently. I was unable to answer this question and would really like to start a discussion on how to approach this problem and get the most efficient solution.
You have this matrix. You want to print out how many islands are in the matrix. Assume water is surrounding everything outsi... |
In modern computer architecture, pipeline has stage that access memory for normal data and instruction in parallel.
But datas and instructions are usually in same memory, and their access address is different.
But how pipelined cpu can access them in parallel? Are the memory has two address port for read data and ins... |
I have an example from a textbook using a language $L = \{ a^nb^ma^n : m, n \ge 0, n \ge m \}$.
We can use pumping theorem to show that $L$ is not context-free. If it were, then there would exist some $k$ such that any string $w$, where $|w| \ge k$, must satisfy the conditions of the theorem. We show one string $w$ th... |
This is tangentially related to a question I asked on the math stackexchange.
I read in a proof that if
$$
\begin{align*}
L_1 &= \{w ∈ \{a, b, c\}^* : \text{$w$ has the same number of $a$, $b$, and $c$} \}, \\
R &= L(a^* b^* c^*),
\end{align*}
$$
then $L ∩ R = \{a^nb^nc^n: n ≥ 0\}$.
Now unless I'm fundamentally misund... |
I have done some reading on these two types of PDA and, to my layman eye, it looks like one simply 'wraps' an empty stack PDA with some extra transitions to create the final state PDA. Since these are empty string transitions and are just pushing/popping the stack bottom marker, does the set of languages a final state ... |
I have a file containing ordered binary numbers from $0$ to $2^n - 1$:
0000000000
0000000001
0000000010
0000000011
0000000100
...
1111111111
7z did not compress this file very efficiently (for n = 20, 22 MB were compressed to 300 kB).
Are there algorithms that can recognize very simple structure of data and compress f... |
I am trying to show that the following problem is P-complete with respect to LOGSPACE reductions: given a Turing machine $M^*$, an input $x$ for that machine, and a number $t$ in unary, does $M^*$ accept $x$ in $t$ steps?
To do that I want to compute an upper bound on the time complexity of some TM $M$ in P on input $x... |
Hello I need help with xy xor z, do I do the logic AND first or the XOR, no parenthesis. Thank You
|
If I have a Global miss rate of all caches of a total of 5.41% and the miss rate of a single level cache of 9.13%, how can I effectively calculate how much the second level cache miss rate need to be?
I found this where it says that the Local miss rate equals misses in a cache divided by the total number of memory acce... |
I just came across the maximum zigzag sequence problem, defined as follows:
A zigzag sequence is defined as a sequence of numbers such that the difference between two consecutive numbers alternates between positive and negative.
Given a an array of N integer number, find the length of the longest zigzag subsequence. A... |
How do we differentiate these classes of problems?
|
A language $L$ is deterministic context-free if and only if there is a
deterministic push-down automaton M such that $L = L(M)$.
According to the answer key of this quiz, the above statement is false. Which is odd to me, if a context free language is one that can be defined by a pushdown automata, would a determini... |
This was a solved example given in my textbook. When I tried to solve this, I got a different TM that was given as the solution. I tried running a sample string through my TM, and somehow got the correct answer.
Still the answers dont match. Please let me know if there isvsomething I've missed.
This may sound a simp... |
This is a problem that I think is a reduction from the halting problem. I have on two separate practice exams statements that,
Given a Turing machine T and a string w, to determine whether T will halt when started on input w.
and
Given a Turing machine T and a string w, to determine whether T will halt when started ... |
I recently came to see that this library sparselsh uses random projection to perform locally sensitive hashing of documents.
The proof is such that based on cosine similarity to the vector. In other words if the dot product of a random projection vector and a feature vector > 0, it would mean that the angle is obtuse ... |
What are the benefits and cons of using an assembler, rather than programming directly into hexadecimal or binary code?
|
Suppose $y=f(x,p)$ while $x$ and $y$ are variables and $p$ is the parameter (all in vector form), and $f$ is an explicit nonlinear function. We have:
$$y_1^{(1)} = f(x_1^{(1)},p_1), y_1^{(2)} = f(x_1^{(2)},p_1), ..., y_1^{(n_1)} = f(x_1^{(n_1)},p_1)$$
$$y_2^{(1)} = f(x_2^{(1)},p_2), y_2^{(2)} = f(x_2^{(2)},p_2), ..., y... |
First - I've seen and thoroughly read all the similar questions. None of them solves my problem. I've read them all, and seen lectures and asked my Prof but no one was able to answer. They all at most give a mathematical answer, but can't give a real example.
In CLRS 3ed pg 155 we have "The running time of MAX-HEAPIFY ... |
Show that, given a tree node a, the time complexity of calling k times to Successor() is $O(k+h)$, where $h$ is the tree height.
I understand that we're passing by at least $k$ nodes, but how I can prove that in all these calls we do not iterate over the tree height (at most)?
|
I am learning about Karatsuba-Ofman multiplication. I don't quite understand how to multiply two numbers with odd length.
Let's take two 3-digit numbers $a = 234; b = 857$ with base $B = 10$ and length $n=3$.
The first step is to split split $a$ and $b$ at position $n/2$. However, since $n=3$ where do I split it? Does ... |
I starting to learn about artificial neural network.
I already did some simple things for classification, with different hidden layer.
I would like to know :
Is there a way to create "communication" (synapse) between neurons of the same layer ?
If yes how will work the back-propagation ?
Thanks a lot
|
Im writing an algorithm to determine highly composited numbers.
But it's very unefficient with $\Omega(f(n)) = n³$.
Does someone know how i can make my code more efficient. Is my approach ok?
Here is my code:
import tools.Tools;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.TreeMap;
public... |
In this question it's stated that dynamic array wasted space is O(n). Here is the explanation why:
Because, when a dynamic array is full, its size is increased by some
factor α. This means that, immediately after growing, a dynamic array
holding n items has size about nαnα, so the amount of wasted space is
n(α−1... |
I am at a loss when it comes to understanding how Grover's Algorithm gives any useful information. Suppose we have a 4-qubit states (|0⟩ to |15⟩), and we are searching for the state |3⟩. The oracle would thus be
O=I−2|3⟩⟨3|
And then, at the end, after all the amplitude amplification steps, we would get the state |3⟩ w... |
Given two strings $x$, $y$, both of length $n$, what is the probability that $K(x|y,n)=K(x|n)$ ? (Bounds on this probability would be very interesting too). Here $K$ is Kolmogorov complexity, $x$ and $y$ are sampled from uniform probability distribution over strings of length $n$, i.e. $P(x)=\frac{1}{2^n}$ for all $x$.... |
As part of an assignment I have to write a PRNG using a sin (or any other trigonometric function) and a saw function which I'm struggling a bit with. So how would you find a good saw function with about equal distribution?
This is what it is supposed to look like:
There are two functions I've got now,
y=(seed/1000*sta... |
I'm having a hard time finding any prominent applications of Petri nets in the industry. Can you name some, or are Petri nets still just an academic curiosity?
|
It is possible to replace the fully-connected layers of a CNN with convolutional layers, making it fully convolutional. Fully-convolutional networks (FCNs) can be applied to inputs of various sizes, whereas a network involving fully-connected layers can't. Still, for the input size the network was designed for (e.g. 22... |
I'm currently doing an exercise that asks to prove that Standard-Heapsort requires at fewest $\frac{1}{8} n \log(n) - O(n)$ comparisons, in its best case.
In its average case, Heapsort only requires $2n\log(n) - O(n)$ comparisons, although I don't know how to prove the best case scenario.
Can someone possibly hint me w... |
How can this be? I don't think it is actually possible for a non-regular language to be a subset of a regular language. What examples are there where this is true?
|
TL;DR Our mind is a superior meta-machine learning algorithm, it can figure out tradeoffs in a much more general case than any machine learning algorithm we have. Furthermore, its Kolmogorov complexity is 4MB or less, and thus should be fairly easy to discover. However, despite our best efforts, no algorithm we've disc... |
If a binary tree is both a max-heap and an AVL tree, what is its largest possible number of nodes, assuming all keys are different?
|
I recently encountered a problem which goes like this :
A student is given N number of questions and T time in total. Each question requires different time to complete and carries different marks. The problem asks to find the maximum marks the student can get by attempting some of the N questions within T time (Assumin... |
Prove that $L\in NC^1$ iff there exists a sequence of poly sized formulas that decides $L$.
I managed to prove the $(\impliedby)$ and I want to prove $(\implies)$.
I feel that we need to take the boolean circuit and duplicate the sub-circuits of $fan-out\gt 1$ into exact circuits but with $fan-out = 1$. I fail to argu... |
Given a 2HornSAT problem. Its possible in linear time to find the minimum solution to the problem i.e. that has minimum number of variables set to 1 in the solution.
Now let us consider another variant of the problem:
Given a positive integer K, is there a solution to the 2HornSAT such that exactly K variables are set ... |
I have a complete graph G which is directed. In essence, a node is connected to all other nodes in the graph. Also, for every pair of nodes, say v and u, there exists two weighted edges one from u tov, and another from v to u.
Under such a configuration for the graph, if I use prim's algorithm, will the algorithm give ... |
I'm having problems trying to understand the concept of loop invariants.
I have the following code, where M and N are predefined constants.
a = 0
b = M
c = 1
while M - c * N >= 0:
a = c
c = c + 1
b = M - a * N
print(a, b)
I have figured out this code is actually a division algorithm, where in the end prints out ... |
I'm trying to solve the following problem.
Input
positive integers $v$, $b$ and $\ell$. ($\ell\leq v\leq b\ell$.)
Output
A list $S_1, \dots, S_k$ of all possible integer multisets (a generalization of the concept of a set that, unlike a set, allows multiple instances of the multiset's elements), such that each $S_i$ ... |
I am somewhat puzzled by the definition of the inverse of the Ackermann function: The normal Ackermann function $A$ can be used to define a function from $\mathbb{N} \to \mathbb{N}$ via $A(n, n)$. The inverse of this function, denoted by $\alpha$, is known as the inverse Ackermann function.
My problem is: Only bijectiv... |
Given a tree, where each node holds a unique number, each of these numbers is represented in $O(log\,n)$ bits. Describe an algorithm to calculate the greatest number $K$ there is.
I would like to get help with understanding the following :
"The number of all bits in all messages needs to be $O(K\times n \,log\,n)$ but... |
Basically, the problem is that I always thought that the (unnormalized) $k$th order empirical entropy $n\cdot H_k(x)$ (see "Backround" at the end of this post for more information) for a given string $x$ of length $n$ equals the entropy of the empirical distribution on the set of all words of length $n$ (the conditiona... |
Is it the case that every problem computable by a Turing Machine can also be represented by some kind of equivalent n-tape Turing Machine which one has only one state? (We can assume that the accept and reject states are implicit here. If that bothers you, you may think about this as a question about 3-state machines ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.