instruction stringlengths 35 29.1k |
|---|
I have an $n \times m$ matrix, and fill it with numbers of $1 \dots k$.
If a matrix can be turned into another matrix by exchanging its lines and exchanging its columns, the two matrices are considered to be the same.
I know that I can easily computed the numbers of the different matrices out in $O((n\times m)^k)$ time... |
From the given formula, we can compute the CPU utilization:
CPU Utilization = 1 - P^n
Where p is the probability of I/O and n is the total number of processes.
E.g, If we were to find CPU utilization if the computer has enough room to hold four programs in its main memory. These programs are idle waiting for I/O half... |
The problem is proposed here and related to this question. Given $n$ and $k$, I would like to know how to compute$$\sum_{\substack{x_0 ⊕x_1⊕\cdots⊕x_k=0\\x_i≥0,\ 0≤i≤k\\\sum\limits_{i=0}^kx_i≤n-2k}}\binom{n-k-\sum\limits_{i=0}^kx_i}k$$ in $O(nk·\log n)$ time, where $⊕$ is exclusive or.
Let $\sum_{i=0}^{k}x_i=S$.
The s... |
I’ve run into a challenging algorithm puzzle while trying to generate a large amount of test data. The problem is as follows:
We have $N$ buckets, $B_1$ through $B_N$. Each bucket $B_i$ maps to a unique item $a_i$ and a count $k_i$. Altogether, the collection holds $T=\sum_1^N{k_i}$ items. This is a more compact repre... |
A model of computation is called Turing complete if it can simulate any Turing machine.
This rules out for example a combinational logic circuit.
However, there is a sense in which combinational logic circuits can solve all problems that Turing machines can: while it is not the case that we can find for Turing machine ... |
I'm searching (without results) a problem that can be reduced to finding the densest subgraph with the same cardinality between two classes of nodes.
Consider a graph with nodes of class A and nodes of class $B$ (not bipartite and $|A|$ it is not necessarily the same as $|B|$).
The problem is to find the densest subgra... |
I am searching for an undecidable language $L$, such that $L \leq \Sigma^* \setminus L$ and $\Sigma^* \setminus L \leq L$,
but I am not able to find a concrete language and reduction.
Is there anything like this?
|
I am reading about the Satisfiability Problem, in page (5) the author gives the following example :
$(P \lor Q \lor R) \wedge
(\bar{P} \lor Q \lor \bar{R}) \wedge
(P \lor \bar{Q} \lor S) \wedge
(\bar{P} \lor \bar{R} \lor \bar{S})$
A satisfying assignement is $: P,Q,\bar{R},\bar{S}$.
A different assignments is $P,\bar{R... |
Word size of most modern cpu’s is 32 or 64 bits. Both are a power of 2.
This looks “intuitively reasonable”, because a bit has 2 states, but I don’t actually have a hard argument for why this is the case. Moreover, in the past, word sizes of processors have been multiples of other numbers, such as multiples of 6 (becau... |
What is known about the complexity of the promise problem "determine whether a propositional formula is a tautology in intuitionistic logic, given that it is a tautology in classical logic"?
Does it matter whether you have access to a proof that the proposition you're asked to validate is a classical tautology?
I thin... |
So I know from some research I've done that the OPT-IP <= OPT-LP for the maximum coverage problem, however I'm having some difficulty following the explanations I find. Does an example exist where it can be shown OPT-IP < OPT-LP easily?
|
I read that in a paging scheme memory management, some os's have a paging daemon that wakes up periodically to inspect the memory of the RAM. This is to ensure that modified pages can be scheduled to write back to disk before page fault happens and it also makes it more efficient to have a pool of free frames rather th... |
I have quite a hard time understanding co-NP problems.
If we can reduce every problem to decision problem. NP problems should accept YES instances -> instances where the answer is yes. So for example for Traveling Salesman problem, we would ask "Is there a path that visits every city, and is shorter than N" ?
For co-NP... |
I've got a question regarding the A* search algorithm's implementation.
According to Wikipedia, one has to use a priority queue for retrieving the next node with the lowest f value, is it possible to skip to a node that is not a direct descendant of the current node?
For example:
Say we start with node S (set f=0), t... |
I am implementing the gift wrapping algorithm to find the convex hull of a set of points in the 3D space.
However, all the articles I have read seem to omit the description of the first step of the algorithm; namely, finding a face (that is, a triangle) in the set that will definitely be in the convex hull (and doing s... |
Can $n$ elements be sorted in a worst case time of $\sqrt{n}\log n$? Why or why not?
I've seen algorithms being sorted in the worst case of $n\log n$, so why can they be or cannot be sorted in $\sqrt{n}\log n$?
|
In order to calculate the effective access time of a memory sub-system, I see some different approaches, a.k.a formulas. All are reasonable, but I don't know how they differ and what is the correct one.
Assume a two-level cache and a main memory system with the following specs:
h1 = 80% t1 = 10ns L1 cache
h2 =... |
I am trying to clearly define various terms related to top down parser "so that I can relate them and come up with clear classification". Now this efforts might seem unnecessary as the terms I am talking are pretty basics, but I am trying this all for sake of 100% clarity.
The dragon book defines predictive parsing as ... |
I have a problem that I believe is NP-hard. If I reduce a NP-complete problem to it in exponential time (and not polynomial time), does that prove the problem is NP-hard?
|
(1) ∀x, y, z (x < y ∧ y < z → x < z) (transitivity)
(2) ∀x ¬(x < x) (antisymmetry)
(3) ∀x, y (x < y ∨ x = y ∨ y < x) (linearity)
I need to give an example of a (nonempty) structure with one binary relation that satisfies (1)and (2) but not (3), and in addition the formula ∀x ∃y (x < y). I was thinking naively of y = x ... |
For any two different numbers there is an number in between.
I'm trying to write this in predicate logic and have no idea how to do it, since I need 2 variables X and Y? For all x there exists a y such that y - x is positive?
I'm a mong ignore.
|
Modern personal computers as far as I understand have increased in power (measured informally by ability to compute “more demanding programs”) due to two “broad factors”:
decreased transistor size (thereby decreasing delay time between computations).
increased transistor quantity
It seems to me that the first factor ... |
We have two types of Automata. One is NFA and second is DFA. These are little bit different but thing is that in which environment we prefer NFA over the DFA?
|
Given a relation R(A,B,C) and a FD set (A->B, B->C), find the FD Closure. Enumerate all the FD's and organize them accordingly to the LHS of the FD's. Mark all the trivial FD's.
I am a little confused with the second part of the question and don't understand what exactly they mean by "organize them accordingly to the L... |
What do you call a structure which becomes a tree after collapsing cycles (so the new vertices are the old faces)?
For instance, the digraph (given by an NFA; ignore edge labels please) below becomes a tree
$\{a,b,c,d\}$ with edges $(a,b), (b,c), (b,d)$ via:
\begin{eqnarray*}
a\mapsto&\text{the cycle }&S_0,S_1,S_2,S_3,... |
Can someone explain the difference between first-order programs and higher-order programs in the context of programming languages?
My understanding so far is that Functional Languages (most) use higher order programs. Plus, higher functions either a) take other functions as arguments, or b) return functions as results.... |
What is the complexity of this problem
EULERIAN ARC REVERSAL
Input: a directed graph $G(V,A)$ and an integer $k$
Output: YES if $k$ arc reversals are enough to transform $G$ into an Eulerian graph, otherwise NO
Given an arc $(u,v)\in A$, an act of reversing it will result in the opposite arc $(v,u)$ while the origin... |
There was a time when a "computer" was a person who worked on accounts. However, machines were introduced and this profession eventually died out over time. The definition below was taken from pag 750 of volume C of the year 1893 of the OED dictionary:
Computer [...] one who computer; a calculator, reckoner a person e... |
Say I am given two hash functions f1 and f2 is there anyway that I can prove one hash function will produce fewer collisions than another one? That is say for some domain assuming all values in the domain are equally likely to be chosen can I show that f1 will on average perform better than f2?
Looking up how to determ... |
I am trying to show that given a co-finite language $A$, $A \in \text{TIME}(1)$.
If $A$ is co-finite, $A$ is regular, so $A \in \text{TIME}(n)$.
I'm not sure how to proceed from here. Any hints?
|
I am trying to solve above question, below is the automaton I came up with:
Is there any ways to define automaton without having marked states?
|
I would like to know if there has been any work relating legal code to complexity. In particular, suppose we have the decision problem "Given this law book and this particular set of circumstances, is the defendant guilty?" What complexity class does it belong to?
There are results that have proven that the card game M... |
I know that AVG Memory Access Time = Hit time + Miss Rate * Miss Penalty
If I am given the AMAT and miss rate, aswell as the latency to access memory(call this x) how do I calculate the miss penalty & / or Hit Time?
For example:
AMAT = 80 (cycles)
Miss Rate = 0.4
Memory access latency = 60 (cycles)
How do I get miss p... |
Hi I have been reading Ch 34(NP-Completeness) Section 34.1 of CLRS and I am confused why do we need to consider different encodings. Everything is represented as binary at the end so why consider different encodings of the input?
Any help is highly appreciated.
|
The master theorem can be used in case of a recurrence relation of the form $T(n) = aT(\frac{n}{b}) + g(n)$
But is it possible to use the master theorem for recurrence relations of the form $T(n) = aT(\lfloor \frac{n}{b} \rfloor) + g(n)$?
|
Disclaimer: Assignment question.
I am trying to solve the below question, the condition is not to use guards and variables. Is it at all possible to do this?
My approach was to have 4 separate automatons, 1 for each of the three servers and 1 for the entire system(with states for 0, 1 and 2 customers in the system). B... |
I would like to calculate an eularian path using Christofides algorithm on this graph: (Focus on the first number in each box representing the distance)
$\alpha$ denotes the start and end vertex of the Eulerian path
Step 1 - Calculate minimum spanning tree $T$
Step 2 - Calculate the set of verices $O$ with odd d... |
I have an unsorted array of (x,y) coordinates and need to find the min/max for both (x) and (y) separately so that I can build a bounding box using $O(\frac{3n}{2})$ comparisons.
If I use this method to find the min/max for the left/fight box boundaries, then use the same algorithm to find min/max of y for the top/bot... |
I was reading Combinatorial Sketching for Finite Programs and wanted to understand why synthesis of the sketching language was possible/feasible.
As far as I understand a partial program is transformed to the Quantified Boolean Formula Satisfiability Problem (QBF) and a sketched (partial) program $S$ with specificatio... |
Dragon book says:
An ambiguous grammar can never be LR.
And then immediately further it says:
For example, consider the dangling-else grammar:
$\begin{align} stmt \rightarrow & \textbf{ if } expr \textbf{ then }stmt \\
&| \textbf{ if } expr \textbf{ then }stmt \textbf{ else } stmt \\
&|\textbf{ ot... |
I am learning CFGs and before that I've made a RE (Regular Expression) for the language of "all strings with at least two $0$'s over the alphabet $\Sigma = \{0,1\}$."
I made this: $(0+1)^*0(0+1)^*0(0+1)^*$
I checked the answer and it is: $1^*01^*0(0+1)^*$
Is there any difference between the two?
If mine is also correc... |
I am working with a linear programming problem in which we have around 3500 binary variables.
Usually IBM's Cplex takes around 72 hours to get an objective with a gap of around 15-20% with best bound. In the solution, we get around 85-90 binaries which have value of 1 and others are zero. The objective value is around... |
I'm a bit confused at a fundamental level.
In Computer Science, maybe some of us mostly use discrete mathematics since our computer is digital (like during studying operating system, algorithms, security, or automata theory for example). Of course, there are also calculus and nonlinear mathematics in Computer Science,... |
We do not know if $P=NP$ has an impact on $VP=VNP$ however how about $P=PP$?
Is $PP$ and $VNP$ related and would $P=PP$ or $P=PSPACE$ imply $VP=VNP$?
Is there a way to show $\#P$ is in $FP^{PP}$?
|
Let $G$ be a graph on $n$ vertices whose degree sequence is $d_1,d_2,...,d_n$. Let $\alpha(G)$ denote the size of maximum independent set of $G$, i.e., the size of a maximum subset of vertices of $G$ that are pairwise non-adjacent. So Caro-Wei says that $\alpha(G) \geq \sum_{d_i \in V(G)}{\frac{1}{1+d_i}}$. The standar... |
The $n$ dimensional hypercube $Q_n$ is a graph that has a vertex $v_s$ for each string $s \in \{0, 1\}^n$ and an edge between two vertices $v_s$ and $v_t$ if and only if the Hamming distance between $s$ and $t$ is $1$.
I would like to find directed hamiltonian cycles in this graph that satisfy a certain property, and w... |
$T(n) = T(n-2)+T(n-3)+2T(n/3)$ and $T(n)=1$ for $n<4$.
I tried to compute the complexity of $T(n) = T(n-2)+T(n-3)+2T(n/3)$ using the recursion tree but it's not clear enough for me to make a guess and demonstrate it by induction? also, it should be computed given both upper and lower bound.
|
The question asks what kind of languages (regular, context free) can a Turing machine accept if you are not allowed to overwrite the input string. The initial configuration of the machine is start symbol followed by a blank followed by the input string followed by infinite blanks. The head is pointing at the blank just... |
https://en.wikipedia.org/wiki/Processor_register
So from the information in this link there are limited Floating point and General Purpose registers in a cpu. My question is how are these registers used. By that I mean let's say I defined some variables in python but I think It's stored in RAM or HDD so does cpu only ... |
My implementation of counting sort is based on the description I found here. I've also included my code in this REPL, but here it is:
def counting_sort(input_list, max_int):
# Make a histogram array for occurences of each integer
count = [0] * (max_int + 1)
for i in range(len(input_list)):
value = input_list... |
Consider the recurrence
$$
T(n,m) = T(n,m-1) + T(n-1,m) + c,
$$
with base cases $T(n,0) = T(0,m) = 1$.
This is the complexity of a recursive algorithm for the longest common subsequence, I know that the complexity is exponential and equals $\Theta(2^i)$, but I'm not sure if $i=\max(n, m)$ or $i=nm$. Also, how can I dem... |
I'm looking for an algorithm as efficient as possible for a regex engine that supports submatch tracking (a.k.a capturing parentheses) and backreferences. What I mean by as efficient as possible is that the simple parts of the regex (like .*.*) should still be matched in linear time no matter whether the backreferences... |
I am looking at the diverse subset problem in Kleinberg and Tardos, shown in the image:
Why can't we give a polynomial time algorithm for this? Cant we iterate through each person a, and then each item i, and then see for each person b $\neq$ a if b has bought item i, then conclude that a and b cannot be diverse? And... |
Suppose that a graph class $\mathcal{C}$ is defined as follows:
A graph $G$ belongs to $\mathcal{C}$ if, and only if $G$ is chordal,
but has at most $k$ $5$-cycles.
I am aware that the definition of $\mathcal{C}$ is contradictory. However, I am looking for a notation like
$G \in C_4\text{-free} + k*(C_5)$
Is there ... |
Can some Turing Machine $M$ with description $\langle M\rangle$, check if an input string $w$ is a description of itself? That is, can $M$ be constructed such that $M$ can tell if $w$ = $\langle M\rangle$?
The closest related problem I could find was: Can I construct a Turing machine that accepts only its own encoding... |
As I understand it to prove something is NP-complete you have to show that it's NP-hard by reducing and a known NP-complete problem to your problem and also prove that it is in NP which you do showing that an answer can be verified to be correct in polynomial time.
Now for the longest Hamiltonian cycle in a weighted gr... |
This is a quote from wikipedia:
Each computer architecture has its own machine language. Computers differ in the number and type of operations they support, in the different sizes and numbers of registers, and in the representations of data in storage. While most general-purpose computers are able to carry out essenti... |
Today I did a test in my class, the trace was:
Prove that the language $L =\{\langle M\rangle\mid \forall w \in \{0,1\}^\ast: M \text{ accepts
}w\implies M \text { accepts }ww \}$, is undecidable with a reduction
from $A_{\mathrm{TM}}$.Hint: You can suppose that $w\in \{0,1\}^*$
I answered:
Suppose that $L$ is dec... |
number -> digits(.digits)?(E[+ -]?digits)?
This transition diagram runs the above mentioned token I can not understand this how this is work.what is meaning of "?"Symbol and digits. can anyone explain me this
|
The master theorem didn't work here. I tried to do the substitution method but I ended up with an additional term: $2Σ(i \cdot 3^i)$. Also I should find the solution $g(n)$ such as $f=\Theta(g)$.
|
In a question I've been given a 5x5 matrix that I'm told represents a weighted graph, and no other information. Here is an example:
0 4 5 2 2
3 0 3 3 1
1 3 0 5 2
2 4 4 0 2
2 3 2 5 0
My question is, how does this represent a weighted graph? I think that each number at position [i,j] in the matrix represents the length ... |
The Semantic Web defines standardised logic under the OWL DL standard.
Programming languages such as OCamel and TypeScript support type inference and algebraic types.
What are the difference between the 2 logic "structures"?
Are they equivalent in terms of being able to implement one in the other and vice versa?
Refere... |
Suppose that $m=O(n^{c+1/2})$ for some real $c>0$ and $x=O(\sqrt{\log m})$. Are the following two computations valid? I understand that I'm abusing notations a bit to get at the desired results.
Computation 1
\begin{align}
f(x)\leq \exp(-x^2/2)&=\exp(-O(\log m))\\
&=\exp(-O(\log O(n^{c+1/2})))\\
&=\exp(-O(\log n^{c+1/2... |
I am writing a routine to store an $M$-by-$N$ sparse matrix in a balanced binary tree. The insertion routine calls a comparison function to determine where a new matrix entry $(i,j)$ should be inserted in the tree. I am defining the ordering of the matrix elements simliar to how C handles a row-major ordered dense matr... |
$$1MBytes =1024*1024*8$$
$$256k*1bit=256*1024$$
$$1MBytes = \frac{1024*1024*8}{256*1024}=32$$
Now my question is that for converting 1MByte to bit level we need 1024*1024*8 but 256K is not converted the same way why (256*1024*8)bit? why we don't multiply with 8 at last since it is kilobyte than byte than bit.
|
I was working through a few problem sets and came across this question
Suppose there is a connected planar simple graph $G$ with $v$ vertices such that all its regions are triangles (a cycle consisting of three edges).
Question 1: Into how many regions does a representation of the Planar Graph $G$ Split the plane?
In... |
I have reduced subset sum problem to set partition problem but do not know whether it is correct and so I need your help.
MY METHOD
In subset sum problem we have to find a subset $S_1$ of set $S$ so that it sums to a number $t$ and in set partition problem we need to find a subset $X_1$ of set $X$ such that summation o... |
In Practical Foundations for Programming
Languages, on page 138 (page 156 of the pdf), it says:
Requiring solutions to all type equations may seem suspicious, because
we know by Cantor’s Theorem that an isomorphism such as $X \cong (X \rightarrow \mathbf{2})$
is set-theoretically impossible. This negative result t... |
For my study I am supposed to develop an dynamic programming algorithm which solves the following simplification of the Knapsack problem in $O(v^*n^2)$ time ($v^*$ is the maximum value of all elements):
Let there be given $n$ elements $1,...,n$, a maximum weight $W$ as well as a weight & value function:
$w: \{1,...,n\... |
Given this graph, what is the minimum perfect matching? What do you do, when there is an uneven number of vertices?
|
I'm trying to show Amplification works for randomized algorithms, and for randomized approximation algorithms.
Amplification for randomized algorithms:
Given a randomized algorithm with time complexity $f(n)$ and error probability $\frac{1}{4}$, show there is an algorithm that solves the same problem, but with $O\lef... |
"Composition of Composition" (i.e., (.) . (.)) in Haskell), has type (a -> b) -> (c -> d -> a) -> c -> d -> b. Apparently, this is an instance of fmap, i.e. a functor between two categories.
The question is: what is the domain and the codomain of this functor? How do we interpret this functor in terms of functional pro... |
I have the following code in Python:
def is_unique(string):
if len(string) <= 1:
return True
if len(string) > 128:
return False
char_set = defaultdict(lambda: False)
for char in string:
if not char_set[char]:
char_set[char] = True
else:
return F... |
Is there a formula for determining the minimum number of colors to color a map with n counties such that no adjacent county have the same color?
|
I've read about it in a few places and I'm not sure I get it.
Are the philosopher's allowed to act simultaneously?
Do they each take 1 action simultaneously, then go on to their next action?
|
I want to optimize a SVG path made entirely of lines. Given a list of lines, each made of two 2D points connected together, I want to find an equivalent list of polylines. For example:
M10,10 L20,10 M20,10 L20,20 becomes M10,10 L20,10 L20,20.One line ends where there other begins, it can become a polyline.
M10,10 L20,... |
What this "⊃" superset means? What do I need to prove here. Can someone, please, explain in English?
Do I need to do a cross product?
Plus, in textbooks and online I only see "∩" "∪" these kinda symbols. What this symbols "⊃" means?
Let M = (K, Σ, δ, s, F) be a deterministic finite automaton. Let M' =
(K, Σ, δ, s, F'... |
Given a string $S$, I want to find the prefix string $P$ of shortest length, such that the original string $S$ can be generated by concatenating copies of $P$ (where overlapping is allowed).
For example, if $S = atgatgatatgat$, I want to find $P = atgat$; $P$ is the smallest prefix of $S$ that can be concatenated (in t... |
Despite there being relatively frequent discourse regarding the usage and effectiveness of various node centralities when analysing the influential spreaders of a graph, I have thus far struggled to find any formal treatments of such discussions. For example, betweeness centrality is theoretically well-defined and is p... |
I was wondering if there is an obvious way to 'name' the ${n \choose k}$ subsets of size $k$ of the integers from $1$ to $n$. So I am looking for a bijection from the subsets of $\{1,\ldots, n\}$ into $\{1, \ldots, {n \choose k}\}$ that can be computed in $O(1)$ at best.
The most trivial way for this would be to use a... |
I am trying to devise an algorithm in which given the length of a path that satisfies the constraints of the Traveling Salesman Problem, I can find the path. Currently, my only solution is to find a cost matrix of every possible path and brute force adding them up until I get a solution that equals the length of the p... |
How can I show that the expected pairwise square euclidean distance between points in $X$ is $Θ(d)$?
Where $X$ is a $(x_1,...x_n)$ of points generated uniformly at random in the unit, d is d-dimensional cube , $x=(x(1),...x(d))$ the generic point has its -th component $x(i)$ chosen uniformly at random in$ [0,1] $indep... |
This is with respect to user-level threads where the kernel only knows about the process as a whole, and threads are created and maintained in the user space. Each thread has its PC, registers, stack and thread control block. To my knowledge, updating PC (or any system register) or access of the code segment can only b... |
My assignment is to prove that the language
$L = \{ a^{4n} b^m \mid n > m >= 0\}$ is not a regular language.
My first attempt was to prove that if if you set $a^l$ and $b^{l-1}$ you'd have an equal #a and #b if you "pump down" your $v$ so that it is $v^0$, so that the condition $n > m$ is no longer fulfilled. Then I re... |
I have this algorithm
Algorithm (A[1..n])
for i <- 1 to n do
if (A[i] < 0) then
A[i] <- 1 * A[i]
End if
End for
I have to find the total number of assignment in the worst case, but I'm a little bit confused, do I say I have 2 or 1, one for the assign A[i] in the statement and second... |
I need help understanding the language L above.
These are my understanding:
- w = uu is a concatenation of u
- La(1*01*) can be expressed in regular language i.e. r1 = 1*01* so La(r1)
- also we have regular expression property of concatenation: L(r1r2) = L(r1)L(r2)
So base on my understanding the language L can b... |
Can someone tell me what binary NP-Hard exactly means.
My understanding was that if the problem is encoded in binary and if the problem is binary NP-Hard, its complexity of solving is NP-Hard. Is this the correct interpretation?
I also wanted to know, if binary NP-Hard also says something about Strong or Weak NP-Compl... |
The problem is (integer) duplicate removal, which can also be perceived as producing the image of an evaluated function (of integers):
Given a sequence $S_\text{in}$ of $n$ integers, produce a sequence $S_\text{out}$ of elements such that any element in $S_\text{in}$ also appears in $S_\text{out}$, and all elements i... |
I have been having a hard time understanding whether the set $S = \{ M \mid |L(M)| = 5 \}$ is semidecidable or not, where $M$ is a generic Turing Machine and $L(M)$ the language accepted by such TM, which consists of exactly five strings. Because $S$ is a property of the accepted language (there exists a TM that recogn... |
I have to find the efficiency class of this algorithm
b = 3
a = 4
for i = 4 to n^2
if (i mod 2 == 0)
a = a+2
else
b = b*3
end for
I solve it like this, first I find the time for executed a then b and the total is the addition, is it right? I'm not sure if I have to do it like this or not, I l... |
I am interested in an intuitive proof for "any binary tree with $n$ nodes has $n-1$ edges", that goes beyond proof by strong induction.
|
The dominance law states that x + 1 = 1
If we go by that logic, does that mean that x' + 1 = 1?
Please just tell me if it's a yes(as I think that this is the answer but I just want to clear my doubts) and maybe provide a little explanation if it's a no.
Thanks!
|
$r_1=\Lambda+(a+b)^*b$
$r_2=(b+aa^*b)^*$
$r_3=b+\$+aa^*b+(b+\$+aa^*b)(b+aa^*b)^*(b+\$+aa^*b)$
For this FA, which i think of as accepting "$\Lambda$ or anything ending in $b$", i came up with $r_1$, then i used FSM2Regex which gave me $r_3$ which i simplified into $r_2$ using regex simplifier.
now $r_2$ seems better t... |
I am trying to implement the nearest insertion TSP heuristic. However, I am wondering if it matters which node I insert into the subgraph first.
For example, should I start with one node; calculate the distance between this node and the other nodes; and sort the other nodes by this distance? Then, I will insert the cl... |
We are given array $A$ of $N$ integers each in the range $1 \leq A_i \leq 2^{30}$, that is we can write each integer with at most 30 bits. The target is to compute $\sum_{1\leq i \leq N,1\leq j<i} ( A_i \text { xor } A_j )^X$. $X$ is either 2 or 3. $N$ can be up to $50000$.
I know that this can be solved in $O(N^2)$ b... |
I'm struggling with the following question:
Let $\langle a_0, a_1,\dots,a_n\rangle$ be a sequence of real numbers, and let $ M =
\max\{a_0, a_1, .... a_n\} $ and $ m = \min\{a_0, a_1, .... a_n\} $.
a. Prove that there are two numbers in the sequence $x,y$ such that $ |x-y| \leq
\frac{M-m}n$.
b. Write an algorithm t... |
So I was browsing online looking for the general structure to proving a DFA has a minimum of $n$ states for some $n$ and most of them use contradiction. However, I'm having a hard time understanding why the proof of proposition 5 works in proving the statement.
My understanding of the proof is that we assume there's a ... |
Problem:
Given $N$, find the smallest number divisible by $N$ whose sum of digits is equal $N$.
For example:
$n = 1$, answer is $1$
$n = 10$, answer is $190$
There is some dynamic programming algorithm, but I can't find it.
It is sequence https://oeis.org/A002998.
|
Given a parameter $k$ and an array (not sorted) of length $n$ return all values which repeat more than $\lfloor n/k \rfloor$ times in $O(n \log k)$ time.
I've managed this in $O(nk)$ time, but can't figure out how to do it in the required performance.
|
I am new to automata. And learning to find concatenation of two FAs. But this one has confused me
I know how to do concatenation but I am confused that in FA 1, what does x1 means? Is it mean final state or does it mean both initial and final state because it is on the start?? Just clear me on this that what is initi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.