instruction
stringlengths
35
29.1k
I have a large number of equivalences which look like: $(a \leq 0.54 \wedge b \geq 0.12) \vee (c \gt 0.98)$ $\Leftrightarrow$ $(x \leq 0.25) \vee (x \gt 0.91 \wedge y \geq 0.01)$ This is just an example. In general, formulae on either left or right side of the equivalence could be anything that takes the form of a dis...
A generalized regular expression is like a regular expression but with one more operation allowed: complementation. The (generalized) star-height of a generalized regular expression is the maximal number of nested Kleene stars. The star-height of a language is the minimal star-height of a regular expression describing ...
Here the problem is that I’m confused how to take the pumping value $p$ is it arbitrary any value? Also I don’t know if I should prove all $3$ conditions of the pumping lemma is false or if any one should be proved as false by considering the given language as regular by proof by contradiction.
As far as I understand, cross compilers, emulators, and simulators are all ways that one computer system to be able to behave like or run another computer system. What is the difference between these concepts? Are some of them equivalent?
The normal argument for a decidable language to build an enumerating machine is given as follows: Let $M$ be a Turing machine which decides a language $L$, and let $s_1,s_2,\ldots$ be a list of all strings in $\Sigma^{*}$. Consider the following enumerating machine: Ignore the input Repeat the following for $i = 1,2,3...
I am reading Sangiorgi's paper On the origins of bisimulation an coinduction. Definition 2.5, on page 5, defines Stratification of Bisimilarity: Let $W$ be the states of an LTS. We set: $\sim_0 \overset{\text{def}}{=} W\times W$ $s\sim_{n+1} t$, for $n\geq 0$, if: (1) for all $s^\prime$ with $s \overset{\mu}{\righta...
What exactly is the definition of church turing thesis? It's really confusing. I want to prove the following statement: A Turing machine with infinitely many states is more powerful than a regular Turing machine, as it can accept all languages. How does this statement not contradict the Church–Turing thesis? I don't ...
I have a problem where I need to sort array of arrays. For A being a array arrays (a1,a2,a3,...an) were each a = {0...d} d=fixed number of elements. *The assumption all sublists will have fixed number & same of elements n. *sublists are already sorted from least to greatest For example A = [{-2,-1,3},{-1,-2,INT_MAX},{...
Why is paging done only for user code (user space)? I know that the basic intuition behind paging is for managing larger logical address space in smaller physical main memory space. Won't the kernel size also be large? If the kernel code is large enough and the RAM size is small, then how is it managed? Please clarify....
Input: Set of machines M, Each machine has an availability array D_m[t], set of activities A, for each activity j its starting time s_j, its duration p_j and its consumption in D during processing. Output: True or False if the usage for each machine at each instant is less than the availability for each machine m...
Consider a graph with vertices $V$ and edges $E$. The standard version of the min cut problem is to find the partition of $V$ into a (non-empty) subset $C$ and its complement $\bar{C}$ so as to minimize the number of edges going between $C$ and $\bar{C}$. Algorithms are known for this problem which solve it in polynomi...
I am looking for the name (definition?) of X in: A regular expression is X iff it has exactly one possible match. Examples: <empty regex>, abc, \., [.], a|a, a{8,8}, \Q.*?\E Counterexamples: ., a*, a|b, \d, a? I would call such a regex constant. Can I use this name? Is there a similar concept? Additionally, I would...
On my computer science course's exam I was given the following task: You are given $n$ segments that lies on the same line: $i$-th segment starts at coordinate $from_i$ and ends at $to_i$. Your task is for each segment count number of other segments that intersects it. EXAMPLE INPUT: 5 7 8 8 9 0 3 2 7 10 15 EXAM...
In order to prove that SAT is in NP, I need to come up with a polynomial time verfier (an algorithm). The Cooks Levin Theorem uses a non-deterministic Turing machine but that's not what I am looking for. The idea of the algorithm could be that we put in the values and calculate the answer. Then, we check whether the an...
I explain it better: There are some algorithms that is clearly in NP, also NP-complete, but that under certain conditions they can be solved in polynomial time. An example is Bin Packing, the decision version of the problem is an NP-complete problem and it's defined as follows in the book "Computers and Intractability"...
I have a set of urns that can each hold different amounts of sand. Porters can deliver sand to each urn subject to a transport fee per unit of sand. Each porter has a finite amount of sand they are capable of delivering to each urn. The objective is to fill the urns with all the available sand while minimizing total co...
There are algorithms that are said to be unfeasible to be applied in practice due to their time complexity. In textbooks, it's common to see remarks like "it would take hundreds of years" about using them. Unfortunately, it's often the case an inefficient algorithm is the only proven solution for an interesting problem...
I am attempting to match human input of titles to a list of titles, and also show likely candidates when a human enters a title not known. Ideally I'd also have some way to suggest the human input of a truly novel title matches no known title as well. As an example, I have a list of titles like this: The Conspirators ...
Consider a tree $T = (V,E)$ and its induced disjoint trees $T_1 = (V_1, E_1), T_2=(V_2, E_2)$ by the removal of an edge $e \in E$. Is there a data structure that enables the immediate determination of membership of vertex $u \in V$? i.e., is $u\in V_1$? Ideally a data structure with at most polynomial space complexity....
Let $F$ be the set of all Boolean formulae. We say that a Boolean formula $\varphi$ is positive (=monotone) if $\forall \alpha\in F,i\leq n$, if $\alpha\wedge\neg x_i\models\varphi$, then $\alpha\models\varphi$. Let $\psi,\xi\in F$. We say that $\psi\vdash \xi$ if $\psi\models \xi$ and $\psi$ is equivalent to a formula...
I have been trying to calculate the Big-O of the following algorithm and it is coming out to be O(n^5) for me. I don't know what the correct answer is but most of my colleagues are getting O(n^3). for(i=1;i<=n;i++) { for(j=1 ; j <= i*i ; j++) { for(k=1 ; k<= n/2 ; k++) { x = y + z; ...
Let's say I want to count the number of ways a string can be decoded, once encoding algorithm follows this map: 'a'=>'1', 'b'=>'2', ... 'z'=>'26'. I could simply count it using a recursive function as follows: def num_ways(s: str) -> int: if len(s) > 0 and s[0] == '0': return 0 if len(s) <= 1: ...
I'm trying to build an supervised learning algorithm that deals with the regression problem of predicting a user's rating of a new incoming item based on the user's previous ratings on items. The ratings will be in the range of 1 - 5 (1 = best, 5 = worst). Features a item will probably have: author (nominal) release c...
I am curious about the NP-completeness (or if not, an efficient algorithm) for the following generalization of the subset sum problem: In subset sum, we are given a number $t$ and a collection $S$ of integers with $|S|=n$, and ask if we can use a subset $S'\subseteq S$ to sum up to $t$. We can generalize the problem by...
IBM designed IBM i as a "turnkey" operating system, requiring little or no on-site attention from IT staff during normal operation. This is a dream of mine. Unfortunately, it costs a million dollars per nanosecond and I have $0 budget. The opposite of this dream is the nightmare of being forced to manually babysit an...
As the title says; is this language decidable and how do you prove it? $$L =\{\langle M\rangle \mid M \text{ is a Turing Machine and there is an input that } M \text{ halts on} \} $$
I ran into natural mergesort in this Wikipedia page: https://en.wikipedia.org/wiki/Merge_sort#Natural_merge_sort However, I can't find much information regarding: The algorithm(s) to achieve natural mergesort, and the pros and cons of each method How natural mergesort compares to bottom-up mergesort (pros and cons of ...
Question My use case for what is described below is not a language or compiler implementation, but finding a reasonable semantics for this feature in a an abstract calculus. Ideally, you give me a name for this concept, with references to a language that implements it and how that is done, or a theoretical exposition o...
In programming language theory, people study the theory behind programming languages. But I have never heard any formal definition of programming languages themselves. What is the formal definition, not of a particular programming language like Python or C++, but of programming languages themselves?
i, sq ← 1, 1 while sq < n for j ← 1 to sq k ← 1 while k ≤ j k ← 2 ∗ k i ← i + 1 sq ← i ∗ i I have expressed the running time of the "for" loop as a sum in this way : $$\sum_{j=1}^{i^2} \log(j)$$ In a similar way, how can I express the running time of the outer "while" loop with ...
Let $T_1$ be a total Turing machine deciding language $L_1$, and let $I_1$ and $I_2$ be two separate inputs to $T_1$. Further, let $I_{c}$ be $I_2$ concatenated to $I_1$ with some separation symbol in between, and let $S_{T}(I)$ be the number of steps total TM $T$ needs to run until it accepts/rejects input $I$. I am w...
When I was going through the reductions from $HP$ and $\overline{HP}$ in this handout, I do not understand how everywhere the following claim is made: $$⟨M,x⟩ \in \overline{HP} ⇒ \text{M does not halt on x} ⇒ M′ \text{ does not accept any strings} ⇒ L(M′)\text{ is finite} ⇒ M′ \in L_5.$$ Why does $M$ not halting on $x$...
We are given a list $L = {(x_1, y_1, z_1), \dots, (x_n, y_n, z_n)}$ and an integer $m \leq n$. The goal is to find a subset $S \subseteq \{1,\ldots,n\}$ of size $m$ which minimizes the following cost function: $$\mathit{cost} = \max_{p \in S}(x_p) + \max_{p \in S}(y_p) + \max_{p \in S}(z_p).$$ Is there any subquadrati...
I am new to grammar and have written grammar for parsing math expression for asciiMath using ANTLR as below. expression : expression BINARY_OPERATOR expression | UNARY_OPERATOR(expression) | LEFT_PARAM expression RIGHT_PARAM | VARIABLE | NUMBER ; LEFT_PARAM : '('; RIGHT_PARAM : ')'; V...
Project schedules are made of activities, durations associated with each activity, and relationships between activities (SS, SF, FS, FF) with a lag (can be positive, negative, or 0). Let's say I have 3 activities A, B, and C with durations of 2, 3, and 4 respectively and FS relationships between A & C and B & C. A and ...
So for the question 'Given two identical DOM trees, and an element in one tree, find the same element in the second tree'. I can solve it in two ways - Start at the given element and traverse up to the root of tree A - save the path and then follow the path down the second tree to the element. Start at the root and t...
To solve an NP-hard optimization problem optimally, we can use mathematical programming or brute force techniques. I would like to know if it is possible to solve the problem in an online fashion optimally? Is there any mathematical tool that can perform this task? I can design an online algorithm to solve the problem ...
An odious number is defined as an integer that has odd binary Hamming weight. I need an implementation of algorithm that finds the nth odious number, preferably recursive. Any ideas? A python script is also wanted, but I can write it myself once the algorithm is found. More description can be found on formula section i...
This is a homework problem and I'm not sure how to do it correctly. It says "Prove ln(n) = Θ(log2 n) with n = odd number". Bu using Natural logarithm rules, we can somehow know this is partcially true However, I'm stuck with this since I don't understand how to do the whole procedure.
Given a nondeterministic finite automaton $A$, give an algorithm that checks whether the language $L(A)$ decided by $A$ contains a string whose length is a composite (i.e. not prime) number. My obvious [edit: wrong] answer is that, if $A$ has $n$ states, then I can simply check if it accepts any word of composite len...
In an unweighted bipartite graph $G = (X + Y,E)$, we would like to find a maximum matching, but among all those maximum matchings, we would like to find one that saturates a given subset $X_0\subseteq X$. A necessary condition for the existence of such a matching is that $X_0$ satisfies Hall's marriage condition, i.e.,...
I'm looking for a way to find out whether a specific rule in a BNF grammar can be converted to a regular expression. (With "regular expression" (RE), I mean the simple mathematical kind. I'm not interested in BNF rules that can only be done with the use of backreferences, lookarounds, or other advanced features.) I'm o...
Suppose you have a simple sort of lambda calculus abstract syntax tree. The fine details don't really matter. data T = Unit | Void | T :*: T | T :+: T | T :-> T | I data Term x a where Var :: x -> Term x x Int :: Int -> Term x I Add :: Term x I -> Term x I -> Term x I Apply :: Term x (a :-> b) -> Term x a -> T...
I have a directed weighted graph representing street (edges weighted by distance) and street intersections (nodes). Using this graph, I would like find central nodes that a person might find themselves traveling between. For example, I would expect nodes near bridges to have high centrality. What algorithms might I use...
Could you give me examples of polynomial-time algorithms that must compute a global property over their entire input? A purely illustrative example of this might be a graph algorithm that somehow must count the total number of nodes before computing its final answer.
Most discussion of naive (without Union-Find) implementations of Kruskal's algorithm for finding the minimal spanning tree that I see has a handwavy bit: "just use DFS to detect if there is a cycle" and then moves on to more optimised approaches. I like to understand problems so I'm not interested in just skipping to t...
This is a cross post of my question here on math.se. I have a list of $n$ items and would like to randomly select an $m$ set from it efficiently (in terms of time complexity). Also, I want all possible subsets to be selected with equal probability. The obvious solution is to pick a random integer from $1$ to $n$ and ch...
Little law states that the average arrival rate(AR) multiple the average rate of service time(SR) equals the number of customers in the system. But intuitively, if AR > SR shouldn't the system exploded with customers? because on avg, we 'can't keep up' with the number of customers that arrive? In a deterministic system...
I once thought that any analog computer is any computer which "doesn't need electrical current to work". I once thought that any digital computer is any computer which "does indeed need (a correctly distributed) electrical current to work". I found out both assertions as wrong. What are analog and digital in computer s...
I encountered two applications of RS codes - one in group testing, and another time someone said that a solution to an interview question was using it. But when I search for explanations, it's all about the cracks in the CD disks and such. Is there a good source that puts the math first?
I have read proofs that the function is not primitive recursive and I (think) I understand them. Most I've seen show that the set of functions dominated by the Ackermann are exactly the primitive recursive functions etc. But, coming at it from the point of view of the 'ground requirements' which define the collection o...
A unary Turing Machine X has input alphabet Σ and tape alphabet Γ. We represent the blank symbol belonging to the tape alphabet as _ . Given as input 11111 X writes 1_1_11_1 as output. Is the blank symbol discarded when considering the output, ie. is the input equivalent to the output in this case (regardless of how ma...
At page 156 there is an example on how to find the distinguishable states for the following automaton: The following table shows the distinguishable states: By applying the given definition for distinguishable states, it is not clear why E and G are considered distinguishable. For my understanding there is at least o...
Let $L$ be a language. The Myhill-Nerode theorem is based on the following equivalence relation: $$x \equiv_M y \Leftrightarrow \forall v \in \Sigma^*. (xv \in L \leftrightarrow yv \in L).$$ One corollary of the Myhill-Nerode theorem is that if $\equiv_M$ has infinitely many equivalence classes, then $L$ is not a regul...
The original formulation of the 3 restricted grammar types of Chomsky all included the restriction that the right-hand side of a replacement cannot be $\epsilon$ (non-contracting). This, however, can be (and usually is) lifted for regular and context-free grammars (i.e. they are allowed to have productions of the form ...
I have heard the simply typed lambda calculus is the internal language of closed Cartesian categories. I have a written a compiler from the STLC to CCCs but this involves a lot of ugly tuple shuffling. Is it possible to get the STLC for free from the definition of a closed Cartesian category?
Given $n$ distinct values $(x_i)_{i=1}^{n}$ with mean $\mu$ and standard deviation $s$, for all $i$, we have $|x_i−\mu| ≤ s \sqrt{n − 1}$. How does this inequality compare with Chebyshev inequality as $n$ increases?
I'm interested in learning about ranking algorithms that sort items based on preference. For example: If a person was food taster/judge and had 10 small bowls of chili that they had to rank in order from best to worst, in what way should the judge taste the chili from the individual bowls to complete the task of rankin...
Is it possible to have a regular expression from a language (that has strings of infinite length) which it describes ?
I have 2 different datasets with similar objects, one where each object is 50 pixels wide and the other where they are 150 pixels. Each photo is 512x512 for both datasets. These two datasets have the same number of photos. Taken with the same camera, so same focal length, resolution etc... So far, we agree that only th...
I am a little confused about stochastic encoding in channel coding. For example, in the identification problem (R. Ahlswede and G. Dueck, “Identification via channels”), the authors claim that we can achieve nearly 0 probability of error when using $O( \log \log M)$ bits, where $M$ is the total number of messages. Inst...
We are given a recursive definition: $a_1 = x,\\a_2=y, \\a_n= c_1a_{n-1}+c_2a_{n-2} \text{ for }n\ge3 $ where $x,y,c_1,c_2,n$ are natural numbers we are to prove that $a_n \le c_3^n$ for all n The base case is true Assuming $a_k \le c_3^k$ is true show $a_{k+1} \le c_3^{k+1}$ is true We have: $c_3a_k \le c_3^{k+1}$ ...
Let $L$ be a language, and consider the following relation $\equiv_L$ on strings: $s_1 \equiv_L s_2$ if and only if, for every string $w$, we have that $s_1w \in L \Leftrightarrow s_2w \in L$. This is an equivalence relation. Let $I(L)$ be the number of equivalence classes of $\equiv_L$ (a) Suppose $L$ is a language an...
Question Is there an NP-hard problem for which we can add a parameter1 to create a "natural"2 parametrised problem for which no FPT algorithm exists? The adding a parameter is needed because a NP-hard problem is normally just a question with a yes or no answer, if you want to limit some parameter you need to specify w...
Godel proved there are true statements in arithmetic that can't be proven true in any sufficiently strong Formal Axiomatic System (FAS). The authors of this paper use similar arguments to prove there are TM's that belong to a certain complexity class that cannot be proven to belong to that class. They refer to these ty...
I'm working on nandgame's website found here. I'm working on the ALU and here is an image of my implementation: My Implementation: And I compared it to this website's solution: Solution However when I try to submit this... The website gives me this message and error: And for the life of me, I don't see where any of...
$a_1=2,a_2=9,a_n=2a_{n-1}+3a_{n-2}$ for $n>=3$ Show $a_n<3^n$ for all positive integers n Base case: $a_3 = 2*9+3*2 = 24<=3^3$ is true Hypothesis: $a_k<=3^k$ for $k\epsilon\mathbb{N}$, show $a_{k+1}<=3^{k+1}$ Begin: $a_k<=3^k$ implies $3a_k<=3^{k+1}$ by definition: $a_{k+1} = 2a_k+3a_{k-1}$ $2a_k + 3a_{k-1} <= 2a_k + a...
The title could be a little bit confusing, and it is not easy to summarize it within a sentence, therefore I will explain it in detail below. If you have any thoughts on optimizing and rephrasing the title, please tell me in your answer then I will try to make the title much clearer. Suppose we have a list of integers ...
I was wondering for some time how to approach a situation like the following one. Imagine a standard binary tree data structure with $n$ nodes in it. Each node contains pointers to its left and right children, and from that node we can navigate to each of these children in constant time. We are looking to find whether ...
I have a 3D mesh comprised of city buildings, no ground surface, just buildings. The goal is to extract the buildings bottom surfaces. So far I have tried to cut the mesh by a threshold computed from the vertices height histogram - it works good for relatively flat areas, but fails badly for areas with uneven ground le...
Context: type theory. My understanding of: WN: every term can rewrite to NF. Canonicity: every term rewrites into canonical form. Then it leads to an intuition where if canonicity holds, then we get NF = canonical form and therefore WN holds. However, I don't see people state this often, like this question talks abou...
Let $G = (X+Y,E)$ be a bipartite graph and $k\geq 1$ an integer. A maximum $k$-matching is a subset of $E$ in which each vertex of $X$ is adjacent to at most $k$ edges and each vertex of $Y$ is adjacent to at most $1$ edge. A maximum-cardinality $k$-matching can be found by the following algorithm: Create $k$ copies o...
According to nLab article: https://ncatlab.org/nlab/show/functor Definition External definition A functor $F$ from a category $C$ to a category $D$ is a map sending each object $x \in C$ to an object $F(x) \in D$ and each morphism $f : x \to y$ in $C$ to morphism $F(f) : F(x) \to F(y)$ in $D$, such that $F$ preserves...
I'm reading Data Structures and Algorithms by Goodrich. The explanation that he gives for Big Oh notation is given below: Let $f(n)$ and $g(n)$ be functions mapping positive integers to positive real numbers. We say that $f(n)$ is $O(g(n))$ if there is a real constant $c > 0$ and integer constant $n_0\geq1$ such that ...
It's being said booth's algorithm produces the output exactly as normal binary multiplication while reducing the number of operations performed and can be used for both positive and negative numbers ! I tried multiplying two 4-bit numbers while I don't get the same result...Please guide what am doing wrong. Multiplican...
Question While trying to search for a (example of a) NP-hard problem that fixed-parameter reduces to another NP-hard problem that is known to be fixed parameter tractable, such as k-Vertex Cover, my search results are "poluted" by papers establishing $W[1]$ hardness through parameterized reductions. It is stated in num...
I'm exploring the idea of using machine learning to draw a topology of elements. For example, imagine a tree representing geological hierarchy (country -> province -> city). All countries are at the top-most level, then the provinces for each country, followed by the provinces splitting into cities at the 3rd vertical ...
In CLRS 3'rd edition there is a Lemma 26.2 which states that: Let $G=(V, E)$ be a flow network, let $f$ be a flow in $G,$ and let $p$ be an augmenting path in $G_{f}$. Define a function $f_{p}\colon V \times V \rightarrow \mathbb{R}$ by $$f_{p}(u, v)=\left\{\begin{array}{ll}c_{f}(p) & \text { if }(u, v) \text { is on ...
I am studying term rewriting by reading Baader/Nipkow's book: "Term Rewriting and All That". I want to prove a lemma about terms, position of subterms and replacement of subterms. The notation is as follows: $s|_{p}$ denotes the subterm of $s$ at position $p$. $s[t]_{p}$ denotes the term obtained from $s$ by replacing...
I have an array of 64-bit integers of length $n$ and I want to find the frequency of each element in $\mathcal{O}(n)$? is that possible? my idea was to use a hashmap but it seems to me that the adversary would always be able to find a pathological case.
The Number is given as : (C012.25)Hexadecimal I have to convert it into octal . So I converted it into Binary First and got the result as : 1100000000010010.01000000 (Since each bit in hexadecimal represents 4 bit in binary so C=1100,0=0000,1=0001,2=0010 and for 0.25=.01000000 ) The Solution mentions the Binary convers...
MCG Problem: Consider a positive integer R and an undirected graph G = (V, E), in which each vertex is assigned a weight (or value). The maximum-weight connected graph (MCG) problem is to find a subgraph with R vertices that is connected and maximizes the sum of the weights (or values) of the R vertices. CMCG Problem: ...
I've been given a question to solve: Given a set of non-negative distinct integers, and a value $m$, determine if there is a subset of the given set with sum divisible by $m$. For this question the answer is here I don't understand the part after if DP[j]==True what is actually the intuition behind this code. Please ...
Is there an algorithm on how to check if two LTL expressions (represented as binary trees) are semantically equivalent? Since there are many smaller equivalences such as $a\Rightarrow b \equiv \neg a \vee b$ or $F(a) \equiv true U a$ as well as commutativity, distributivity, etc. that need to be considered. My initial...
I'm wondering if it's possible for algorithms that have monotonically decreasing runtime with the input-size - just as a fun mental exercise. If not, is it possible to disprove this claim? I haven't been able to come up with an example or counterexample so far, and this sounds like an interesting problem. P.S. Somethin...
In "Finite Model Theory and Its Applications", page 152, it is said that Deterministic Transitive Closure, on ordered finite structures, captures LOGSPACE. Hence, taking into account that FOL captures LOGSPACE, the following should be possible: Given a functional relation R(X,Y) (e.g. "motherOf(X,Y)") Define, in FOL, ...
We can create variants of the loss function, especially of ridge regression by adding more regularizer terms. One of the variants I saw in a book is given below $min_{w \in \mathbf{R}^d} \ \ \alpha.||w||^2 + (1-\alpha).||w||^4 + C||y-X^T.w||^2$ where $y \in \mathbf{R^n}, s \in \mathbf{R^d}, X \in \mathbf{R^{dxn}}$ a...
Given a list X containing m number of x coordinates and a list Y containing m number of y coordinates. The coordinate (x, y) is valid if and only if the difference between x and y is less than or equal to d. I need to find out the maximum number of valid coordinates. Here is my algorithm. sort the list X in non-decreas...
I am reading some slides on Algorithm to understand why termination is an undecidable problem. The slides say the following: – Assume termination(P) always terminates and returns true iff P always terminates on all input data; – The following program yields a contradiction while termination(P) skip; But I do not see ...
Specifically, I have tried boiling down the operations of a VM into the smallest possible standardized units and arrived at this: allocate_stack(size) fetch(offset_from_stack_pointer) store(offset_from_stack_pointer) call(index) So you might have: allocate_stack 6 fetch -2 store 0 fetch -1 store 1 call 72 Basically, ...
NP4 = { L | There exists a non deterministic polynomial Turing machine M, such that for every x∈L, M accepts x on at least 4 paths in the computational tree of M on x. and for every x∉L,M accepts x on at most 3 paths in the computational tree of M on x. }
I'm developing an algorithm for concurrent heap garbage collection/compaction. It will be used in low latency systems that need to scale well to a lot of clients, e.g. web servers. I thought about an algorithm that would be suitable but it does have a few flaws. I'm not very good at describing algorithms, so please cor...
Let G be undirected graph, G=(V,E), and all edge weights are distinct. Consider an edge e=(u,v)∈E that wasn't included in the solution obtained from applying Kruskal Algorithm to G. Prove that this edge isn't in any Minimimum Spanning Tree of G.
When we write code, after compilation the code will be converted to machine language and then stored in the hard disk. But before compiling the code, it is still in the high-level language. How and where is the memory allocated for the source code before compilation? I assume that before compiling the code is stored in...
I am sorry for the repetition of the question. I understand that this question has already been answered before by the community, but most answers tend to focus on unweighted graphs. I want to know Can DFS we used to find the shortest path for weighted graphs? I know that Dijkstra's algorithm is used to find the shorte...
If $P=ab$ and $Q=a^*$, how do I use Arden's theorem to determine the regular expression $R$. I'm not sure if I am supposed to just substitute the values of $P$ and $Q$ in the equation $R= Q + RP$. Also how would I use that to check that $R$ satisfies Arden's equation.
I am having trouble understanding how to apply Pumping Lemma to show a Language is not regular. If the alphabet is $\Sigma = \{a, b\}$ and the language is $L = \{a^{i + 1} b^{4i + 2} \mid i \in \mathbb N\}$, how do I prove the language is not regular using pumping Lemma? Also what is a pumping length, how do i know to ...
I tried reading the wikipedia about Dominator (graph theory), which gives the following definition of a dominator node: a node d dominates a node n if every path from the entry node to n must go through d. I need to understand the concept of a dominator node but I do not need to go deep into graphs, so I'm trying to ...
My understanding of P. vs NP is quite limited. I can understand P refers to an algorithm with an upper bound (big O) with order of growth $n^c$ for some constant c and variable n. My question is, do NP problems have a hypothesized lower bound order of growth (big Omega) of $c^n$ for deterministic machines? I can't find...
I am studying the complexity classes and I am confused what is the complexity of the following problem: "Does a directed graph G has at most 1 Hamiltonian cycle?" So, from my knowledge and understanding: Existence of Hamiltonian cycle is a NP(C) problem. Existence of exactly $k$ ($k>1$) Hamiltonian cycles in a graph b...