instruction
stringlengths
35
29.1k
To construct a reachability tree we start with the initial marking and then consider all enabled transitions and fire them one by one. That is, we find the marking corresponding to firing each. I can't see why is this meaningful because if we were simulating the petri net then starting with the initial state we would f...
I have tried to implement traditional binary search on an array. Now, if I set the mid index to be $mid = \frac{(right + left )}{2}$, my code does not run within time quota specified already, however, If I run it with $mid = left + \frac{(right - left )}{2}$ it works fine. Can you please give a hint what might be the s...
Say we have this algorithm in Python. def secret(S: list): n = len(S) while n > 0: n = n // 2 for j in range(n): if j in S: S.append(j) return S I need to find the strictest upper bound (Big-$O$). I have two approaches to solve this, which give me different solutions and I wou...
this is my first question on this site and I would like to preface this by saying I am not very savvy when it comes to Computer Science. So, I will try to ask this the best I can. I was doing some research on Polynomial time because that is what I was told hashing algorithms run on, correct me if I am wrong. So with th...
I was reading about hash functions in crypto and a website had mentioned that they were collision free, which obviously isn't possible if there are infinite input values that are mapped to outputs of a finite length. So what happens in the event of a hash collision? How do crypto currencies overcome this problem? Also,...
I just need to check my understanding regrading two points .As was stated in the textbook "Operating systems concept " : The compile-time and load-time address-binding methods generate identical logical and physical addresses. However, the execution-time address binding scheme results in differing logical and physical...
I need to compute the product of two polynomials $f(X)$ and $g(X)$ over a finite field. The degrees of these polynomials are $n^2$ for some integer $n$. However, we also know that the polynomials are sparse in the sense that most coefficients are zero and furthermore, only $O(n)$ of the coefficients are non-zero. Can w...
I'm working on a project that's attempting to cluster books using machine learning. I'm using the K-Prototypes algorithm for clustering data that has both numerical and class-based data. Under the hood it uses the K-Modes algorithm for class-based book fields (such as genre), and K-Means for numerical data (such as yea...
i have the following algorithm : j = 1 while j ≤ n do j = 2^j where n is our input and is a non negative integer I found the complexity of the algorithm to be O(1) . Can someone tell me if this is correct and if not can you tell me the right answer and explain the way you found it? Thank you.
Given $L_1,L_2$ which can be any regular / non-regular languages. Let $L_1$ and $L_1-L_2$ be regular languages. I want to know if $L_1\cap L_2$ must be regular or not. So, I wrote $L_1-L_2=L_1\cap L_2^c$ which is regular. From here I don't really know what to do, because $L_2^c$ can be wither regular or non-regular. I ...
I have been given the following problem and was wondering if my solution is correct (taken from the textbook exercise in the book Introduction to the Theory of Computation by Martin Sipser): Given $$\text{ALL}_{\text{DFA}} =\{\langle A\rangle \mid A\text{ is a DFA and }L(A)=\text{Σ*}\}$$ prove that $\text{ALL}_{\text{D...
I have been given the following problem and was wondering if my solution is correct (taken from the textbook exercise in the book Introduction to the Theory of Computation by Martin Sipser): Given $$\text{A}_{\text{εCFG}} =\{\langle G\rangle \mid G\text{ is a CFG }\text{that generates ε}\}$$ prove that $\text{A}_{\text...
I have been given the following problem and was wondering if my solution is correct (taken from the textbook exercise in the book Introduction to the Theory of Computation by Martin Sipser): Given $$\text{INFINITE}_{\text{PDA}} =\{\langle M\rangle \mid M\text{ is a PDA }\text{and L(M) is infinite}\}$$ Prove that $\text...
I am a computer science student, I am studying an algorithm course independently. In the course I got stuck with this question: $A$ 3-term arithmetic progression is 3 integers ${a < b < c}$ such that ${a + c = 2b}$. Given a set of integers $A\subseteq\left\{1,...,n\right\}$, find an $O(n \log n)$ time algorithm that co...
I need to store a list of strings in some files. In this moment, there are too many strings in too many files, which is a problem for me. Here is an example of strings: aaaaaaaa aaaaaaab aaaaaaac aaaaaaad aaaaaaae aaaaaaam aaaaaaan aaaaaaao aaaaaaap aaaaaabc aaaaaabd aaaaaabe aaaaaabf aaaaaabg .... aaaraaai aaaraaaj aa...
I was reading that a quantity $x$ is $0$ upt to numerical precision. What does this statement formally mean -- especially in the context of numerical methods or real computers. I looked up in google what that means but nothing useful came up. Then I read the precision page in wikipedia but it didn't really help: In c...
It is known that the language $\{a^nb^nc^n|n\geq0\}$ is not context-free (we can prove it using the pumping lemma, as shown here: Is $a^n b^n c^n$ context-free?). Yet, this answer claims it has found a context-free grammar for this language. My question is, is it possible to find a context free grammar for a not contex...
Alright this is another day of my pursuit to learn about how crypto works. I have several terms that I have found linked together. I was trying to do research on how the Target Hash is determined and how a Nonce is decided. But I think I am getting lost in several terms and need helping making the connections. I found ...
The question is from my homework: Is the language $\{a^ib^jc^k\mid i,j,k\geq0\land i\neq j \land j \neq p\}$ a context-free language (CFL)? If yes, please provide a context-free grammar for it. I found this question quite challenging, so I decided to post it here. My attempts: First I tried to show the language is not...
Several months ago I was doing research into calculating mining revenue for several crypto currencies. When trying to calculate BTC revenue I found this value 1/2^32 which was described somewhere along the lines of the probability of finding or solving a block. This value worked for finding revenue for several coins in...
I consider decision version of 3SAT problem. Main idea is to find congruent clauses and construct such maximum formula, which satisfiability/truth table won't be changed. In case of unsatisfiable formula, this "maximum core" size equals to 8/6 * (n - 2) (n - 1) n, where n is maximum literal number. Otherwise for satisf...
I got stuck with quite a simple problem: Given a positive number $X$ find the largest number $k$, for which exists the positive distinct integers $Y_1,…,Y_k$ such that $(Y_1+1)(Y_2+1)⋯(Y_k+1)=X$ Any of my approaches based on integer factorization or working with the divisors of the $X$ have failed. For example all my ...
Linear search is solvable in O(n) time by a deterministic Turing machine. If we apply a nondeterministic Turing machine to the problem, can we solve the decision problem "Is $x$ in the array $A$?" in O(log n) time or even O(1) time? If my understanding of nondeterminism is correct then the answer is yes because it can ...
Suppose we are asked to assign $N$ numbers into $K$ mutually exclusive groups. The partition has to satisfy two constraints for each group. The first one is that group $k$ must contain exactly $n_k$ elements. The second one is that the sum of all numbers in group $k$ must be in the range $(l_k, u_k)$. Of course we have...
I have been given the following problem and was wondering if my solution is correct (taken from the textbook exercise in the book Introduction to the Theory of Computation by Martin Sipser): Build a DFA that recognizes the following language knowing that E = {0, 1}, {w | w is any string except 11 and 111}. My solution ...
I have been given the following problem from the book Introduction to the Theory of Computation by Martin Sipser and was wondering if my solution is correct: Determine if a Turing Machine ever writes a blank symbol over a non blank symbol over the course of its computation on whatever string given on input, formulate t...
Here is the my attempt: Proof : Suppose $J = \{aa' \mid a \in A\} \cup \{bb' \mid b \in B\}$ such that $a'$ and $b'$ are the symbols that do not belong to any $w \in A \cup B$ and $a,b$ are strings. We build a Turing Machine(Oracle) $M$ on input $w$ : Query oracle if $wa' \cup wb' \in J$. If YES, Accept. Reject Oth...
I have been given the following problem and was wondering if my solution is correct (taken from the textbook exercise in the book Introduction to the Theory of Computation by Martin Sipser): Given {<R> | R is a REGEX that generates strings with 111 as substring} shows that it is decidable. My solution at the moment is:...
I've faced this question while I was solving some past homework and I couldn't really figure out how I would solve it. Question: Prove that $L=\{a^ib^jc^k\ |\ i\neq j,\ i\neq k,\ j\neq k\}$ satisfies the pumping lemma even though it's not a CFL. Note: There's no need to prove that it's not a CFL. The purpose of the que...
ASSERT( P ) /* determine what is P */ A[i] = A[m]; A[k] = 2; ASSERT( A[i] == x + 5 )
Both these algorithms determine if all the parenthesis in a string are balanced and properly nested. The first algorithm uses "a constant amount of memory, regardless of the length of the string." The second algorithm "may use O(n) memory but must use a stack". I understand how the algorithms work but I don't underst...
Prove/Disprove: If $L$ is finite and $R$ is not regular, then $R\cup L$ is not regular. I think that this one is true, but I am stuck: Since $R$ is not regular, it is infinite, so $R \cup L$ is also infinite. Since $R$ is non-regular, it must be that $R \cup L$ is not regular. It just doesn't feel complete for me... An...
This problem is from LeetCode. You're given a string num representing the digits of a very large integer and an integer k. You are allowed to swap any two adjacent digits of the integer at most k times. Return the minimum integer you can obtain also as a string. My question is, why does the following greedy algorithm...
I once had an idea for a multithreaded regex engine. The first method that occured to me (there may be other ways to do it that I haven't thought of) was to split up the string being matched against into chunks and it would introduce parallelism by having the coroutines which are processing the string hand off to the n...
Let there be given set of vectors $V = \{v_1, v_2, ..., v_n\}$ and set of vectors $S = \{s_1, s_2, ..., s_k\}$ where $n > k$. The set of vectors $V$ can be constructed by $S$ if the vectors in $V$ lie in the linear hull/span of $S$. In order for this to be possible, the vectors in $V$ must not be linearly independent (...
The bisection width problem gives you a yes or a no -> if there exists a bisection of size at most $K$ for $G=V,E$. Minimum Vertex Bisection problem gives you a bisection of the smallest size. Bisection Width is NP-Complete, I want to prove Minimum Vertex Bisection is also NP-Complete by deriving a reduction from Bisec...
In a traditional radix-balanced tree, the height of the tree can be determined quickly by counting the leading zeros of the number of elements of the tree, and indexes to node children can be determined by taking successive chunks of bits from the element index. However, consider a radix-balanced tree which is almost f...
I'm recently in to the algorithms and I'm having trouble finding the time complexity(Big-Oh notation) of the following algorithm: for(int i=0;i<=n;i++){ for(int j=i;j<=n;j=j/2){ for(int k=0;k<=n;k=k*2){ //set of statements }}} Can anyone help me to determine the complexity of the following algorithm. I found the inner...
I'm trying to make a data structure $A$ that has the following features: insert($a$) operation : insert given integer $a$ to $A$. It is assured that all integers are unique. delete($b$) operation : delete $b$ from $A$. smallestNotInRange($p$,$q$) : returns the smallest value $k$ such that $k\in [p,q]$ and $k \notin A...
I am new to this community and I have a question regarding a problem I was trying to solve. Could anyone review my algorithm for solving this problem? I want to emphasize also that the algorithm must use the Quickselect algorithm (i.e. https://en.wikipedia.org/wiki/Quickselect). The question is : Given an array A[1..n...
I get that it depends from the number of probes, so by how many times the hash code has to be recalculeted, and that in the best case there will only be one computation of the hash code and the complexity will be O(1) and that in the worst case the hash code will be calculated a number of times equal to the size of the...
Recently while studying arborescences in graph theory, I came across Edmond's theorem for $k$ edge-disjoint arborescences in digraphs if a finite digraph is $k$ edge-connected from a vertex r for some $k \in N$, then it has $k$ edge-disjoint spanning arborescences rooted at $r$ Now, I do understand what is meant by a...
What wiil be grammar rules for the language L={a^n b^n c^n d^n; n>0}
This is a "revision" of this question, it contained an error I now see. In a nutshell, I was wondering if in the halting problem proof the decider $D$, after recognising its source code in the input fed to it, could leverage the fact it can look at the source code of $H$ to help its clone in the input make the right pr...
Let $a$ initially be an empty string. One can transform $a$ into $b$ in the following way: $a$ becomes $a_{left}+$"$abc$"$+a_{right}$, where $a=a_{left}+a_{right}$ in a prior state. $a_{left}$ or $a_{right}$ can be the empty string. Given a string $b$, check if it is valid, i.e. check if it can be obtained from $a=$"" ...
I am learning about time complexity now, and I am working with BST (Binary Search Trees). This question needs some context and this is a follow up post to this post. Basically, I would like to compute the time complexity of the function below. The function below refers to a BinarySearchTree where 'u.l' represents the l...
I have a set of records (2 or more for each person) on multiple peoples locations (latitude and longitude) with timestamps. each record has: person ID, latitude, longitude, timeStamp. for each 2 people I wish to know if they have been under distance d from one another for over time t. Is there an algorithm that can hel...
If I have a bunch of diodes arranged in some complex, directed graph, can I get it to do computation? I mean will it add voltages and, for example, as I insert voltage sources in-between the diodes? Can I implement a J/K flip-flop? Thanks.
Say we have a list of ranges like so: ranges = [(0, 100), (101, 200), (201, 300)] The ranges will always be ordered, never overlap, and perfectly align. We want to optimise the complexity of O(p + kl), where p is the preprocessing time, k represents the number of lookups of a range and l represents an individual lookup...
I was going through the concept of graphs as matroids and I came upon the rank of a graph. Wikipedia lists it as $n - c$, $n = |V|$, $c =$ # of connected components. I do understand rank and nullity of matrices, and graphs when expressed in their incidence matrix form have a one-to-one correspondence with the rank of i...
Is there a way to implement Kruskal's algorithm for finding the MST of an undirected graph using priority queues? The standard implementation uses the disjoint set data structure but I was curious if a PQ implementation is possible, and potentially even better in time complexity. I looked it up online and found a PQ im...
Section 4.4 of "Introduction to Algorithms, 3rd Edition By Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein" illustrates how a recursion tree provides a good guess for the recurrence $$T(n) = 3T(\lfloor n/4 \rfloor) + \Theta(n^2) = 3T(n/4) + cn^2$$ where c is a constant. The authors assume t...
I am going through the paper https://pubsonline.informs.org/doi/abs/10.1287/moor.10.4.701 which is A Note on Finding Minimum-Cost Edge-Disjoint Spanning Trees and the authors are James Roskind and Robert E. Tarjan. In it, there is an algorithm to generate an augmenting sequence used in updating edge-disjoint forests. ...
I read that the first-order model checking problem is intractable on general graphs. How is this shown? Would be happy about some reference! Thanks in advance
I was reading about zero-knowledge proofs. I understand how one can convince their colour-blind friend that the two chosen balls have different colours. Now what happens if the two chosen balls have the same colour - is there a zero-knowledge proof that will convince your colour-blind friend that they are the same colo...
I have multiple rays of the form: \begin{align} x_1 &= c_1 \\ x_2 &= c_2 \\ &\dots \\ x_d &= c_d \\ \end{align} And need to find all intersection points between each one of them and a given polytope in $d$ dimensions, when I have the vertices and the $d-1$ polytopes which are his facets. For 3-d, Wikipe...
Recently I have been studying ways of traversing a BST (in python), and have collided with the terms pre-order, post-order and in-order. I believe that I understood the three terms pretty well, and have tried several exercises and examples, which I got right. But I have problems when formulating a relation between thes...
I'm currently trying to prove that $L=\{a^n b^l : n \leq l\}$ is not regular by pumping lemma My proof: If we choose $w$ such that $w=a^P b^P$, then since $|xy| \leq p$, $y$ must be $a^P$, meaning it can be pumped any number of times $i$, such that $a^{iP} b^P \in L$. Since $iP \leq P$ is not true for any $i > 1$, it c...
I'm trying to decompose deduction steps of DPLL algorithm -- unit propagation and pure literal elimination -- for parallelization. However, I want a baseline and asymptotic analysis to compare to my parallel approach for these two deduction procedures. My naive approach to unit propagation would be to perform linear sc...
Given $n=2k$ pairs of points $P=\{(p_1,q_1),(p_2,q_2),\dots,(p_k,q_k)\}$ in the plane. Also, let $d(.)$ return distance between two points. Now, our goal is to act as bellow: For each $(p_i,q_i)$ repeat bellow loop that partition points into $A$ and $B$ as follow : Create empty array $A$ and set $A=A\cup p_i$. Now...
I know $a^nb^n$ with $n\geq0$ is considered a context-free language, but if I try: Using pumping length $p = 3$ $n = p$, thus we have $aaabbb$ $u =aa$ and $y = bb$ $v = a$, $w = b$ and $x=λ$, then $|vwx|=2\leq p=3$ and $|vx| = 1 \geq 1$ $uv^iwx^iy \notin L$, for instance, with $i=2$ we have: $$aaaabbb$$ I know I'm wro...
The following problem is from a past algorithms course exam and I'm using it to test my knowledge. There are m machines and n jobs. Each machine can doing a subset of jobs. Each machine i has a capacity $C_i$, meaning that it has $C_i$ units of processing time. Each job $j$ has a demand $D_j$, meaning that it requir...
Given two permutations $\pi_1$ and $\pi_2$ of numbers $\{1,2,\dots,n\}$, can we find $\mathrm{LCS}(\pi_1,\pi_2)$ in $O(n\log n)$? I think we can use LIS but I get stuck.
Section 4.4 of Introduction to Algorithms, 3rd Edition By Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein gives the following to verify that $O(n^2)$ is an upper bound for the recurrence $T(n) = 3T(\lfloor n/4 \rfloor) + \Theta(n^2)$: \begin{align} T(n) &\leq 3T(\lfloor n/4 \rfloor) + cn^2 ...
I've asked the following question on StackOverflow: https://stackoverflow.com/questions/71819288/mongodb-vs-elasticsearch-indexing-parallel-arrays I think that getting theoretical information on this subject can help me better to grasp the context and maybe I'll be able to answer my own question. Note: I've changed the...
Section A.1 of the Mathematical Appendix of the CLRS, the third edition, page 1146, contains the following formula stating linearity property of summation applied to $\Theta$ notation: $$ \sum_{k=1}^{n}\Theta\left ( f \left ( k \right ) \right )=\Theta \left ( \sum_{k=1}^{n} f\left ( k \right )\right ). $$ And states ...
Given a directed graph G=(V, E) and a sink vertex t. Edge costs may be negative, zero, or positive. consider d(v) contains the length of the shortest path from v to t Given a new sink t2 in the graph, how can we compute the shortest distance for each vertex to this sink t2 using the originally given function d My Thoug...
Below is the code. public static boolean twoPositive(int[] num) { int i = 0; while ( i < num.length ) { int j = i + 1 while (j < num.length) { if (Math.min(num[i], num[j]) > 0) return true; j++; } ...
In http://mattmahoney.net/dc/dce.html#Section_32 Matt Mahoney states: The simplest of these is the order 0 coder fpaq0. in http://mattmahoney.net/dc/dce.html#Section_41 he states: An order 0 model uses no context. but in http://mattmahoney.net/dc/fpaq0.cpp the Predictor (model) is defined with a context: class Predic...
I am trying to understand the relativization barrier from Baker Gill Solovay (BGS). About this barrier, I have heard that it only applies when using a black-box simulation. Hence, my question is, what would be an hypothetic white-box simulation (that would skip the relativization barrier)? It seems to me that, the prob...
Suppose you have a set of rectangles $R_1,\dots,R_n$ in the plane, each described by an upper left point $p_1 \in \mathbb R^2$ and a lower right point $p_2 \in \mathbb R^2$, all pairwise different. You are set the task to paint them in a certain order (shuffled from $1,\dots,n$) so that a rectangle never gets totally o...
How to determine tag, index and offset size in a two-way associative cache with a 1MB two-way set associative cache with 8 byte blocks
The following problem is on page 1104 of the CLRS textbook: I was wondering how to show that the problem is NP-hard (i.e. part b)? Like subset-sum, this problem is weakly NP-complete; it has a pseudo-polynomial time dynamic programming algorithm. Let's say I choose to reduce via subset sum. We want to find the sch...
This really isn't a complicated question to ask but it is one to answer... From the very fundamentals of binary code why are computers and similarly, computer language, just so insecure? Should we just scrap all of it one day and start over? Computer security challenges are not necessarily winning against viruses, are ...
An electronic book is made up of 500 pages and there are 16 lines of 2400 bits lines of each page. compute the space it will ocuppy on a computer in GB
Let's say I have a service where I provide user registration. The user chooses a ID. Now if I already have someone who is registered against that ID, I will inform the user that this ID is already used so try something else. Now I want to provide some suggested IDs to the user based on what information I have while sig...
So usually bin packing algorithms compute the tightest packed solution. I want to calculate the opposite, in my case the solution with the most space between the packed objects is needed. I tried googling for such an algorithm, but I can only find "normal" bin packing solutions. I need to pack polygons into a given spa...
Suppose $L$ is a language with a finite number of strings. We know that $L$ is regular. If $M$ is the minimal DFA for $L$, prove that $L$ has exactly one state that we can't exit if we enter it. I know this statement is true because $L$ has a finite number of strings, so a string with a length longer than the length ...
I need some help finding or creating a consistent hashing algorithm with the following properties: Given N buckets, only distributes keys to bucket N. When number of buckets are increased from N to N+1, only keys in N have to be migrated to N+1. When number of buckets are reduced from N to N-1, only keys in N are migr...
I'm new here and im struggling right now on the following task: I have to show that: (L1 ∩ L2) o L3 = L1 o L3 ∩ L2 o L3 L1, L2 and L3 are three languages over the alphabet Σ. o stands for the concatenation of two languages. kind regards
In his paper The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software, Herb Sutter writes: The mainstream state of the art revolves around lock-based programming, which is subtle and hazardous. We desperately need a higher-level programming model for concurrency than languages offer today; I'll have m...
Consider binary words in {0,1}^n whose Hamming weight is at most some constant d. We want to select some of these words such that they form a group under addition. How many words can we choose at most?
Let Size(O(n)) be the set of languages the can be decided by a circuit ensemble (a sequence of circuits C_i for every natural i s.t input size is i) such that every circuit's size is linear (in input size). I would like to prove there exists a decidable language that doesn't belong to the set defined above. I tried usi...
I was reading the Wikipedia article on Turing completeness, but I was having a hard time putting together all of the concepts. In simple terms, what does it mean for an instruction set to have Turing-completeness?
I'm reading section 7.3 (SINGLE CYCLE PROCESSOR) of Digital Design and Computer Architecture, Second Edition by David Money Harris. At the end of the section the autor shows this MIPS processor and says that "Each instruction in the single-cycle processor takes one clock cycle". The autor also says that "Result must s...
I have some questions about CPU caches I would like some clarification on. Assume that I have a 128 KB cache with a block size of 64. It is 4-way associative. How many sets does the cache have? How many bits are used for the offset, index, and tag, assuming that the CPU provides 32-bit addresses? How large is the tag ...
Let $S$ be a finite set of points on the unit sphere $\mathbb{S}^2$. My question would be: is there an easy way to either find a great circle $C$ such that all points in $S$ are inside one of the hemispheres defined by $C$ or return that such a great circle does not exist. This can of course also be seen as a problem i...
Is there any research/information on matching vector family sets (the U list or the V list or both) that form a group (under addition)? You can find the definition of MV families here: https://homes.cs.washington.edu/~anuprao/pubs/codingtheory/lecture11.pdf
Here in the USA there is a lot of controversy over the practice of gerrymandering. Every ten years the states are divided up into new congressional districts and whoever is in charge creates bizarrely shaped districts to suit their own political ends. So the question is -- is there an algorithm to optimize, or at least...
I am trying to find an algorithm which, given a set of N points on a 2D plane, can find all pairs of points at a distance of exactly 1. I believe this is similar to this question. I looked at the answers to the linked question. One answer mentions a "Well Separated Points Decomposition", although I am unsure of how to ...
According to my understanding a 32-bit machine determines the number of bits of physical address as 32 bits , and hence , we can address a physical memory space of 4GB. So the number of bits of physical address depends on the machine type . My question is what about the virtual address ? I mean what is used in a machin...
I'm looking up the complexities of sorting algorithms. There can be performance harm when the array is already presorted when running certain algorithms. E.g. Using last element as pivot in quick sort would harm the performance when the array has already been pre-sorted. However, when I attempt to cross check with othe...
In Rosen's book Discrete Mathematics and Its Applications, 8th Edition it is mentioned that: You may be surprised that mathematical induction and strong induction are equivalent. That is, each can be shown to be a valid proof technique assuming that the other is valid. One of the examples given for strong induction ...
If AC-3 algorithm returns an empty domain, we know for sure it cannot be solved. But given that it returns only domains with at least a variable in it, do we know the CSP is solvable?
In the analysis of algorithms textbooks that I've seen, as far as I could tell, the runtime of an algorithm is defined intuitively. Is there a simple formal definition of this concept? I.e. a definition which fully formally, for some particular simple and general programming language defines the runtime of a program in...
I've been trying to find a function $T(n)$ whose asymptotic rate of growth satisfies both of the following conditions: $T(n)= o(\log^*n)$ $T(n)= \omega(1)$ But I can't think of a function with this rate of growth.
This is my first post here. We are currently studying regular expressions, and I have been tasked to write a regular expression for the language of all words which do not contain the substring $aba$, for the alphabet $\Sigma=\{a,b\}$. We were firstly tasked to write a regular expression for all words which do contain t...
Given a generic tree with $n$ weighted nodes, there are $n-1$ edges. Removing any of the edges will partition the tree into two distinct trees, hence we can construct $2(n-1)$ possible trees in this way. Is there a way to find the node with the maximum value in each of these resulting trees, that is all the $2(n-1)$ va...
Given a set of jobs $J$ and a set of machines $M$, where the link between machine $i\in M$ and job $j\in J$ has a positive weight $w_{ij}$. The problem is to select a perfect matching between the jobs and the machines such that the weights of the matching are as close as possible to each other, i.e., the best solution ...
I am struggling with a mapping reduction that I think cannot be correct, but I'm not able to say exactly what's the problem. Let $L_{u}= \{\langle M,w\rangle \mid M\text{ accept }w\}$, $\overline{L_{u}}= \{\langle M,w\rangle \mid M\text{ does not accept }w\}$ and $L_{\epsilon} = \{M \mid \epsilon \in L(M) \}$. (Part 1)...