instruction stringlengths 35 29.1k |
|---|
$$
L = \left\{ \left< M \right>~\middle|~
\small{
\begin{array}{l}
L(M)\text{ is recognized by a Turing Machine} \\
\text{having even number of states}
\end{array}
}
\right\}.
$$
Isn't $L$ same as asking if $L\left(M\right)$ is recursively enumerable (RE)? How is it trivial?
I know what it means for a property to be t... |
I'm recently reading some papers on the maximum independent set problem, all the algorithms' time complexity is donated by $O^*()$ notation, like $O^*(1.0836^n)$. One paper says "the $O^*$notation suppresses polynomial factors in the input size." I'm a little bit confused and couldn't find helpful materials on the Int... |
I am currently working on implementation of semantic segmentation of images neural network, and try to implement one of the already existing solution such as Fully Convolutional Neural Network 1.
Data that I am using is based on Pascal-Context dataset [2], which has additional labeling to original 20-class PASCAL VOC ... |
I'm reading papers on algorithms of maximum independent problem and the basic recursive branching rules is as follows:
Let $G(V,E)$ be an $n$-node undirected, simple graph without loops, and $\alpha(G)$ be the cardinality of an maximum independent set of $G$. If $G$ is empty, output $\alpha(G)=0$(base instance). Other... |
In call by name : In general, the effect of pass-by-name is to textually substitute the argument expressions in a procedure call for the corresponding parameters in the body of the procedure.
Technically, if any of the variables in the called procedure clash with the caller's variables, they must be renamed uniquely be... |
I've recently started learning CNN's. I need a CNN that is specialized for insects detection. Dead insects will be put on a piece of paper / container, then images will be taken from a same distance, and are at same pixels.
I am expecting to prepare my own training datasets:
- Thousands of images of a particular insec... |
Let $L$ a language over $X = \{a\}$ defined as follow :
$$L = \{ a^{n!} \ | \ n \geq 0 \}$$
I want to prove that $L$ isn't regular, I have searched in the forum for an equivalent question, but I found nothing. If it's a duplicate, I apologize and I'll be glad if you provide me the link of the duplicated question.
I'll... |
can someone pls help
How do I prove
2⌊lg n⌋ = Θ(2⌈lg n⌉)
2 ⌈lg n⌉+⌊lg n⌋ = Θ(n2)
I'm not too good at maths.
I know,
lim ( n -> infinty) = f(x)/g(x) if we get a real constant the statement is true.
|
Given an array $A$ of length $N$. There are $Q$ queries, each queries will be in the form
What would be the c-th number in the segment A[l...r] if the array is sorted?
I've come up with an $\mathcal{O}(N\log N+Q\log^3N)$ solution:
Build a segment tree, keeping array A sorted in each subsegment.
Binary search the valu... |
I am having trouble writing the following optimization problem as a linear program (LP)
$$\min_{x \in \mathbb R^2} \big| | x_{1} - a_{1} | - | x_{2} - a_{2} | \big|$$
where $a \in \mathbb Z^2$ is given. I tried adding the following constraints and replacing objective function to min $U$, but it did not work out.
$$x_{i... |
I'm working through a Database Design textbook, and one of the problems involving ER Diagram design is giving me some trouble.
The diagram is for a UNIVERSITY database with the following rules:
1) The university keeps track of each student’s name, a unique student number, a unique Social Security number, address (s... |
I came across following excerpt:
$(x'y'+xy)'z'+(x'y'+xy)z=x\oplus y\oplus z$
What I see is left hand side is XNOR of $x,y$ and on right, $z$ and I get XOR of of $x,y$ and $z$ !!!
In other word,
$XNOR(XNOR(x,y),z)=XOR(XOR(x,y),z)$
Somehow I am surprised by the result, as I didnt came across this earlier, no text sta... |
Standard Hopfield networks exhibit stable patterns (states) which are attractors of a dynamic system. I wonder how to modify standard Hopfield networks such that they exhibit stable limit cycles as attractors. Since for binary neurons (to which I'd like to restrict my question) each attractor is a limit cycle of some l... |
I've proven that the Turing-recognizable languages are closed under concatenation and I need to show that they are closed under homomorphism.
But what's really the difference? Doesn't closure under concatenation imply homomorphism as well? Or perhaps I misunderstand what homomorphism means when talking about Turing-R... |
Recently I encountered some papers in which the most important part seems to be writing an Integer Linear Program for a problem for which there exist some exact or heuristic algorithms!
Is solving an ILP easy and fast in practice? Is this solution exact or approximate?
|
A simple graph with $n$ vertices is constructed by randomly and independently placing an edge between every two vertices with probability $p$. What is the expected number of nodes with degree two?
I was only able to find the probability of any vertex having degree 2. Let me explain what I tried. For any vertex we can ... |
Every function problem has a corresponding decision problem, which is simply the graph of the function problem, according to
https://en.wikipedia.org/wiki/Decision_problem#Function_problems
which reads that the time complexity of a function problem and decision problem underlying decision problem "...may not be consid... |
I am trying to fuse point clouds into one. These Point clouds are acquired from multiple cameras. Below is the detailed information about setup-
Three Kinect v2 sensors are mounted on tripods in such a way that they are making 120 degree angle from each other in a horizontal plane. Hence one can assume that these Kinec... |
we know that SQL standard is equivalent to First Order Logic (FOL). I've seen at my lecture that graph connectivity cannot be expressed by FOL, so in SQL as well. But we know that we can easily solve that problem in PTIME. And I've seem the following table:
Query Language Data Comp. Expression Comp.
FOL ... |
I work with python and images of tables (taken from above). My aim is to take a photo of a random table and then find the most similar tables to it in my database. By most similar I mean tables of similar shape(square, rectangular, round, oval), texture, colour etc.
For now, I am just running a PCA and then a KNN on al... |
I'm trying to learn about Graph Spanners. I have searched for it but unfortunately, I couldn't find any solid helpful resource related to this very topic.
I would highly appreciate if anyone can suggest me any specific book or online material which explains about Graph Spanners in detail.
|
We all know that, at least theoretically, there are several possible models of computation, varying in structure.
Strictly speaking, there are several (not just one) models of computation that exist or have been implemented in real life. Some machines (for example, amplifier circuits), though inexact, can be considered... |
The recurrence equations solved by the Master Theorem are in the following format :
$ T(n) = a T(\frac{n}{b}) + f(n) $
but is it possible to use it on :
$ T(n) = a T(\frac{n}{b}) + c $
?
|
My question is short and straightforward: Can be considered "machine learning" a subarea of "expert systems"?
|
This question is specifically related to
https://stackoverflow.com/questions/3980416/time-complexity-of-euclids-algorithm
The $gcd(x,y)$ is solved in $O(T(n) log n)$, where $n$ is the number of bits of $x,y$, and $T(n)$ is the time to multiply two $n$ bit numbers, as described in
How is the Time Complexity of a Functi... |
I have a problem with a task shown below.
I have I am supposed to use big M method, but I don't know how to estimate/compute the minimal value of it and how to implement it into the equations. Any help would be much appreciated:
Use binary variables to algebraically express the set $Y$ defined as the set of all those ... |
Well, I am following this video lecture (MOOC) and I came across this quiz where I have to convert $(Q\to R)\wedge (R\to Q)$ to sentence.
$Q$: "I will go to town"
$R$: "I have time"
My answer to $(Q\to R)\wedge (R\to Q)$ is
"I will go to town ONLY IF I have time AND I have time ONLY IF I will go to town".
Whereas, t... |
This is the PDA to accept strings with equal number of $a$'s and $b$'s. The $\epsilon$ transition in the first state is causing nondeterminism.
When we have input a with Z at the bottom of the stack, then at the beginning it can do $(a,Z/aZ)$ or $(\epsilon,Z/Z)$ and go to final state, so automaton has 2 choices which ... |
In a nutshell
I found this paper that provides an upper bound for the amount of iterations we expect before visiting the global optimum at least once. (It then uses that number to find a lower bound on the probability of finding the optimum within a given number of steps). The trouble is, when I plugged in some numbers... |
My book says that
If $P < N/2$ then we know that N is the dominant term so we an drop the $O(P )$."
If it was $O(N + P)$ where $P > N/2$ what would it reduce to?
|
I am using KD trees to do nearest neighbour searching. My understanding is that it takes $O(n \log n)$ effort to create the tree where $n$ is the number of points and that it takes $O(m \log n)$ to do nearest neighbour searching for $m$ query points.
In my application, $m$ is in the tens of millions and so most of the... |
I have the following AVL tree and want to AVL-INSERT a node 5 into the tree. Since the middle branch will be unbalanced, I'm guessing that it will require a right rotation, then a left rotation to rebalance the tree. However, what would the actual steps to rebalance the tree look like?
Before insert (balanced):
3
... |
I am using a Hidden Markov Model with Gaussian mixture emissions to cluster a sequential data (I am using hmmlearn in python 3). Initially, I used the log likelihood to find the number of clusters and gaussian mixtures, however, this value kept increasing as the complexity of the model grew (the number of states and mi... |
Given a Deterministic Finite Automata (DFA) $M_1$, does there always exist a Pushdown Automata (PDA) $M_2$ that accepts the same language as $M_1$? I.e. can any DFA be simulated by a PDA? Intuitively, it makes sense to me that a PDA is more powerful since it has an arbitrary amount of memory and can therefore accept ... |
Convert in postfix
(((P+Q)(R+S))/T) +(A(B+C))
note : there is * between (P+Q) (R+s)
My attempt in image and size of stack = 15 given, but iam getting size =13
|
I'm having issues with a question how to identify which instruction are represented by this microcode.
The pc starts at 5000 and 7000 and 7001 have values 31 and 64 - I'm really confused how to approach this wouldn't each line be an instruction?
MAR = PC, PC+1, Assert MAR
IR = MBR, decodes IR
put addr 7000 into ... |
I'm having some issues understanding what happens on a context switch with the physical register file in an out-of-order CPU that implements context switching. Suppose that a CPU consists of 4 hardware thread contexts and that the ISA consists of 32 architectural registers. Does the physical register file get overwritt... |
If A and B don't have parents on a Bayesian network, does that mean we can infer A and B are independent? Whatever the answer is, please explain how you get to it.
|
I'm working to solve a problem based on two non-binary tree graphs, that they need to be iterated together in order to find a valid combination.
I did a basic implementation that works, but it have a few flaws. Let me first explain a bit.
The point is that I have two trees, and each node have "n" children nodes, and th... |
I'm currently studying the B-Trees chapter of Introduction to Algorithms. One of the question from the chapter is:
Suppose that we insert the keys $\{1,2,...,n\}$ into an empty B-tree with minimum degree 2. How many nodes does the final B-tree have?
I think given that a node will have between $t-1$ and $2t-1$ keys, w... |
The main difference between Dijkstra algorithm and Bellman Ford algorithm that all texts (including CLRS) specify is that Dijkstra's algorithm need all non negative edge weights, while Bellman Ford algorithm can work with and detect -negative edge cycles.
However I feel a bit different, especially after coming across ... |
I'm new to LTL and Buchi automaton, and I have a hard time in constructing NBA from the given formula or the property. Could somebody please help me?
The following property is given, P= "Whenever process 1 is in its waiting location (w1), it will eventually enter its critical section (c1).” where AP = {w1, c1}. I have ... |
I came across following problem:
Problem 1
Suppose that minimum spanning tree of the following edge weighted graph contains the edges with weights $x$ and $z$, then what are $x$ and $z$?
The solution given was as follows:
There are two ways to reach node $F$, one from node $A$, other from node $G$. Maximum weig... |
I can't find a mistake in reasoning : Let $M_1$ NTM (Non Deterministic Turing Machine) that solves $L$ in polynomial-time. So then $x \in L \Leftrightarrow M_1(x) = 1$. Finally our new NTM $M_2$ that solves $\bar{L}$ is inverted $M_1$ : $x \in \bar{L} \Leftrightarrow M_2(x) = 1 \Leftrightarrow M_1(x) = 0$. And since ... |
I'm trying to understand the analysis of bucket sort in CLRS. Specifically, equation 8.2 that states:
$$ E[{n_i^2}] = 2 - \frac{1}{n} $$
To prove, CLRS:
Random variable denoting number of elements that fall into bucket i:
$$ {n_i} $$
An indicator random variable that a given element in the input falls into a particular... |
If I understand correctly, the term "consensus" in distributed consensus algorithms means that all the participants ("peers") achieve a common understanding of some data value. Different algorithms can handle different types of failures or misbehavior by some of the peers, network disconnections or partitions, lost me... |
I have been thinking of a problem i have here with a calendar scheduler where i basically want to split a year into seconds and have access to the dataset of whole year.
In this year i assign blocks of time that varies in size can be big or can be small, it has to be placed in non assigned places ( which isnt occoupied... |
What is the difference between a final and accepting state when addressing an automaton?
As I understand it, a final state is depicted (traditionally) with a double circle, and apparently so is an accepting state. So if they are both depicted with the same symbol, what makes a state particularly accepting?
|
I'm trying to assign running times to loops of code to roughly get the upper asymptotic ($O$) running time.
while (j < n2) { # executes n2-1 times
int k = 0;
while ((k < n1) && (seq[k] < seq2[j])) { # executes (n2-1)*n1times
... |
I have slight modification for graphs which has negative weights for finding shortest path . If the graph has all non negative weights then by Dijkstra's algorithm , it can be done in O(VlogV + E) . So for the graphs having negative edge weights , find min(weights) = K and subtract K from all weights so that we end up ... |
I'm trying to figure out a way to think about this problem. Background: Given an unsorted array of distinct integers (can be positive or negative), I want to determine if there is an element in the array that is equal to its rank (i.e. if I do $S = Sort(Array)$, I want to find an element s.t. $S[i] = i$).
Some approach... |
I know that linked list is not a appropriate data structure for building heaps but I am interested in knowing the time complexity of building heaps and heapsort using linked list.
One of the answers here (https://stackoverflow.com/a/14584517/5841727) says that heap sort can be done in O(nlogn) using linked list which i... |
I have a connected graph $G$ with $k$ different colors assigned to $n$ nodes where $k<n$. All edges have unit weight.
I want to figure out an algorithm to find a minimum sub-tree of $G$ that covers all $k$ colors (i.e., such that for each color, there is at least one node of this sub-tree with that color; and minimizi... |
To check some results of an article, I wrote the proposed algorithm from the Coding articles. In the article, some results from the algorithm were obtained. Unfortunately, the performance of my program was very different from what was said in the article.
In the article, results were obtained in 20min but I got quarter... |
This is a school assignment, I am fairly new to DFA's.
L = {ww|w∈{0,1}*
I feel like I need to put this in words to understand how it works.
Translating L:
W can be a string of an infinite combination of 1s and 0s.
WW is just a string that repeats itself.
For example W="101011", WW = "101011101011".
Im not a 10... |
Is it possible for an AI neural net to be able to modify its own parameters/hyperparameters and/or add new parameters/hyperparameters? If so, how has it been implemented? For example, to simulate a human mind, could the net utilize 3 basic emotional parameters before realizing it needs many more and subsequently creati... |
My proof was deemed false because it does not work for infinite regular languages, but I don't understand why.
Prove: "If we remove one string from any nonempty regular set, the resulting set is still regular.
I used to lemmas:
A set containing only one string is trivially a regular language
The union operator is clos... |
I'm working on a problem related to Latin squares, and I want a method for what essentially boils down to the decision problem:
Input: A finite, simple graph G.
Output: YES if G has a non-trivial automorphism, NO otherwise.
Hence...
Question: Is there an efficient algorithm for determining whether or not a graph has a ... |
It is within polynomial hierarchy so I assumed it is decidable. The picture like this further hinted in that direction.
Yet, in a paper on page 2 I read
Satisfiability of [...] is highly undecidable (i.e., $\Sigma^1_1$-hard)
which implies that $\Sigma^1_1$-hard is undecidable. Do authors mean something else by "highl... |
Suppose that I want to compute all the prime numbers between 2 and $n$. The natural way or most obvious way to do so is given below. Let $A$ is an array contain the numbers from $1$ to $n$.
For $j=2$ to $j=\sqrt n$
mark multiples of $j$ from $A$
Running time of this algorithm is $O(n \log n).$ It is easy to see that ... |
I don't even know the right words to describe my problem, so I'll start with an example:
"aabaa", "ccrcc", "ffaff" are equivalent to some extent, because they all have the same length and follow the same formula: twice one letter, once another letter and finally twice the first letter again.
As I said, I lack even the ... |
The PCP-Theorem states that $PCP(log(n), 1) = NP$. So can anyone explain, where $PCP(1,1)$ is located in relation to other classes?
My thoughts:
$P \subseteq PCP(1,1) \subseteq PCP(log(n)) = NP$
Is there some theorem like "$P \neq NP \implies PCP(1,1) ...$"
What is the relation to the probabilistic classes like $BPP$ ... |
There are $n$ points in a plane.
The decision problem is to identify whether there exists a set $S$ of $k$ or less points from the $n$ points such that all $n$ points are at most $d$ distance from the selected set of points.
I am trying to use the sensor coverage problem where the idea is to place sensors in the plan... |
I'm trying to come up with loop invariant for the following program.
k = a[0]
m = 1
p = 1
while p < n:
if a[p] == k:
m += 1
p += 1
return m
I belive this program returns the number equal to the number of occurences of element a[0] in my array "a".
I thought maybe this is a good cadidate:
|{i: 0 <= i <... |
I've been told that if you understand a pipeline then you should be able to make it with any depth, but I can only do 4 stages and maybe 5 if the memory is not too slow. How can I learn how to make infinite pipelines?
|
All we know what is Deterministic Selection Algorithm:
Line up elements in groups of five (this number $5$ is not important, it could be e.g. $7$ without changing the algorithm much). Call each group $S[i]$, with $i$ ranging from $1$ to $n/5$.
Find the median of each group. (Call this $x[i]$). This takes $6$ comparis... |
The book computers and Intractability mentions that Hamiltonian Path problem is not NP-complete in DAG.
But if Hamiltonian Cycle is NP-complete in digraph then I can split a vertex and create two vertices ${s,t}$ which will make the graph acyclic and then ask for $s\rightarrow t$ hamiltonian path in that DAG. These tw... |
I'm reading about the reservoir sampling technique called Algorithm R.
The idea is we can take a sample of size $n$ from a population of size $N$ even when $N$ is unknown/too expensive to retrieve in $N$ time. I quote a sample implementation from wikipedia:
(*
S has items to sample, R will contain the result
*)
Reser... |
I have a directed graph, $G = (V,E)$ (a dependency graph actually) and I want to find groups of nodes that can be considered as a single unit.
I define a group as a set of nodes, $A$, such that any node outside of the group, $v \in A^c$, that has an edge to a node inside, must have an edge to every other member of the... |
So, I'm given an arbitrary set of points $(p_1, p_2, p_3,\ldots)$ with an $x$ and $y$ coordinate. I have no information about the order they're given to me.
I need to write code that will take in a point, $p_0$, and will find the point $(p_1, p_2, p_3\ldots)$ closet to $p_0$. This will of course be found my minimizing... |
Let's say we have given $N$ intervals in the form $[x, y]$, both $x,y$ are integers , we want to find the number of integers covered by at least one interval of all $N$ intervals, (look in the example for better understand).
The intervals may or may not intersect.
Example: Let N = 3, and the intervals: $a_1 = [1, 5],... |
I am looking to solve a variant of the traveling salesman problem with a certain set of constraints:
the graph is not complete, i.e. some nodes are not connected to each other
the weight of an edge between any pair of connected nodes is always 1
What is the best way to model and solve this problem?
AFAIK the Concorde... |
I am trying to implement a rubiks cube solving program,and I am trying to figure out which algorithm to use,so far I have only come up with using breadth first search to find a shortest path from the initial configuration node to the solution node.
Each edge of the graph would be a 90 degree turn of a face of the rubik... |
Is it possible to solve the FACT (integer factorization) problem in polynomial time if we know the polynomial Subset Sum algorithm?
We assume that we know the algorithm solving the problem of Subset Sum with complexity: $n ^ 4 \cdot m ^ 4$ (for example), where $n$ is the number of elements in the set, and $m$ is the si... |
Given this definition of weak bisimilarity:
A configuration relation $\mathcal{R}$ is a weak bisimulation
provided that whenever $P\ \mathcal{R}\ Q$ and $\alpha$ is $\mu$ or $\tau$ action then:
$P \to^\alpha P'$ then $Q \Rightarrow^\widehat{\alpha} Q'$ for some $Q'$ s.t. $P'\ \mathcal{R}\ Q'$
$Q \to^\alpha Q'$ the... |
Given 2 sets of Vectors in 3 dimensional space: A and B, what are the fastest algorithms to find the vector in set A furthest from any in set B?
|
It's been a long time since I've studied time complexity in school, but I've been tasked with finding the time complexity of an algorithm. Here is the algorithm in a pseudo-pseudocode (yes, two pseudos because I'm not good at creating pseudocode. Haha!).
main()
{
list = methodImportFromCSV(...) // Don't care abou... |
Reference: Page 4 of this document
Given two polynomials $p(x)$ and $q(x)$ each of degree $n$ represented in coefficient form, it takes $\mathcal{\Theta}(n)$ time to evaluate given some input $x$.
In the reference linked, in order to get product of these two polynomials, $c(x) = p(x)q(x)$, via brute force, we have to c... |
Let's consider bit string as a program for some computational model. If after $k$ steps program represented by number $n$ halts and outputs bit string $s$, then complexity of s is (n+1)*k. For example complexity of result of program $101$ after 3 steps is (5 + 1)*3 = 18. Have this or similar complexity measure been stu... |
is the string aabb in the language of this Turing machine ?? as upon reading aa it goes to the final state but upon b there is no transition defined so won't it result in a dead configuration?
|
I have to solve the following recurrence equation and I thought to solve it with case #3 of the master theorem. Can I do that?
$$T(1) = c>0 $$
$$T(n) = 9T(n/3) + f(n)$$
$$f(n) = n^2\cdot lg^3 (n) + n^3 \cdot lg(n)$$
I think that $f(n) = \Omega(n^{log_ba})$ where $a=9, b=3$ so $n^{log_ba}=n^2$.
Since $f(n) = n^3 lg(n)$... |
I'm looking for a clever algorithm to generate a list of all possible graphs with maximum degree D and diameter at most P such that any two graphs of this list are not isomorphic. Any ideas ?
|
I want to add a points one by one into sorting tree. I have less then function to order them by angle from absciss: for points $\mathbf p_i = (x_i,y_i)$ and $\mathbf p_j = (x_j,y_j)$ it just sign of cross product of radius vectors to them:
$$
f_<(\mathbf p_i, \mathbf p_j) \stackrel{def}{\equiv} (x_i \cdot y_j < x_j \cd... |
A perfect natural number is that which is equal to the sum of it's divisors.
For example 6 is perfect: 1+2+3=6 also 28 is perfect.
Prove the following language is NP hard:
L={< n> | n is a perfect natural number}.
You can use the fact that if
$$n=p_{1}^{m_{1}}p_{2}^{m_{2}} \cdot \cdot \cdot p_{k}^{m_{k}}$$
where $p_{... |
I have a list. I have to find median of absolute difference of all pairs of array.
Eg - A={1,2,10}
Difference for all distinct pairs :
1-10=9
1-2=8
2-10=8
The new list is A'=[8,8,9] and the median is 8.
Now I took all the pairs and made a list with difference of them and median is A'.length()/2th element i.e. 8.
But... |
I was reading a book about compiler design, then in the CFG section, they introduced the dangling-else problem. They offered to match the the else with the last if. I still don't see how this solves the problem. Can somebody give me an explanation?
I searched before I put the question and none answered my question
|
I am working on the famous maximum independent set problem on a graph class called progressive $k$-partite graph, and it is defined as follows.
Given a graph $G = (V_1, V_2, \dots, V_k, E)$, where $V_i\ |\ i \in \{1,2,\dots, k\}$ are the partitions and $E$ is the edge set. We assume that the vertices of each partition ... |
Reading up on TTA CPU designs and the wikipedia article states that
Some TTA implementations support conditional execution.
The trick to make an TTA ISA Turing-complete with an unconditional MOV instruction escapes me. Can anyone explain how that would work?
(or share some resources where it is explained)
|
How do I efficiently find the median of $k$ sorted arrays each of length $n$? Note that the total number of elements will be $nk$. I know it can be done in $O(nk \log k)$ time using merge technique. Is there a more efficient algorithm?
For two arrays it can be done in $O(\log n)$ time, but I can't see how to apply that... |
Lets say, we have a lot of lists (sequences of variable length) of some limited set of elements:
[A, B, D, E, Q], [A, D], [A, C, E, F, G, H, Y, Z], [B, A, E, D, Z, Y], ...
The problem is to get the single order, based on "how typical" some position is, eg, in our case it can be (coincidence with alphabetical order is ... |
I couldn't figure out how to answer the following question:
Suppose we want to transmit a string of 3 ASCII characters, and in order to be able to detect or correct the message, we append the sum of the chars at the end of the binary string. e.g.:
encode("abc") == `110000111000101100011100100110`
what is the distance... |
Given L is regular, Prove/Disprove that the following language is regular or not.
$EXP = \{w| w^{|w|} ∈L\}$
|
Consider the family of graphs of degree $6$ with vertex set $V_n=(a, b, c)$ for all $0\leq a, b, c \leq n-1$ with $(a,b,c)$ being connected to $(a-1, b, c),(a+1, b,c), (a, b-1, c), (a, b+1, c), (a,b,c-1), (a,b, c+1)$, with all operations modulo $n$. Show that this is not a family of expander graphs.
I've been strug... |
Assume a language with statements such as $x := e$, $\text{assume}(e)$, etc., and particularly a $\text{split}\ stmt_1 ... stmt_n$ statement, constructed from $n$ statements. Informally, the semantics of this statement is that each statement is evaluated separately, and if exactly one such evaluation terminates (i.e. i... |
Would this proof work?
Given a language $L$ that is Turing recognizable and a TM M that recognizes it and a homomorphism $f$, we build a NTM M' that recognizes $f(L)$,
M' looks like this:
On input $w$ :
-Non-deterministicly feed words from $\Sigma^{*}$ to $f$ until you obtain w.
-run M on $f^{-1}(w)$, if M accepts acc... |
Let's say we have a directed graph with $n$ nodes and $m$ edges. For each node we want to make path that will start from this node, possibly traverse some other nodes and finish in the same node, in other words we want to make a cycle through each node. It is allowed to add edges that start and finish in the same node.... |
I'm analyzing a piece of code that has a recursive call inside a for loop such as:
def fun(n):
for i in range(0, 256):
if ( n > 0):
fun(n-8)
(I only included a general piece of code not the actual version)
It is my understanding that a recursive call gets assigned T(n) = T(n-8) but what happe... |
Let MULT$=\{a\#b\#c| a,b,c \text{ binary natural numbers and } a\times b=c\}$
Prove that MULT $\in L$
How do I show that this language, MULT, is computable in Logarithmic space?
Let us assume a#b#c is on the input tape, we now need away of multiplying a with b and checking if the product is c, while using only $log(n)$... |
input: n-bit integer X
output: list of prime factors and their multiplicity
acc = X
for i = 2 ... sqrt( X )
--count = 0
--while acc % i == 0
------acc = acc / i
------count = count + 1
--if count > 0
------print i (count)
I know that for the worst case, a n-bit integer is 2^n maximum.
So the time complexity for for i =... |
I'm having trouble proving Hoare logic questions as I'm not sure of the process that is taken to prove them. I understand that they're rules such as assignment axiom, pre-condition strengthening, post-condition weakening etc... but how you actually apply these rules to the question is a little out of my understanding.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.