instruction
stringlengths
35
29.1k
I am having a very difficult time trying to understand what exactly this question is asking. How many valid English plaintexts are there for the ciphertext message CJU using a length-3, one-time pad of cyclic shifts, (i, j, k)? If the encrypted question message is CJU and the one time pad is i, j, k would there not b...
I could guess why computers have arithmetic operations like add, sub, and mult instructions. It is to compute numbers, but I don't get why branch and jump instructions exist. I am asking what theory or purpose for implementing branch and jump instructions is there? I've tried to get rid of branch and jump instructions ...
Is existence of registers in CPU an obligation, Or we just do it for performance? Can we theoretically and practically have computer architectures that don't use registers? If yes, please name computer architecture and computer models that doesn't have register. Update: Do stack machines use register? If yes, is it pos...
Usually I see that in the structural operational semantics representation for the while loop, the program state don't change: $(while \> B \> do \>S, \sigma) \rightarrow (if \>B \> then \>S; (while \> B \> do \>S) \> else \> SKIP, \sigma)$ For me, this not intuitive, if the state don't change (i.e. the status of the me...
Can we think of NP using a parallelism model instead of using a "checking relation" without loss of generality? From what I understand from the problem statement given by Stephen Cook, The notation NP stands for “nondeterministic polynomial time”, since originally NP was defined in terms of nondeterministic machine...
It's written in wikipedia https://en.wikipedia.org/wiki/Turing_completeness#Games that the video game Braid is Turing-complete. I've played Braid before but I can hardly reconcile it with Turing completeness. In what sense is it Turing-complete?
Given the following recurrence relation, $T(n) = 2 T(\frac{n}{2}) + f(n)$, where $f(n) = \Omega(n^2)$, I'm asked to prove or disprove that $T(n) = O(f(n))$. If I'm allowed to restrict my discussion within the special cases in which that $n = 2^k$ for positive integer $k$, how can I prove or disprove the proposed bound,...
who can help me explain the concepts of "Semantic Web", "Semantic Network", "Semantic Search", "Knowledge graph"(not Google's Knowledge Graph) and "knowledge base" and the relations among them?
By non-trivial algorithm, I mean anything besides the trivial "do nothing" algorithm that simply terminates. This is pretty trivial, but don't algorithms require a notion of monotonic time? From what I understand, all computation requires a sort of reduction step, from the reduction of the transition function in Turing...
In my class we have to answer a question: Having this pseudocode: XPTO(n) sum = 0 if even(n) for i=1 to n sum = sum + i else sum = 0 and knowing that even(n) have complexity ϴ(1), we can say the complexity of XPTO is ϴ(n)? Justify. How do I justify this?
When I was reading about counting sort in Introduction to Algorithms for the first time, I stopped reading after the step where they calculate the number of each element in the input array. It's the first thing we do after allocating an auxiliary array. I was sure the algorithm would look like this: public static int[...
Example of Data This is the data for one monkey. There are many similar but different monkeys. X(Y,Z) means Y, Z are parent of X. A(D,E) If monkey see banna (D) and monkey is hungry (E), it squeaks (A). B(E,F) If monkey is hungry (E), and monkey see other monkey, it jumps(B). C(D,F) If monkey see banna (D), and it ...
I'm currently watching a video on the analysis of Krager's Algorithm, and I am confused about something. The analysis goes as follows: Fix a min cut $(A,B)$. Let $k$ = # of edges crossing $(A,B)$ , these edges will be called $F$ Let $S_{i}$ be the event that an edge of $F$ is contracted in iteration $i$. For the first ...
I have the following functions: What is the correct order of these functions in increasing complexity? I could always start entering values in these functions and check the corresponding output to notice the rate of increase. But is there a better, faster way of ranking these functions in order of increasing complexi...
When describing the syntax of a given programming language the words "expression" and "term" are often used to seemingly describe the same things. Are these words interchangeable in the context of programming languages?
Why do some search trees store all elements in the leaves, while other search trees don't? One difference that makes is whether a successful search may end up in an internal node. For m-ary search trees, the former case will need more leaves and more heights than the latter. Is this the benefit of not storing all th...
I am trying to solve a bounded SSSP problem as follows: Given a connected weighted graph with non-negative edges (might have cycles), find the shortest path from a vertex s to a vertex t with at most k edges. I have done some research on this problem. All proposed solutions point to using Bellman-Ford's algorithm...
I have been doing research on the SIFT (scale invariant feature transform) algorithm, and while I have repeatedly read that in order to detect image features that do not vary with respect to scales of visual perspective, a scale space must be constructed from the source image using repeated Gaussian smoothing and takin...
Let $P$ be a push down automaton $(Q,\Sigma,\Gamma,\delta,q_s,F)$, where $Q$ is the set of states, $\Sigma$ is the input alphabet $\Gamma$ is the stack alphabet $\delta$ is the transition function with signature $Q\times(\Sigma\cup\{\epsilon\})\times(\Gamma\cup\{\epsilon\})\to\mathcal{P}(Q\times(\Gamma\cup\{\epsilon...
In the familiar book of Theory of Computation by M. Sipser, the author proved that for endmarked context-free languages, the set of languages having a LR(k) grammar for a predefined $k \in \mathbb{N}$ (denoted as LR(k) languages) is the set of deterministic context-free languages (denoted as DCFL). My question is also ...
What kind of formal semantics can describe HTML and CSS? Are there endeavours to do this. HTML/CSS layouts are espcially complex, so formalization can be of help.
How does information theory deal with truth? Does disinformation or lie have negative amount of bits of information?
Some compilers have utility functions that split critical edges in the control flow graph. I assume that this is not done as an optimization in itself, but rather to simplify other analyses and transformations. In what cases would splitting critical edges be useful?
Huffman trees are used in a specific application - Huffman coding - for finding the minimum-expected-length binary-coding for a set of strings, with respect to a probability distribution over the string set. Optimal binary search trees (as defined in CLRS's Introduction to Algorithms) are used for finding the optimal b...
There is a some question that arise from the proof of Lemma 5.8.1 of Cover's book on information theory that confuse me. First question is why he assumes that we can "Consider an optimal code $C_m$. Is he assuming that we are encoding a finite number of words so that $\sum p_i l_i$ must have a minimum value? Here I gi...
In java, you must explicitly cast in order to downcast a variable public class Fruit{} // parent class public class Apple extends Fruit{} // child class public static void main(String args[]) { // An implicit upcast Fruit parent = new Apple(); // An explicit downcast to Apple Apple child = (Apple)pa...
Let's take for example this addition: 3 + (-1). 1 in binary is 001, and to obtain it's 1's complement counterpart we flip the bits. So it is: 110. 3 in binary is 011. 011 + 110 = 1001 That first 1 which is in bold has to be added to the number formed by the last 3 bits as follows: 001 + 1 = 010 (2 in decimal). Wh...
I'm currently trying to learn how to infer most general types on lambda calculus, and due to the lack of information on the subject I could find on Google I'm forced to attempt what I think is logical and ask here if it's correct, it's most likely not, so please correct me! Here's a couple exercises I've got, the idea ...
Let $A$ and $B$ be two finite sets of the same size $n$. Let $P(A),P(B)$ be the set of all permutations of $A,B$ respectively. A distance function $d(a,b)$ is defined for any $a\in P(A),b\in P(B)$. We want to find $\min \{d(a,b):a\in P(A), b\in P(B)\}$ (note: $d$ is fixed). For example, suppose we have two sets $\{1,2\...
Let's say we have a database with a given table named food. The food table has many columns but we are interested in only 3 of them: buyorsell, which specifies if the food is for selling or buying. amount, which is the amount of food to be bought or sold. isVegan, which is set true if the food is vegan. The goal i...
Given a set of workers $w_1,...,w_m$ and and a set of tasks $t_1,...,t_n$, and a $m\times n$ matrix $P$ s.t. $P(i,j)$ is the profit of assigning worker $i$ to task $j$. One worker can only be assigned to one task, and one task can only have one worker. We want to find the maximum profit of all possible assignments. D...
I am dealing with a sample exam question that I cannot understand which is as follows: Selection sort takes one millisecond to sort 1000 items (worst-case time) on a particular computer. Estimate the amount of time it would take to sort 100,000 items. If Mergesort took 1 second for 100 items and 15 seconds for 1000 it...
A deque is a double ended queue of course. So if I can either use 2 stacks, or 2 queues, or 1 stack and 1 queue, which two would I use to have the fastest implementation? Can we derive the complexity for InsertLeft, InsertRight, and RemoveLeft, and RemoveRight? I was thinking of using 2 stacks. Call 1 stack 'left' and ...
I am supposed to be changing this to Chomsky Normal Form and then to Greibach form, but I am still having a few difficulties changing it to the first form. Here is the language: S → AA|SBBa|b A → ABa|BS|a B → BBb|a|λ I know the first step is to make a new start symbol and thats easy enough SO → S S → AA|SBBa|b A → ABa|...
This is the problem that I have been given: Consider the Independent-Set problem, in which the input is an undirected graph $G = (V,E)$ and a parameter $k$, and the goal is to determine if $G$ has an independent set of size $k$. Suppose we have an oracle $O$ for solving this decision version of independent set (think o...
I get how to solve recurrence relations for t(n)= t(n-1) etc etc. But how would you solve the recurrence of t(n) = t(n/2) + log2(n), such that T(1)=0? I don't understand how the log would behave in this situation.
For language $L = \{a^m\, b^n\: |\: m \:\%\: n = 0 \}$, that is, $m$ is a multiple of $n$, I'm trying to find a proof that it isn't a context free. I know it isn't regular, but it also doesn't seem to be context-free to me. However, I am not sure how I would go about proving that it isn't context-free. My quick attempt...
I am trying to count the exact/total number of iterations these nested for-loops are executed: procedure P (integer n); for (i: 1 to n) for (j: 1 to 10) for (k: n to n+5) x := x + 1; I know that the first for loop runs (n-1) times, the second loop runs 10-1 (9) times, thus making the time complexity so far 9...
So I have function that I have written to return the maximum value between index i and index x of a given array using recursion as follows: FindMax( A, i, j ) if (i == j): return A[i] else: k = (i + j) / 2 return max( FindMax(A, i, k), FindMax(A, k+1, j) ) What is the correct way to go abo...
Having difficulty with the following question. I can answer parts I and II but having trouble finding a practical example. Question: Compute the maximum data rate of the following communication links; I) 4000Hz bandwidth and a signal to noise ratio(SNR) of 20dB; II) noiseless channel of 2.4GHz bandwidth with 64 signal...
What is the most efficient (in terms of running time) algorithm that solves the Chinese remainder theorem (CRT) on a set of integer residues. That is, given a set of moduli $\{m_i\}_{i=1}^{r}$ and set of residues $\{x_i\}_{i=1}^{r}$ such that $X \equiv x_i~mod~m_i$, find $X \in \mathbb{Z}_M$ where $M=\prod_{i=1}^{r}m_i...
Given an undirected graph, how would one go about calculating the number of squares in the graph? That is, a square is a cycle of length 4. I know that it is possible to count the number of triangles (cycles with length 3) in polynomial time. Is it possible to calculate the number of squares in polynomial time as well...
If in a particular DFA , we are looping in a state for n symbols.... Is there any way to keep track of this 'n'?
The task is to compare two trees and determine what are the changes. Both trees are represented as an adjacency list (ID, ParentID). Base tree: A (ID: 1, ParentID: 1) B1 (ID: 2, ParentID: 1) C1 (ID: 6, ParentID: 2) D1 (ID: 13, ParentID: 6) C2 (ID: 7, ParentID: 2) D2 (ID: 14, ParentID: 7) B2 (ID: 3, ParentID...
In class our professor showed us 3 methods for proving non-regularity: Myhill–Nerode theorem Pumping Lemma for regular languages Proof of non-regularity, based on the Kolmogorov complexity Now the first two, Myhill-Nerode theorem and Pumping lemma, I understood well and I was also able to do the exercises to the firs...
I can't find the standard name for this problem, so lets call it TIMING, it takes as input a Turing machine $F$ with its input $i$, and a number of steps $n$. It returns yes if $F(i)$ halts in less than $n$ steps, otherwise it returns no. What is the time complexity of this problem in terms of $n$, is it $n\log n$ as ...
The diameter-constrained Minimum Spanning Tree (MST) problem is as follows: you have a undirected weighted graph $G = (V,E)$ of different weights where $V$ is the set of vertices and $E$ is the set of edges between vertices, and a constant $d$. The goal is to find an MST such that the diameter (i.e., the maximum distan...
I have came accross this link. I have an integer linear programming (ILP) problem $$\max_{(x_1, x_2,\ldots, x_n)}\sum_{i=1}^n x_i\cdot f(x_i),$$ $$\text{subject to } \begin{cases} ..., &(1)\\ L≤x_i≤U,&(2)\\ x_i \in \mathbb{Z}, i \in I,&(3)\\ \end{cases} $$ here $X=\{x_i \in \mathbb{Z}: L \le x_i \le U, L<0, U>0, i\in...
I am working on a project that involves recognising emotion from images. There are two parts in the project: One where I will generate features from images using API's and then classify the emotion and the other part is where I will first use a CNN on a dataset and then take some layer of features and then give it to S...
I'm preparing for an exam, and I ran across the following algorithm: for(int j = 1 to n) { k=2 while (k < n) { sum+= a[k] * b[k] k+= log(k) } } I'm trying to work on finding the complexity of the algorithm. Here's what I have so far. The outside loop obviously runs in n steps. The inside l...
Problems in FPTAS require time which is (at most) polynomial in problem size. Suppose this last requirement is relaxed. What is the corresponding approximability class and where can one read about it? To be more specific, I am interested in learning about problems that can be approximated in time that scales polynomial...
The set of regular languages $R$ over an alphabet $\Sigma$ can be defined as the smallest set satisfying these 5 axioms: Empty language: $\{\} \in R$ Singleton languages: $\forall a \in \Sigma : \{a\} \in R$ Closure under union: $\forall A, B \in R : A \cup B \in R$ Closure under concatenation: $\forall A, B \in R : A...
Given a language $A = \{a^nb^n : n >= 0\}$, how would one go about characterizing the equivalence classes of this language, in order to apply Myhill-Nerode to show it is not regular? The idea and meaning of "characterizing equivalence classes" is what I am struggling with.
I am solving a recurrence using repeated substitution method and I am almost done but it seems to me that I need some additional work to finish correctly. I am including an image of my work because typing would be very time-consuming. I will appreciate your feedback. I can see that the problem says that $n = 2^k$ so $...
I am looking over the classic Reader and Writer Problem Just to give a quick overview: Many readers can be in CS (as long as no writers are) Only one writer can be in the CS (with no combination of other readers/writers) So the solution is: binary semaphore wrt, mutex = 1; int No_of_Readers = 0; Writer Process wai...
My question is: what language should the following DFA recognise? It seems that it should contain an odd number of substrings in the form 11*0. However, I am not sure whether there are any other conditions.
I usually use the symbol $\varepsilon$ for empty string (empty word or null string). But I know some people use $\lambda$ instead of $\varepsilon$. I think $\varepsilon$ is derived from the word "Empty". However I don't know what's the origin of $\lambda$. In automata theory, there is the epsilon transition of automata...
I'm learning lambda calculus, however I'm quite confused about the quantifiers in lambda calculus. As far as I know, quantifiers such as "∃" are concepts of first order logic (FOL), which are not needed by lambda calculus. Moreover, I didn't find anything about quantifiers in any tutorials I have read. However, I find ...
Given a fully connected graph $G(V,E)$ with associated edge weights and a set of constraints specifying distance $D(V_i, V_j) < M_{ij}$, where $\left\{V_{i..j}\right\} ⊂ V$, how can I go about finding the smallest subset graph $G'(V', E')$ such that none of the constraints are violated? In other words, find the smalles...
Assume an evaluation-relation on terms $t \Downarrow v$. If I want to prove correctness of a function $\phi$ w.r.t. evaluation, I have to show that the following implication always holds: $$\frac{\phi(t) \Downarrow \phi(v)}{t \Downarrow v}$$ Naturally, this is a candidate for structural induction. But on what structure...
I have a collection of objects, and a feasibility property for sets of objects which is slow to compute. If a set is feasible then so is any subset. For example, it could be whether the set of things will fit into a certain-sized packing crate. I want to compute all feasible sets (equivalently - all maximal feasible se...
I have used Rabin Karp Rolling Hash for searching a pattern $P$ in a text $T$. Now I am allowing $k$-mismatches, but not able to do a faster implementation. I tried modifying RK algorithm by splitting the pattern into few blocks, but that does not improve the speed. I'm trying to use locality sensitive hashing, but no...
Low-level languages have for a long time dominated the field of embedded systems due to their rapidity and flexibility. As high level languages are becoming faster and faster, might the situation get reversed soon? Can high-level languages become frequent in embedded systems in a near (or not so near) future? What woul...
Given a set of data points $X = \{x_1, x_2, \ldots, x_m\}$ where $x_i \in \mathbb{R}^d$ we run K-means on $X$ and obtain the clusters $c_1, c_2, \ldots, c_k$. Now, if we create a new dataset $Y = \{y_1, y_2, \ldots, y_m\}$ where $y_i = Ax_i + b$ and $y_i \in \mathbb{R}^d$ and run K-means on $Y$ to get clusters $g_1, g_...
I am working with an algorithm to compute the transpose of a directed graph. Here is a rough overview of the algorithm: For each vertex in the graph, traverse each edge and add an edge from the neighbor to the parent node. The adding of an edge takes constant time, $O(1)$. And I figured, if I am traversing each edge, t...
Apologies if this isn't the correct forum but I thought it would be too academic for the DBA forum. In my work I'm looking to research some of the benefits of using an RDBMS product over traditional files (text, XMLs JSON what have you). I'm not planning to cover the advantages over Big Data / NoSQL but that would be a...
I follow Michael Sipser's book, "Introduction to the Theory of Computation". To be specific, I am trying to understand the proof about the union of regular languages. However, I have a problem grasping how exactly the transition function is defined. The book says that for each $(r_1, r_2) \in Q$ and each $a \in\sum$, ...
When transforming terms from one language to another, the intuitively desired property is the preservation of semantics (as used e.g. here for a CPS transformatation): $$ s \Downarrow v \implies c(s) \Downarrow c(v) $$ I am a little troubled, however, by reconciling this with the classical terms correctness (or soundne...
The "top k of n" problem: You have n (not necessarily distinct) elements in an array, and you need to return another array containing the k elements with the highest value. So, I'm going to need a top-k-of-n implementation for something I'm working on. Never mind exactly which programming language and hardware I'm goin...
I have a directed acyclic graph (DAG). How I can find the longest path using only vertices with degree at most 2? Currently, I try this def all_simple_paths(g): for path in all_paths(g): if len(path) > 2: center_path = path[1:-1] nodes_degree = g.degree(center_path).values() if ma...
I'm trying to find a dynamic solution to the nesting boxes problem. You're basically given a set of "boxes" which all have different dimensions. The goal is to find the maximum set of boxes that can be nested inside of each other. So more formally, Given set B = {b_1, b_2, . . . b_n} where each b_i contains a box with ...
I have the following recurrence relation which I already solved using repeated substitution. $T(n) = \begin{Bmatrix} 1 & if & n = 1\\ 4T(\frac{n}2) + n & if & n >= 2 \end{Bmatrix} where$ $n=2^k$ The result I get is $T(n) = 2n^2 - n$ Let´s suppose my result is correct. Now, I am asked to prove the correctness of the re...
I recently finished Operating System Concepts. As a follow-up for self-teaching, I am looking for a book on distributed systems (not theory). I've found Tanenbaum's text but it has rather poor reviews. I'm hoping for something with a similar flavor to Concepts: focusing on the general principals and concepts for buildi...
If array is sorted we can generally find median in O(1) by returning the element at the middle. But what if there are duplicates? E.g [2, 2, 3, 3, 3, 3]
LOOP:LW R1,0(R2) ADDI R1,R1,#1 SW R1,0(R2) ADDI R2,R2,#4 SUB R4,R3,R2 BNEZ R4, LOOP If we want to move an instruction into a branch delay slot what will be that instruction and the schedule of the instructions? In the solution they have brought SW R1,0(R2) into the branch delay slot...
According to the Wikipedia page on the Push-relabel maximum flow algorithm: Subcubic $O(|V||E| \log\frac{|V|^2}{|E|})$ time complexity can be achieved using dynamic trees, although in practice it is less efficient. What if $|E| = |V|^2$? Don't we then have this? $$O(|V||E| \log\frac{|V|^2}{|V|^2})$$ $$O(|V||E| \log 1...
If we had some $K_n$ subgraph where $K_n \subseteq G$, must the complete subgraph $K_n$ be an induced subgraph from $G$? In other words, can we create a situation where we remove vertices from a simple graph $G$ to obtain some complete subgraph where the subgraph was not complete when it was a part of $G$?
I am having some trouble with turning the following mathematical expressions into as balanced binary trees as possible. This is what I have done so far, but is there a way to make them even more balanced? $( − 3)(^2 + − 1)$ $4( − 1)( − 2)( − 3)$
I am in trouble how to prove that these two regular expressions are equivalent. I know what are closures and all the basics of automata. But the problem is I don't know the method or way of solving this kind of problem. Question: Prove that R.H.S regular expression is same as L.H.S $$ (a+b)^* a (a+b)^* b (a+b)^* = (a+...
The following is a motivation for penalized logistic regression in some lecture notes I'm following: Although the cost-function for logistic regression is lower bounded by 0 we get issues if the data is linearly separable. That part I can understand it well because the logistic regression cost-function is tak...
This is not a home work question. Is that correct to say in a flow network, if min cut is unique then max flow must also be unique? Assume we have two max flow in a network. Then for each max flow, we can get a min cut and they are surely different.
Is there a "intuitive" way of understanding how many possible decidable problems there are, given some formal language to describe them?
We need to find unknown 16-bit integer X. We can ask "how many '1'-bits in number X xor Y" (Y is 16-bit too). What best strategy to find X? Or what minimum number of questions? For example, if answer for Y=0 is 1, we can do binarysearch-like strategy restoring X in 4 additional operations. I have found set of 10 number...
The question goes something like this: Suppose you are living in a country where coins have values that are powers of p, V = [1, 3, 9, 27]. How do you think the dynamic programming and greedy approaches would compare? Intuitively I want to answer that DP will be faster because greedy runs the same number of comparisons...
prove/disprove If inverse homomorphism of languages is regular then languages is also regular? Let $h$ be a homomorphism , if $h^{-1}(L)$ is regular then $L$ is also regular?
what is the difference between the below functions? $$\lambda x.\lambda y.f(x, y)$$ $$\lambda y.\lambda x.f(x, y)$$ And it appears that there is a $\texttt{reverse operation}$ in lambda calculus which can reverse the order of the arguments. So does the order actually matter? I am asking this question because I am readi...
For all regular languages L, by the Myhill-Nerode classes, all state-minimal DFAs for L are isomorphic. ​ On the other hand, "a regular language may have many non-isomorphic state-minimal nfas". ​ What about Unambiguous Finite Automata? ​ Every DFA is also a UFA, so every regular language has at least one UFA. ​ The na...
I have a bipartite graph $G = (V, E)$ where $V = S \cup T$ is the division into the two halves. I want to select $n$ elements from $S$ and $nk$ elements from $T$ such that the graph they generate has $n$ connected components, each of size $k+1$ and containing one element of $S$. To be clear, $n$ and $k$ are inputs to t...
I'm working on an I/O generator program for a distributed file system. The problem I need to solve can be worded as a set of requirements: Reproducible (i.e. given some initial condition, the algorithm must produce the exact same file system). Concurrent (or at least concurrency-friendly). Since file system itself is ...
Input: number of edges and vertices, and array of all edges in graph. Output: array of edges that construct a matching, so that: $$\frac{\text{the number of edges in this matching}}{\text{the number of edges in maximum matching}} \geq \frac{1}{2}$$ Algorithm I implemented Loop: take a random edge (actually in order ...
Suppose we have two heuristic functions $h_1$ and $h_2$ which are both consistent, that is, $$h_i(n) \leq c(n,a,n') + h_i(n')\qquad \ i\in\{1,2\}\,,$$ where $c(n,a,n')$ denotes cost of reaching the successor node $n'$ with action $a$. Can we conclude that the $h_3:=\max(h_1,h_2)$ is also consistent?
Say we have N persons and M items (when a person has a certain item, she usually only has one piece). For example, person 1 has item A, C, D, and wants item F person 2 has item B, C, and wants E person 3 has item E, and wants G ... You get the idea. So it's basically a supply/demand matching problem, and if we rep...
I learned about amortized analysis and the potential method, I also leaned an example of a binary counter which I think I understand well. In the case of the binary counter I understand the choice of the potential function - we are paying in advance for a transition from one to zero that must be made in the future when...
I was reading something about Eulerian Tour and there is one property claiming that: An undirected graph can be decomposed into edge-disjoint cycles if and only if all of its vertices have even degree. Can someone explain what is edge-disjoint cycles? Wikipedia: Eulerian path
I am having trouble understanding the terminology with perceptron learning. Is my current understanding correct? Let's say I have some data that classifies what type of flower a particular flower is. And let's say the factors taken into consideration are petal size, petal coloring, and leaf size. So my current understa...
I'm trying to understand the time complexity of the following code in terms of n. Pseudocode for trial division: I understand that the time complexity of the algorithm is O(sqrt(N)). However, can someone explain how the person in the link below came up with O(e^(n/2)). In other words, what's the mathematical relations...
$A = \{w \in \{a, b\}^* | $ 10th character from the end of $w$ is $b\}$ Prove if DFA $M$ has $L(M) = A$ then $M$ has at least 1024 states. So there's only 2 characters possible at any state, aside from the 10th character, which has to be $b$. Any character after that can be a or b, since we know the 10th character fr...
Let me introduce you to my current project (that obviously yields the problem I face hence I post here). I am writing a so-called "compiler" for a simplistic language. I have already built a VM to run the produced bytecode, the associated Lexer (all this project is an optional assignment). My problem lies...
i read that First-Order Logic is strong enough to formalise all of Set Theory and thereby virtually all of Mathematics. How would you express in First-Order Logic the theorem: 3SAT is NP-complete?
Given a format: say 12-bit floating point with sign bit, 5 - bit biased exponent and 6- bit significant with implied bit, how do i go about determining the range of values which can be represented. I have tried various times and each time i got a different answer. I'm afraid i'm not quite sure how to approach this prob...