instruction
stringlengths
35
11.4k
Given a set T={A,B,C}, I need to know the cardinality of all ordered sequential n-grams and the total cardinality of all subsets of those n-grams. To be clear, the subsets MUST retain order as they appear in the original set. The ordered sequential n-grams of the set T above are {{A},{B},{C},{A,B},{B,C},{A,B,C}} and ...
From P5 in this paper: https://hal.inria.fr/hal-01094195/file/CIC.pdf Using this purely functional part, it is possible to encode many int eresting notions. For instance ∀ C : Prop , C is a logical proposition (a term of type Prop ) which encodes absurdity ( ⊥ ) : there is no closed term of typ...
After perusing the web and cs.stackexchange in particular, I've come across many different wonderful resources in Computer Science - from Sipser's "Introduction to the Theory of Computation" to books on Languages or volumes on Cryptography. However, what I couldn't find was a general introduction to Computer Science, a...
By the completeness of FOL, one can show that a sentence $S$ in FOL is valid, i.e. that it holds true in every model, by exhibiting a proof of $S$. Such a proof string is a certificate of the validity of $S$. To show that $S$ is not valid, one can either exhibit a counterexample model in which $S$ doesn't hold, or find...
Preface We can define a system of logic by conjunctions of rules that system must follow. For example, if we wanted to define transitivity of numbers: $$F_1: \forall a,b,c. a < b \land b < c \rightarrow a < c$$ We could similarly define associativity: $$F_2: \forall d,e,f. (d + e) + f = d + (e + f)$$ Then we could defi...
Consider the following regular expressions letter = a + b + c + d LETTER = A + B + C + D digit = 4+5+6+7+9 R1 = (LETTER + digit + !) • (letter • digit)∗• (letter + digit) R2 = (LETTER + digit + ?) • (letter + digit)∗• (LETTER + digit) R3 = (digit + ? + !) • (letter∗• digit∗)∗• (LETTER + letter) R4 = (digit • letter + ...
I have following unfinished proof of a lemma: Goal forall (P : Type -> Prop) (Q : Prop), ((forall x, (P x)) -> Q) -> (exists x, P x -> Q). Proof. intros. eapply ex_intro. intros. apply H. intros. eapply H0. The problem is the last eapply failed, with the message Error: In environment P : Type -> Prop Q : Prop H...
I have read in Wikipedia (and other sources) about the limited backtracking algorithm of Even, Itai & Shamir for solving 2-SAT problem in a linear time, but the approach doesn't seem to be linear, there is no demonstration nor algorithm implementation to check it. Here is the algorithm description from Wikipedia: Even,...
I'm trying to write a function in Python that takes it argument as a Python list and returns a boolean value based on the truth vale of the proposition $E(x) \to \exists y \text{ s.t. } x=2y$, where here the proposition $E(x)$ means 'x is even'. print(check_prop([-2,-1,0,1,2,3])) gives an output true print(check_prop(...
I've looked at Hungarian algorithm and Knapsack problems and neither quite hit the nail on the head. I've been trying to best rephrase my question while searching for answers and haven't got anywhere. I have agents j and tasks i. Each agent can have between 1 and 4 task preferences (each with the cost 0-3), but must ha...
I am implementing a hash table that may need to grow and shrink as the number of stored keys varies. I have a hashcode function that uniformly hashes keys to positive 32-bit integers. The table itself will use a smaller array of approximate size M. If I wanted to use the hash function to produce a value between 0 and ...
I am pretty new to Neural Networks and I have two questions about hidden layers: 1. What is the purpose of hidden layers? I was wondering this because obviously you can get every result you want with just one weight per input, as you're performing a multiplication. 2. How should I choose the number of hidden layers and...
I'd like to know why when choosing how to optimize an algorithm that there almost always (always?) exists a time/space tradeoff. Definition: https://simple.wikipedia.org/wiki/Space-time_tradeoff. My favorite example is a karnaugh map for simplifying boolean logic. It abstracts boolean logic away with just clever geome...
A set is countable if it has a bijection with the natural numbers, and is computably enumerable (c.e.) if there exists an algorithm that enumerates its members. Any non-finite computably enumerable set must be countable since we can construct a bijection from the enumeration. Are there any examples of countable sets th...
I am writing a method which evaluates multiple status enumerations and determines an overall status. I'm looking for what this process might be called and perhaps some theory on it. It may be best to provide an example. Consider an alarm system, where individual sensors report one of three states: Alarm Safe Unknown ...
It might seems weird, but, Are there any undecidable problems concerning regular languages? I mean questions concerning the regular languages, not the problems like "Is the language of a TM regular?". Clarification: By the questions regarding regular languages, I mean that the problem consists of regular languages, i.e...
I am trying to write an algorithm for finding best path for an electric vehicle to navigate through network of chargers. A graph with Vertices representing charges and Edges representing distances among them is provided Assume that car drives at constant speed (ex. 80 mph) and has a fixed maximum mile Range when its f...
So I was asked to prove (or not) whether, in gale shapley algorithm, everyone can end up married to their second partner of choice or not. I think not but then I am not able to come up with a proof. Thanks! :)
I am going through Wirth's Textbook on Compiler design . After proceeding though some pages , I realized I have taken for granted my understanding of some of the terminologies that have been used . For example ,the following terms : the examples mentioned in the lines in the screenshot refer to the following set of ...
Computational Complexity Theory is complex. My understanding of polynomial time is in relation to other time complexity classes, such as non-deterministic polynomial time. This is fine for engineers and mathematicians, but I'm looking for a simple definition of the term, suitable for laypeople. Would it be incorrec...
What is the difference between switches, flags and options when you want to specify something on the command line? Are they all synonyms? Are there any reasons why some terminals require: -op1 --option2 and others: /option1 /option2 and when processing data, some require: --data file.txt and others: /data=file.txt ...
My professor said exponentials will always have higher time complexity compared to polynomials. My question is, do exponentials also have higher time complexity than factorials? I plotted a chart in Matlab to check it myself. When range of x is small, from 1 to 10, I get the following chart, %Matlab script x = [1 : 10...
To give a clear definition: 1) No wire delay 2) Any number of bits(including infinity) doing NAND(and therefore all the lead-out logics) operation cost O(1) time 3) There are only finite layers(so you can't find a logic chain longer than a fixed value) 4) There may be an input of countable infinity size To define calcu...
I was trying to solve the following problem: You are given a grid of size N×N that has the following specifications: Each cell in the grid contains either a policeman or a thief. A policeman can only catch a thief if both of them are in the same row. Each policeman can only catch one thief. A policeman cannot catch a t...
How can one assign n people pairwise to n-1 tables, in a speed-date fashion, such that no two persons meet twice and each person is at each table exactly once? Does this problem have a name? The problem in full Given n people (n is even), assign them in pairs in n-1 rounds. Each round represent a list of n/2 pairs, eac...
I'm currently trying to learn about computer vision stuff and I want to try it on a simple project of real time tracking of figures of players in a foosball game while the camera can be moving a little bit above the table. The first goal I want to achieve is detecting (and tracking) the bars on which the figures are at...
Given integers $g, h, k, n$ how to find the smallest integer with $k\ 1$-bits that is the sum of two integers with $g, h\ 1$-bits respectively. Moreover, all three numbers (summands and sum) can have at most $n$ bits, i.e. the result is the n-bit number with $k\ 1$'s and $(k - n)$ zeros, for instance $\underbrace{0......
Let's say we have array of $K$ integers, and we have given $N$ intervals in the form $l_{i}, r_{i}$, both inclusive, the interval $i$ means that all elements in the range $[l_i, r_i]$ are covered. Our task is to check for any of those $N$ intervals is the interval $i$, or the range $[l_i, r_i]$ being covered twice or m...
As part of an assignment for an AI class that I'm taking, I'm need to solve a puzzle on a 4x4 grid using breadth-first search (each element can take on 12 different values). There is a maximum of 4 moves for each state. Needless to say, after 30-or-so moves, the number of nodes (each representing a state) in the queue ...
Conceptually, to track the multitude of "state positions" arising in an NFA while it is processing a given input string, a quantitative notion of memory/cache/storage is required per "fork" of execution over the automaton, for keeping track of the states where the computation is currently "at". What is the typical theo...
In Haskell, Monad is a class of type constructors which act on types that have the following functions implemented: (>>=) :: m a -> (a -> m b) -> m b (>>) :: m a -> m b -> m b return :: a -> m a and they satisfy the following "laws:" return a >>= f = f a m >>= return = m (m >>= f)...
Given a set of 2D polylines such that each polyline: May have self-intersections; May intersect some of (or all) the other polylines, How do I efficiently find all pairs of intersecting segments and the coordinates of each corresponding intersection point? (We may assume that no three segments intersect in the same p...
I'm having a problem coming up with a regular expression for a language L = {a,b} with out the substring bab or abb? I can come up with the one for just one substring, like a*(b* aaa* )* b* a* to eliminates the bab and b*(a+ab)* to eliminates the abb substrings. But putting them together is a huge animal :(
This question is related to: Landau Notation, Definitions: Limits vs. Cormen's. Consider functions $f, \ g : N \rightarrow R^{\geq0}$. For small-$o$, the definition: $$f(n)\in o(g(n)) \iff \forall c>0,\exists n_0>0, \forall n\geq n_0: f(n) < c \ g(n)$$ Can also be expressed as a limit (i guess this assumes the limit e...
I am lost in formulating a mathematical model for my linear integer program. My problem is; how to include inventory and backlogging. The following is given: 1100 units can be produced each month Unit production cost = \$7 Inventory unit cost = \$2 Annual expense = \$10.000 Sales unit price \$12 We have given the dema...
Suppose that $P^{SAT} \not\subseteq coNP$. Prove that $P\ne NP$. What I did: Suppose that $P=NP$. Then, $P = coP = NP = coNP$. We know that $P^P = P$. Then, by assumption: $P^{NP} = NP = coNP$ Since $SAT$ is $NP$-complete we get: $P^{SAT} = coNP$ in contradiction to the assumption. So $P\ne NP$. I've been told that my ...
I've got a theoretical exercise at my university which belongs somewhere between alpha blending and ray casting – to be honest, I’m not sure. It says, that we are looking at a voxel (1-centimeter distance) which consists of different colors (sand: yellow, stone: red, oil: green and water: blue) where sand and water are...
Some of the logics admit Gentzen-style sequent calculus. Are there universal algorithms that allow to find proof (derivation of the proof) in sequent caculus for every hypthetical theorem? Some of the proof assistants support formalization of general sequent calculus that can allow to define sequent calculus for the co...
How would I prove that these two regexes are equal to one another? $$ (a \cup b)^* = (b^*(a\cup\lambda)b^*)^*$$ I'm permitted to use the following regular expression identities.
I have a table like below. Each row has store id, discount % for one of their coupons. Each store could have multiple coupons but (store+discount %) is a primary key. I would like to find out top 10 coupons (by decreasing order of discount %) but would like to get only 2 coupon from the same store. What is the most eff...
I am recently learning the theory behind Coq and learnt that positivity condition guarantees termination of the program. But my question is, what would you think of the following definition? Inductive t : Set := b : t | c : ((t -> unit) -> unit) -> t. Sure it won't compile in Coq, but would it jeopardize termination g...
So for a project I am working on. I need to take a string representation of a floating point number, lets say "1.5" and do arithmetic on it with another floating point number. The catch is I cannot use floats to do this, since it specifically says in the requirements for my homework that I can't do this. How I am suppo...
Hey, this is a question from my handouts, but how would I go about writing a recursive program that would return the number of pairs of an ancestor and a child, whose sum equals to n, given that the program takes inputs of (tree t, sum a) for example given this tree and 13, it will return 5 in the end, 13+0, 15-2, 6+...
There is an integer array and 2 variables Q and M.The output required is the number which has the maximum frequency in the array, but the catch is that each number in the array can be increased/decreased by M and that too Q number of times. In case of multiple answers print the first one. eg: array:1,2,3,4 and Q=1,M=1 ...
Do we have knowledge bases only because the logics are not automated enough? I.e. - is it true, that the ideal situation would be that we use the set of logical formulas as the knowledge base together with the deduction services of the relevant logic as the reasoning services for this "knowledge base". But not all the ...
Say you need to write a function such that you have string a and string b. The function argument is a concatenation of string a and string b. The function prints string a and string b separately. I'll explain. For example one can think of a naive solution such that 'x' will be a separator character and so if we want to...
I'm thinking these familiar concepts of DO and LET/LET* in the context of Lambda Calculus (LC). LET is an abbreviation for this LC expression: (LET a 1 b 2 e) = (λ a . (λ b . e) 1 2) and LET* is an abbreviation for this LC expression: (LET* a 1 b 2 e) = (λ a . (λ b . e 2) 1) where e is the body of the function. LET* ...
Let's say I start with: $A \rightarrow Ba$ $B \rightarrow dab | cBb | Acb$ Now I want to make this grammar LL(1), so I need to get rid of the left recursion. I'll work with $B \rightarrow Acb$. I'll replace where $A$ occurs with its production: $B \rightarrow dab|cBb|Bacb$ And that gives me a direct left recursion, whi...
Normally, Simulated Annealing (SA) is used in TSP problem to find the near-to-optimal solution, and the graph structure in TSP is a complete graph. Therefore, I want to know whether or not I can use SA for finding the shortest path/optimal solution in a non-complete(connected undirected) weighted graph in the 2 dimenti...
Given matrix $M\in\Bbb F_q^{n\times n}$ with rank $r$ what is the complexity of converting to row-echelon form? Is it $O(n^3\log q)$ or $O(n^3q)$ bit operations? Technically $O(n^3)$ row operations in $O(\log q)$ bit words should be $O(n^3(\log q)(\log\log q)^2)$ bit operations in worst case when $q$ is prime. What ...
In short, is this similar to how $a^nb^n$ is not a regular langauge? $L$ = {$ { a^nsb^n : s \in L(a^*b^*) ,\ n \ge 1 } $} For instance, if we have the string $w=a^psb^p$, and we know that $|xy| \le p$, there would simply be a disproportianate amount of a's or b's regardless of where we put $y$ ?
I'm new to Coq, and my (rather limited) understanding is that inductive types are like algebraic datatypes in Haskell, so there is a constructor data T = A a with some arguments, and the result A a is a T: specifically a T, so I understand stuff like this: Inductive List := Nil : List | Cons : nat -> List -> List. whe...
I'm confused about how we can use the Myhill-Nerode Theorem to solve this problem, some pointers would be very helpful Let $Σ = {\{a, b}\}$ and $C_k=Σ^*aΣ^{k-1}$ Prove that for each k, no DFA can recognize $C_k$ with fewer than $2^k$ states.
I need an algorithm that gives me integer numbers with the following features: Numbers must be in a given range $[n..m]$; Numbers must be returned in pseudo-random order (random at visual inspection is enough; it is more important that numbers are well distributed over the given range); Numbers may not repeat before e...
My understanding is that a machine with finite states cannot keep track of the n's being the same in $L$ = {$ { a^nsb^n : s \in L(a^*b^*) ,\ n \ge 1 } $}, similar to the case with how $a^nb^n$ is not a regular language. For instance, if we take a string $aaaa ab bb$, where the fifth a and the following b are $s$, how ...
Consider the algorithm below Precondition: n is a non-negative integer function f ( n ) { temp = 0 if (n != 0) { for (i = 1; i <= 3; i++) temp = temp + n * f(n-1) return temp } else return 1; Solve for the closed form by repeated substitution
I am aware of Turing's proof of the undecidability of the halting problem (and I think I understand it). What I'm asking is quite different. I shall define what I mean by "effectively solvable": A problem $P$ is effectively solvable if there exists an agent $A_P$, such that for any specific instance of $P \, (P_i)...
I want to compress the string 0cc175b9c0f1b6a831c399e269772661. I can do so by storing the string a, and, when decompressing, using a as input for the MD5 hash algorithm to get the original string. I realize it's impossible to represent $2^{128}$ possible strings with inputs less than 128 bits long, even if MD5 had no ...
I have a combinatorial puzzle to solve. The puzzle has 10 interconnected spots for polyhedral blocks to fill in. The blocks have these attributes: weight, shape (denoted by number of faces, $n_{\rm block} \in [4, 14]$, $n_{\rm block}=4$ is a tetrahedron, $n_{\rm block}=5$ is a pentahedron etc.), a rank number print...
I am not sure if this question is more suitable for CS, theoretical CS or math so feel free to improve the description and migrate it. In a scenario very similar to popular binary classification machine learning contests, competitors are required to submit their answers to the test set containing N data points. The acc...
How does one easily determine if an algorithm has an exponential time complexity? The Word Break naive solution is known to have a time complexity of O(2n) but most people think its O(n!) because of the decreasing subsets as you go down the stack depth. Word Break Problem: Given an input string and a dictionary of w...
I am working on theory of computation problems, and I came across this one: Show that for A and B, a language J exists such that $A \leq_T J$, $B \leq_T J$ The only $J$ I can think of for the moment is the language that uses a $TM$ $N$ which contains a recognizer $M1$ for $A$, and another recognizer $M2$ for $B$. $N$ ...
By using this fooling set, I am able to prove that the concatenation of bz is in the language L, but I still need to prove that az is not in the language to complete the proof. This is also the point that the ceiling function is very tricky to deal with. It is also where I am lost. Any hints and suggestions will be a...
few days ago I attended a interview, and the interviewer asked me a very common but strange question. Explain static and dynamic binding without using method overloading and method overriding ? I explained him the concept but, I am not able to give him the example without overloading and overriding. So I want to ask, I...
In a programming language with short-circuiting, a conjunction of N independent conditions has the following expected cost: where: t_i = the expected cost of evaluating a conjunct p_i = the probability that a conjunct evaluates to true I am trying to prove the following statement: If you have an optimally ordered co...
It's said that in Zermelo–Fraenkel set theory (ZFC) one can develop all of mathematics. How about computer science? Is it possible to define algorithms as a first step? More specifically, how to define "if x = 1 then y else z"? How about loops?
I have trouble understanding The classic Mailbox Manufacturers Problem. You can read it here: https://open.kattis.com/problems/mailbox I have also found a solution text: http://www.ida.liu.se/projects/progcontest/progsm/2002/prognm2002-hints.pdf I just cant get my head around this problem and i cant even understand the...
in the textbook of CLRS, p.1062 he says the following: if we use "reasonable" encoding of a graph as its adjacency matrix, the number m of vertices in the graph is $\Omega (\sqrt n)$, where n = |$\langle G\rangle|$ is the length of the encoding of G. I want to know why $\Omega (\sqrt n)$? I mean it is adjacency matr...
Imagine you need $n$ random numbers from a Gaussian distribution with $\mu=0$ and $\sigma=1$. And you need to use each of these $n$ numbers $k$ times in various operations. Let's identify the numbers by $j \in 1 \ldots n$. I see 3 methods of accessing these $n$ numbers during the operations: Generate $n$ numbers once,...
How can i draw a PDA which has only 2 states and accepts strings which have odd number of a and even number of b? the alphabet is {a,b}, and the PDA has to be only 2 states?
I have $n=6*10^4$ people which should be sorted into groups. Each person has a list of up to 20 preferences according to which they should be assigned, and a score for each group (a real number). There are $\approx2*10^3$ groups, each taking $5 \leq k_{group} \leq 250$ people at most. Imagine a following scenario: Eac...
I'm having a hard time wrapping the idea in my head. Can anyone explain this as different from Sipser's perspective? (I saw one discussion in reddit but it's for regular languages) https://www.reddit.com/r/compsci/comments/1pnjrp/the_pumping_lemma/
We can have acceptance with empty stack, but in that case our stack at the start has to have a A in it, otherwise this machine will accept the empty string which is wrong But can we have a non empty stack at the start? is my method right?
$L=\{W_1W_2 \mid W_1 \ne W_2 \: \text{and} \: |W_1|=|W_2|\}$ Alphabet = { a , b }* Considering L={WW} is not context free, shouldn't this be non context free as well? otherwise can you provide a machine or grammar which accepts this?
I started an algorithm course in C two months ago, for the last weeks I've been trying to solve this problem , i ran out of time but I cannot find an acceptable solution. Basically It's a coin change problem, Given a sum (S) I need to find (and print) the combination that uses the least amount of coins, I can only use ...
I know that with the knapsack problem in general, there is no known greedy algorithm to solve it. But, say we add the following constraints: • All items have values equal to their weights (for all $i$, $w_i = v_i$) • The weights are all powers of 2 (for all $w_i$ there exists $n ∈ N$ such that $w_i$ = $2^n$). Now, a k...
Which kind of collision resolution for a hash table should I pick if I want to store a mapping from key of type uint64 (word) to value of type uin64 (word) from key of type string to value of type uint64 respectively?
I've read this similar question How to prove correctness of a shuffle algorithm? and I understand the answer. However I still couldn't figure out how to apply that inductive proof to a similar shuffle algorithm --- inside-out shuffling algorithm, which is as follows: for i from 0 to n − 1 do j ← random integer ...
I'm taking the course computer networks and we currently had our second lecture. We got the following question: What are the differences between integrity and confidentiality of a message? Is confidentiality possible without integrity? What about integrity without confidentiality? Explain. From what I understand the ...
Hey so I'm studying for a midterm and I've run into this problem in the material. I'm not sure how to go about solving it. If I use regular induction in part a, I get something a bit tautological. Any suggestions? Questions As we all know, US dollar is the official currency in United States. There are different bills o...
The problem emerged from a practical case, but thinking on it resulted more and more theoretical directions. Typically, the lock-free algorithms do relative simple things in the practice, but their implementation is already not very simple. It has mainly debuggability reasons. However, it shouldn't be so, if there woul...
I've just started my undergraduate course and have tried my hands on MIT's OpenCourseWare on Discrete Math on Logic and Proofs. There was a particular question asking to prove Cantor's Theorem: Problem 4. If a set, $A$, is finite, then $|A| < 2^{|A|} = |\cal P(A)|$, and so there is no surjection from set $A$ to its po...
I have the following question as homework in an algorithms, analysis and data structures class: And here's an answer I wrote up: A queue is a first-in-first-out data structure. A heap is a data structure that makes searching for objects in a sortable space faster than linear search. Now, every data structure needs to...
If I wanted to create a sentence like: African elephants can carry coconuts; Asian elephants cannot. How would I do that with propositional logic?
Does $n\log n = O(n \log n + n)$ hold? I don't think it does trivially because I think as $n$ grows larger, $n\log n$ will converge to one value, and as the $+ n$ grows, $n\log n + n$. But I am uneasy about my initial thoughts about this. For example, mergesorting a list and then iterating through each element to com...
Is the VC dimension of an origin-centered circle 1 or 2? It seems to me that the VC dimension of an origin centered circle should be 1, because for two points with distances from the origin r1 <= r2, r2 will never be able to be labeled 1 without r1 also being labeled 1, so the r1 = 0, r2 = 1 labeling could never be pos...
I have been asked to give a formal description of a finite state machine. I have tried for over five hours to minimize it, to understand what gets accepted, and what gets refused, to no avail. I really am in need of help. If solving the problem does not seem reasonable, I would really appreciate any tips to attack this...
My question was around the rolling hash function in RobinKarp algorithm. It is intuitive for me to understand how to get from xi to xi+1 without the mod, however with the mod i am not sure how we still get the right answer. Is there any mathematical theroem anyone could quote which would help me understand? So i get, x...
If you observe the results of many image segmentation algorithms, you can notice the occurrence of region borders where a human observer wouldn't draw one, for instance across slow gradient/textured areas. This seems to be a universal phenomenon. I have annotated the image below with yellow arrows to show what I am thi...
Microsoft is committed to the building of the scalable, industrial size topological quantum computer, Visual Studio integrated programming language and SDK will be released by the end of this year (2017). From the other side, logical/symbolic methods in computer science (natural language processing, inference, knowledg...
What does $\omega{(1)}$ mean as a factor? In some papers, there exists some asymptotic analysis which comprises a product of multiple Landau notation like $\omega(1)\cdot O(logN)$. In this example, what is the meaning of the additional factor $\omega(1)?$
I wounder why the complexity of algorithms always depend on the size of the input, but not on the size of the output. For example, in a problem that I have solve, the size of the input is exponentially smaller than the size of output. In addition, the complexity of the algorithm is polynomial by the size of the output,...
I know that if a set is a decidable, there exists an algorithm that enumerates it and prints value 1 if a given element belongs to the set and 0 otherwise. Therefore, its image is decidable, too. I think, though, that this is not true for the preimage of of the set under a partially computable function. Can someone pro...
I'm given that two sets, $A$ and $B$ are enumerable. I have to show that there exist subsets $A \supset C$ and $B \supset D$ ($C$ and $D$ also enumerable) such that $C$ and $D$ are disjoint and $A\cup B = C \cup D$. I was thinking to take $A=B=\{0,1\}$ and define $C=\{n : f(n)=1\}$, $D=\{n: f(n)=0\}$. Do you think thi...
Hello, all, First time poster, here. Anyways, here is my question from the textbook Introduction to the Theory of Computation, 2nd Ed. (Sipser, 2006). Question 1.19 is asking us to convert a regular expression to a nondeterministic finite automaton. The regular expression is given as: (0 union 1)* 000 (0 union 1)* Whic...
The book that I'm reading says it is equivalent But what about the aa string ? i produce it this way : $$ S\Rightarrow S_1B\Rightarrow aS_1bB\Rightarrow aaB\Rightarrow aa $$ But that language doesn't have aa in it, what am i doing wrong here?
I’ve always read advice and warnings about the poor scalability and time spent trying to invert a matrix and why it’s better to solve a system of equations whenever the inverted matrix will be used with a product of something, e.g. (A^-1)b vs. solving Ax=b. However, I’ve been playing with matrix factorization through a...
Consider given directed unweighted cyclic graph with $N$ nodes, and $N$ edges, and each node has at most one out-going children. Find the longest path. Example Consider the following graph, the path $2, 3, 1$ is the longest covering all 3 nodes. What I think for the solution Because every node has at most one children...
I am trying to apply Linear Regression method for a dataset of 9 sample with around 50 features using python. I have tried different methodology for Linear Regression i.e Closed form OLS(Ordinary Least Squares), LR(Linear Regression), HR(Huber Regression), NNLS( Non negative least squares) and each of them gives differ...
I am trying to understand how the master theorem is invoked on the following recurrence relation: $$ T(n) = \sqrt{6006} T(n/2) + n^{\sqrt{6006}}. $$ So basically, I found the following source where they have Master theorem definition defined. I found the similar solution (See the Link #1 in the comment below) where the...