instruction
stringlengths
35
29.1k
I am trying to solve a regular expression of binary string where every even position is a '1' I've solved this for an odd position: (1(0+1))*(1+ε) How would it look like for an even position then? Thanks in advance.
Say I want to quantitively evaluate the effectiveness of several color-to-grayscale conversion algorithms, which can be considered as lossy compression. Would entropy be a good indicator? To calculate the entropy of a file, I first convert it to a byte stream with hexdump(1) or some other methods (see below). Next, thi...
In this link it is mentioned: A DFA is not powerful enough to recognize many context-free languages because a DFA can't count. But counting is not enough -- consider a language of palindromes, containing strings of the form $ww^R$. Such a language requires more than an ability to count; it requires a stack. I would...
I would like to calculate the complexity of an algorithm using the "inequality strategy". This algorithm takes two integers as an entry $n, m$. Moreover this algorithm is recursive and if we denote $C_{n,m}$ the number of operations this algorithm does for entry $n, m$ we have the following inequality : $$C_{n,m} \le...
Is it possible to have a data structure that supports both insertion and delete-min (or max) in $O(1)$? You can assume the numbers that will be inserted are integers in the range [0,n] and that you will be inserting a maximum of n elements.
Consider verifiers in the usual sense: Non adaptive : reads all positions of the proof predefined Adaptive: Reads the proof iteratively. Many lecture notes on PCP say the following: Adaptive verifier with q queries is equivalent to non-adaptive with some q' queries where q' is a constant and both using same randomness...
I am reading CLRS relating to perfect hashing. When computing the $$ \mathbb{E}[\sum_{j=0}^{m-1}{n_j\choose{2}}] $$ where $m$ is the number of slots in the hash table, and $n_j$ is the number of keys in position $j$. I don't understand why we can directly conclude that $$ \mathbb{E}[\sum_{j=0}^{m-1}{n_j\choose{2}}]\leq...
I am curious about utilization calculation in the bitmap protocol. especially if there's a difference between if only station 0 wants to broadcast(and the others doesn't) or only some other station want to broadcast(but the others doesn't) an example of a problem regarding this: in a bit map protocol with 10 station(nu...
Maybe this is quite simple, but I am having some trouble how to do this reduction. I want to reduce Subset Sum to Almost Subset Sum. Subset Sum: given a set of positive integers $A=\{a_1,a_2, \dots,a_n\}$ and an integer $M$, decide if there is a subset of $A$ with a sum equal to $M$. Almost Subset Sum: Input: a set of ...
If this link can be any help https://codeforces.com/blog/entry/63164 A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. A minimum vertex cover is a vertex cover with minimal cardinality. Consider a set of all minimum vertex covers of a given bi...
Define a language $L$ as follows: $$L = \{\langle M \rangle \in \{0, 1\}^* | M\text{ is a TM that halts on all strings of even length} \}$$ I can prove that $L$ is not decidable/recursive, but is it recognisable/recursively enumerable? My intuition is that $L$ is unrecognisable because suppose there exists a TM $N$ tha...
I've been recently dealing with the classical problem of finding the minimum vertex cover in a bipartite graph. The common approach is to set direction to all edges and run DFS from all vertices of the left part outside of the matching. However, this solution seems too clever for me. I read this in this link. Can any b...
I am currently studing questions but stuck on this one, I hope someone can help me out to understand. Question: Assume that we have a paged virtual memory with a page size of 4Ki byte. Assume that each process has four segments (for example: code, data, stack, extra) and that these can be of arbitrary but given size. H...
Looking at the syntax of the programming language C and others inspired by it, I cannot help but ask the question in the title. Mathematics, logic and other subjects have been existing for many ages and so have natural languages and all of their symbols. Still, instead of respecting these conventions fully, designers o...
Is it true that backtracking is allowed in deterministic finite automaton (as mentioned in many comparisons between DFA and NDFA)? If yes, how is it possible when transition in DFA is to a single state?
I am looking for some sort of communication or consensus algorithm with the following properties: Can be used with just two parties (and ideally doesn't collapse to a trivial case with two parties) Requires each party to initiate some sort of communication to which the other responds (ideally in a binary way) Non-hier...
How to formulate the following problem? The salesman gains a profit $p_{i}$ when visiting a city i, trip between city i and city j costs $c_{ij}$ and takes $t_{ij}$ time. The trip must not exceed a time limit T. The difference between profit and costs must be maximized. I've formulated this problem as follows: maximi...
Suppose, I got a hypothetical fixed list of all possible general Sudoku puzzles. I then create the pseudo-code to demonstrate the algorithm. The algorithm does a search to compare the indexes of elements in the puzzle that are not listed as zero. In other words, all the possible listed Sudoku grids are compared unti...
Define: $$L=\{(G,k) : G\text{ has a vertex cover of size at most $k$, and a clique of size at least $k$}\}$$ I need to determine whether $L\in \mathrm{NPC}$ or $L\in \mathrm{P}$. I suspect that $L\in \mathrm{NPC}$, been trying to prove it by looking for a reduction from Vertex Cover, but couldn't find one.
I was wondering, if we take some regular language, will it be in Space(1)? For a regular language X, for instance, we can construct an equivalent NFA that matches strings in the regular language. But I cannot see why is X in Space(1). If it is true, why is X or any other regular language in Space(1)?
Suppose one has a tree with each node weighted with a tuple (say, some fixed $2$ dimensions, for now) of integers. Now we query the tree with two vertices $x$ and $y$ and a range $[a,b]\times [c,d]$, and the query should return the number of nodes in the (unique) path from $x$ to $y$ such that their tuples fall within ...
I can calculate the time complexity of the following loop: for (int i = 1; i < n; i++) The time complexity of it is $O(n)$. but I can't calculate the time complexity of the next two loops. I can't find any hints. for (int i = 0; i < n; i+= 2) for (int j = 1; j < n; j*= 2)
Note: The input file is an excel file. However, I am only looking for help with the algorithm as I can then code it in VBA. I need to scan both columns (shown below) to find any number of column 1 values that when summed match the setpoint (E2) and column 2 values that when averaged match the setpoint (E3). One constr...
Type theory and syntax are similar, in that they are inductive rules that determine whether a particular string of symbols is "correctly specified" in some sense. There is a difference between syntax and type theory. Syntax in programming languages for example, concerns things that do not concern type theory, such as ...
Using Tomasulo’s algorithm, for each instruction in the listed sequence determine when (in which cycle, counting from the start) it issues, begins execution, and writes its result to the CDB. Assume that the result of an instruction can be written in the last cycle of its execution, and that a dependent instruction ca...
For a given set of Wang tiles on an $L \times L$ plane (where a tile is $1\times 1$) we first need to determine whether a tiling of the plane is possible. If so, we can then consider the problem of how to construct such a tiling. Is it known what the computational complexity of these problems are (i.e., how they scale ...
We are given an undirected tree on which we should add the minimum number of edges such that there are no bridges in the new graph. An edge $e$ is a bridge if the graph with that edge removed is no longer connected. For example, here is a tree with 8 nodes 1 2 2 3 3 4 4 5 3 6 3 7 3 8 At least three edges should be adde...
How to reduce 3-SAT to subset sum problem?
Some programming languages, apart from functions, have generators (eg. Python's yield). Although generators are introduced in this Python's tutorial on functional programming, I don't think that they can be considered functional programming, because they do have state, and in a vary implicit manner. Generators are remi...
Frequently in cs blogs and books I see this notation, =>* and =>+ but I am not sure how it is being applied in a production rule and it's significance. What exactly does it represent, and can you show an example of it being applied.
I am looking for an algorithm to find the optimal matching/allocation of n individuals in m identical vehicles. The aim is to create groups of individuals who will share these vehicles. Groups' size is bounded. An individual i has incomplete preferences over the other individuals (some are not included into i's prefere...
I want to find the fewest traversals to visit all vertices of a DAG. To take a very simple case: Boston -> New York -> San Francisco or Las Vegas, both to -> LA -> Pittsburgh -> San Francisco or Las Vegas, both to -> LA There are lots of ways to traverse this graph, but to visit every vertex, you only need: ...
I am studying about some compression methods, and I'm very interested in RLE Algorithms. But are there any Nested-Level RLE methods, such as: ABABABCABABABC --> 3(AB)C3AB(C) --> 2(3(AB)C) ? It's easily to decompress it by using some techniques like stack, but what is the most efficient way to compress it, any formal al...
I'm working from a definition of the LL(1) property of context-free languages in order to build a LL(1)-computer, i.e., a program capable of determining whether a given context-free language is in LL(1). The definition requires the disjointness of certain sets; each set is defined as an infinite limit, but practically ...
If we have data from a random population, a 3d histogram of throughput and current cache size of DRAM (intersection of a IOPS & a cache size will have a count). How can one use queuing theory to estimate the best possible cache size ?
Here are a couple of questions I struggle with. (We use $A'$ to denote the complement of the problem $A$.) A problem $A$ is NP-complete if and only if $A'$ is in NP? A class problem $A$ is NP-Complete iff $A'$ is in NP? (Is there any difference between these two?) I got this claim to be true that If there is an NP...
I have 4-bit data with the hamming code 0010011. the parity parameters are: p1=0 , p2=0 , p3=0 and the check codes are: c1 = 0 , c2 = 1 , c3 = 0 so I thought that I have an error in position 2 of my data but the solution says that I can not detect the position of the error. my question is: when I can find the position ...
Let's say $X, Y$ are dependent random variables. Can I find an example such that for a transcript $t$ conditioned on a communication protocol $\Pi=t$, the variables become independent?
I have a search operation taking place on a server that essentially queries images using OpenCV against other images from a database. Since each image query operation is quite expensive computationally, I want to find a good way to sort the images in the database to compare them in a good order. I want the program to b...
I need to show that $Disc_\mu(Disj) \geq \frac{1}{2n+1}$ for any distribution $\mu: \{0,1\}^n \times \{0,1\}^n \to [0,1]$. Disjointness is defined as $Disj(X,Y)=\left\{ \begin{array}[ll]+1 & \text{if $X \cap Y = \emptyset$} \\ 0 & \text{otherwise}\end{array}\right.$ The discrepancy for a function is defined as $Disc...
I'm trying to prove that a given language is regular through proving that a DFA can be created from it, but have problems with how to the DFA should look. The alphabet is $\Sigma=\{0, 1\}$ and the language is: $$L = \{x \in \Sigma^*\mid \#_0(x)>\#_1(x)\text{ and }\#_1(x)\leq3\}\,,$$ where $\#_i0(x)$ means the number o...
I have the following language: $$\text{POSITIVE-3-SAT} = \{\langle\phi\rangle \mid \phi\text{ is a satisfiable boolean formula in conjunctive normal form,}\\ \text{ in which all clauses consist of exactly 3 literals and in which no variable appears negated}\}.$$ Progress so far: My concern is that I have not understo...
I need to show that the following language is not regular. $$L = \{\ ab^jc^j\ |\ j \geq 0\ \}\ \cup\ \{\ a^ib^jc^k\ |\ i, j, k \geq 0 \ and\ i \neq 1\ \}$$ There is also a hint that it cannot be proven just with using the Pumping Lemma. Closure properties must also be used. I'm having a hard time with this one. Any he...
I'm reading the following course on second-order logic, by Péter Mekis : http://phil.elte.hu/mekis/sol.pdf . The course seems excellent, but I'm stuck on one of his first examples for showing the power of second-order logic w.r.t first-order logic. In this example, he works on the following statement : "Santa Clau...
We add the following derivation rule to the structural operational semantic: < repeat S until b, s >$\Rightarrow$ < S; if b then skip else (repeat S until b) > Prove that "repeat S until b" is equivalent to "S; if b then skip else (repeat S until b)" in the structural operational semantic. I've tried the following: In...
today I found this term in our exercises: ((^fx.f(f(f x)) ^gy.g(g y )) ^z.z + 1) (0) I am quit unaware how to solve this type of question. I know this is the church numeral 3 , 2 , the identity function +1 and zero. But for my understanding it lacks an operator like +-*/ as ex. (λmn.m (succ n)) to connect two church n...
There is no algorithm that, given an arbitrary grammar, decides if it's ambiguous or not. However, Are there any sufficient conditions that make it easier to tell that a grammar is unambiguous? For example, if I'm not mistaken, it can be algorithmically checked if a grammar contains no conflicts under LR(1), LALR(1) or...
I'm studying propositional logic the section on "valid arguments". A self-assessment question reads "Show whether or not the following argument is valid" $\frac{P}{C}$ I don't know what function to apply to P to calculate C. The solution in the back of the book shows the following truth table: Variables Premise Concl...
I've come across this problem while trying to work out a table-formatting algorithm. It's very similar to standard linear programming (though it uses $>$ instead of $<$; I'm not extremely familiar with linear programming, but I believe this doesn't matter much). Let $\vec v = (v_1, \dots, v_n)$ be a vector of positive-...
I'm a bit confused on what exactly the meaning of a 'key' is in computer science. I understand key-value pairs, primary keys, etc... But I can't find a definition of what the term 'key' means by itself. As far as I can tell it just means a piece of data. In CLRS, data associated with tree nodes are referred to as 'keys...
multiplying by 33 --> $2^5 + 2^0$ is same as (num << 5) + 1 and by 65599 as (num << 16) + (num << 6) - (num << 0) How do you get these numbers though i.e. 16,6?? I know log can be used but Is there any other quicker way to do this? EDITED___________________ what I need to do is create a hash function such that I have t...
To understand fully, please read link After, reading the link we will take a look at how we recover our solutions to a constrained Sudoku Puzzle. If we assume that a sudoku puzzle was generated with this procedure we can now create a "semi"-solver. I say "semi" because we need the $3 \times 3$ grid $M_{2,2}$ already so...
I'm given an integer vector which is said to contain many duplicate values (total of k distinct integers), for example [1, 4, 2, 5, 5, 3, 4, 2, 2, 5] (n = 10, k = 5) and am asked to find a sorting algorithm that averages $O(n + k\log{k})$. I've concluded that partial quicksort (or quickselsort) might achieve this, bu...
I got a question that I don't fully understand: Given a new algorithm to merge sort (AKA mergesort2) that instead of splitting the list in the middle it splits the list in a random number between $1$ and $n-1$. Also, we know the probability of getting $1$ is $2/n$ and to every other number $1/n$. I have tried again and...
To say that graph isomorphism is downward self reducible means the following: There is an algorithm which decided graph isomorhpism for two given graphs of n vertices in polynomial time by accessing an oracle that solves graph isomorphism for (n-1) vertices. To be clear, the oracle only tells 'Yes' or 'No'. It does not...
Background Given multiple trees, I'd like to merge all of the them and be able to efficiently unmerge arbitrary trees in the set. For example, here are some JSON trees: Tree 1: { a: { b: 1 }, c: [{}], d: 3 } Tree 2: { a: { z: 1 }, c: [ { x: 1 }, { x: 2 } ], d: 4 } ...
This question and this question got me thinking a little bit. For sorting an array of length $n$ with $k$ unique elements in $O(n + k \log k)$, we need to be able to store counts of values in the array. There are some suggestions, but I'm looking for a way to do this in worst case linear time. More specifically: Given...
https://en.wikipedia.org/wiki/LALR_parser - as far as I understand, LALR(1) is a simplified version of LR(1), aiming to achieve a greater parsing performance at the expense of reduced power. So, IIUC, LALR(1) is a strict subset of LR(1): each grammar parseable by LALR(1) is parseable by LR(1), but not the other way aro...
How to find the closed form solution of this equation? Is there a repeatable pattern for solving this equation? $$T(n) = \begin{cases} 1 & n = 1\\ 5T(n-1) + n^2 & \text{otherwise} \end{cases}$$
So i understand how to use radix-sort in base 10 and utilize mod 10 to go through the numbers. But not sure about 2,8 or 16. Does it follow the same idea? and i read somewhere that i need to pass the base number to the radix function but not sure why would that be needed? because if i have for example: int arr[] = {0x...
supposedly for some graphs there exists valid shortest path lengths between two nodes of the graph that cant be constructed by breadth first search. what defines these shortest paths that breadth first search cant reach?
On CodingBat.com there's a problem that asks for the length of the longest sequence of repeating characters within a string: (https://codingbat.com/prob/p179479) Given a string, return the length of the largest "block" in the string. A block is a run of adjacent chars that are the same. maxBlock("hoopla") → 2 maxBlock...
I've learnt about problems about express N as sum of 2, 3, 5. For examples, if N = 7: N = 5 + 2 N = 2 + 5 N = 2 + 2 + 3 N = 2 + 3 + 2 N = 3 + 2 + 2 But most of I found on the Internet that the different position is different way to express N (as this link for expressing N as sum of 1, 3, 4). Following that link, I tr...
Is there a better way to represent an AND of $n$ variables together other than creating $O(n)$ new variables and constraints?
I'm trying to argue that N is not equal NP using hierarchy theorems. This is my argument, but when I showed it to our teacher and after deduction, he said that this is problematic where I can't find a compelling reason to accept. We start off by assuming that $P=NP$. Then it yields that $\mathit{SAT} \in P$ which itse...
I've implemented an algorithm, that when analyzed should be running with the time complexity of $O(n \log n)$. However when plotting the computational time against the cardinality of the input set, it seems somewhat linear and computing $R^2$ confirms this somewhat. When then sanity checking myself by plotting $n$ on t...
If each edge of a graph $G$ is unweighted or has equal weights, then the shortest path between two nodes in that graph is the path that contains the fewest number of edges. Such a path can be obtained by BFS. Here, I consider that each weight of the edge is the minimum of the end vertices and the weight of the path is...
I would like to find a maximum weight independent set in a finite section of a King's graph. For an $m\times n$ King's graph where $n \ll m$, we can use an $O(2^{2n} m)$ bitmask dynamic programming solution. We proceed row by row, and on each row, we try all possible ways to select cells. On the other hand, it is not o...
I'm confused between these two terms as for example - the Auxiliary space of merge sort, heapsort and insertion sort is $O(1)$ whereas Space complexity of merge sort, insertion sort, heapsort is $O(n)$. So, if someone asks me what's the Space complexity of merge sort, heapsort or insertion sort then what should I tell ...
Consider the following language: $$ L = \{ G | G \text{ has a VC of size at most } \log n \} $$ Does $L\in P$ or $L\in NPC$?
$\forall A, B \in NP \implies A<_m^{poly}B. \lor B<_m^{poly} A.$ I want to know is there any work around this theorem? or is it correct?
Suppose that there is a specific instance of a graph for which the approximation ratio of an algorithm polynomially increases with the number of nodes of the graph, say the approximation ratio is $n^2$. Further, suppose that the number of nodes of that bad instance can be easily increased. For example, assume that the ...
I have a simple turing machine with single tape. I need to compare two words <w1>$<w2>$ and write output. Language is all letters and numbers. I did comparation with the {a,b} language but there are more characters. Is only solution do it one by one in different branches? I mean read / mark the letter (enter the letter...
In this article, the author states that a 64bit processor can theoretically reference 2^64 bytes of memory. What does he mean by this statement, or rather the word, reference? Also, I visualize the entire RAM to be divided into little memory cells, each having an n-bit binary number that represents a given instruction ...
I would like to know the number of strings at edit distance $n$ of a string $s$. I guess this is textbook knowledge... but I cannot find the textbook in question. More formally, I have an alphabet $\Sigma$ (in my case, $|\Sigma| = 4$), and I consider all the words in $\Sigma^*$. I use the edit distance $d$. I am lookin...
According to this video, he explains $$p = k(k+1) / 2$$ Where $p$ is the sum of the first $k$ natural numbers. I understand $k$ means times of repetition and $k+1$ is how it increments, but why does he divide by $2$? I can't justify it. Here is what the video describes: for (i = 1; i <= n; i++) p += i $$\begin{arr...
I need to decide which solution is the best design, in order to do that I need to compare them. Lower energy used and lower weight is better. My initial idea was to order both the fields best to worst and chose based on which one finished higher but whats better 3rd and 2nd, or 1st and 4th? Pareto front is a set of non...
I am working on a project in which I need to parse files written in different DSLs. One important feature of these languages is that most of them allow blocks to be nested. For parsing those files I am required to use a handcrafted parser written in C++. More specifically, I need to extend the given parser and lexer ba...
Assume we have $n$ double elements $a_1 \dots a_n$. We want to find out if two of the elements of the array are identical. And we have a hash function $h(x)$ which assigns each double value an integer between $1$ and $n$ and which can be calculate in $O(1)$ time. Let $m := \{(i,j) : a_j \neq a_i \text{ and } h(a_j) = ...
I have pointer to circular doubly linked list with random values of 0 or 1. Example: [{prev,0,next},{prev,0,next},{prev,1,next},{prev,0,next}...] I have a single pointer to the first item of the list. I need to find the length of the list without to create any additional pointers. In addition, I can change the values ...
In my formal languages class, we discussed DIV, defined as following: $\mathrm{DIV} = \{\langle a,b\rangle : \text{$a, b \in N$ and $a$ has a divisor $d$ for some $1 < d \leq b$ }\}$ ($\langle\cdot\rangle$ means encoded, let's say as binary) We were told that it isn't known whether DIV is in P and were tasked to prove ...
I am trying to prove the NP-Completeness of Min-satisfiability problem which can be defined as: Given a CNF formula (Set of clauses of 1 or more boolean variables) and a number x, there exists a satisfying assignment of those variables such that number of true variables in the assignment is less than or equal to x
An undecidable problem is a problem that cannot have any algorithm to solve it. Post correspondence problem can be solved using a brute force approach. Then how can it be an undecidable problem?
Consider a hypothesis class $H = \cup_{n=1}^{\infty} H_n$, where for every $n\in N$, $H_n$ is finite. Find a weighting function $w : H ->[0, 1]$ such that $\sum_{h \in H} w(h) ≤ 1$ and so that for all $h \in H$, $w(h)$ is determined by $n(h) = min\{n :h \in H_n\} $ and by $|H_n(h)|$. Since every $H_n$ is finite, it i...
i am working a prototype using some cryptographic properties. the question is simple but perhaps deep enough for me to decide : sha256 is a strong hash function, but i have space for 248 bits only. my guess is if i remove any 8 bits the resulting mySHA248 will keep all good properties with slightly less entropy/collisi...
The smoothing function of a boolean function with respect to one of its variables is the disjunction of its cofactors. For example given a Boolean function F(a,b,c) the cofactors with respect to a are F(0,b,c) and F(1,b,c), the smoothing function with respect to a therefore is G(b,c) = F(0,b,c) + F(1,b,c). Now, given ...
You have a 2D integer matrix given. An element is a peak element if it is greater than or equal to its four neighbors, left, right, top and bottom. For example neighbors for A[i][j] are A[i-1][j], A[i+1][j], A[i][j-1] and A[i][j+1]. For corner elements, missing neighbors are considered of negative infinite value. If so...
Is there a straightforward way to characterise the number of inversions in an array of length N having distinct elements, each element an integer from 1 to N? It's for a constraint optimization problem, where the number of inversions needs to be minimized.
I'm working through Swierstra's 2008 paper. I'm up to Section 3 eval addExample, just before 'Automating injections'. And boy! does it need automating. Is it just me, or is the whole thing over-engineered? Compare this in the paper addExample :: Expr (Val :+: Add) addExample = In (Inr (Add (In (Inl (Val 118))) (...
Since a MILP problem is not necessarily NP hard. How could I demonstrate that a MILP problem is actually NP hard? There exists some smart and easy method to do that? Many thanks!
I am looking for a solution to this problem: Given multiple sets of letters (Set0={a,b,c,d}, Set1={d,e,f,g}, Set2={a,b,e,g}, ...), what is the minimal length of the string containing all the sets. The sets have to be present as one substring, it is possible to duplicate letters in the final string, and it is also possi...
I have a dataset as follows Biodata last_name first_name age Description Hobby Smith John 20 In high school Music Johnson Robert 45 Software Developer Gardening Williams David 15 Junior school Baseball Davis Michael 65 Traveler Skydiving Miller Mol...
Betweenness centrality is defined as the number of shortest paths that go through a node in the graph.The formula is: $$\sum_{s \neq v \neq t} \frac{\sigma_{st}(v)}{\sigma_{st}}$$ Where $\sigma_{st}$ is the total number of shortest paths from node $s$ to node $t$ and $\sigma _{st}(v)$ is the number of those paths that...
Assume that we have an imaginary programming language that allows you to assign a Literal to a variable, but does not allow you to set the the data type of the variable, for example Allocate4Bytes an_int_variable 123456; Allocate2Bytes a_short_int_variable 123; Allocate4Bytes a_float_variable 2.1;...
Is this language regular? $0^k10^k \ with \ k\geq1$ It needs to count the starting and ending zeros which is impossible with finite states. Update: This is the whole problem from the book: Let $\sum = \{0,1\}$. Let $A =\{0^ku0^k \ | \ k \ge 1 \ and \ u \in \sum^*$}. Show that $A$ is regular. My reasoning is that $u$ c...
I'm reading 'Introduction to the Theory of Computation' by Michael Sipser. He gives an example of a NFA, stating that this particular automaton accepts $a$ (he lists other strings as well, I just want to focus on $a$). But when he demonstrates how to convert the NFA to an equivalent DFA, he says: state $1$ goes to $\e...
To check if $n$ is prime, one only need to try dividing $n$ by numbers up to $\sqrt{n}$, meaning that the complexity would be $O(\sqrt{n})$. In my opinion, $O(\sqrt{n}) < O(n)$ so this simple algorithm is already P. But why did people think that primality test is NP, and were surprised by the AKS primality test?
Lets say we have integer variables $a \in\mathbb{Z}^n$ and $M \in\{0,1\}^{n\times L}$. I am promised $a_i \leq L$, for some fixed constant $L$. I want to model the constraint $$M_{i,j} \iff (a_i=j)$$ in an integer linear program. What is the most efficient way to do this in an ILP? In particular, can I do this wit...
Problem statement: Given an undirected graph $G = (V, E)$ with edge $e_i$ having two associated positive values $c_1, c_2$. Find a spanning tree $ST$ such that (ratio of the spanning tree): $$\frac{\sum{c_1}}{\sum{c_2}}$$ is minimum. Motivation: competitive programming problem http://acm.timus.ru/problem.aspx?space...
EEG and Audio data are very similar, both are numerical samples in continuous sequence have a sample rate need and can have multiple channels channels for multi-channel audio channels for each electrode have predictable characteristics that are exploitable for compression. FLAC is specifically designed for eff...