instruction
stringlengths
35
29.1k
I'm studying formal languages and automata, and on the section of learning how to find productions that generates the grammar, I've done some exercises pretty well and was able to do some of the exercises on the format: $L(G_1) = \{wcw^r / w\, is\, on\, \{0,1\}^*\}$ Where $w^r$ is the reverse word, and whose production...
I am trying to understand the lifetime of a procedure, from source code through to being compiled to machine code and being called. I am specifically interested in the context of "live" environments, where (re)compilation can happen at any point during runtime and the new code is seamlessly integrated into an already r...
It is surprising to me that I cannot find a precise definition of universal learner on the internet. I can guess what it should bebut I don't want to make a mistake, therefore I have come here. Here's how I think it should be: A learning algorithm is said to be a universal learner if there exists a function $m:(0,1)^2 ...
I created an algorithm that is doing $\sum_{i=1}^k {n\choose i}$ inference calls to an ML model. Let's assume the inference calls are constant. Can I upper bound this without the binomial coefficient somehow? I would say its $\mathcal{O}\left(k {n\choose i}\right)$ but that's not a very intuitive expression. Is this ex...
So basically we have 2 types of quantifier in first order logic, they are universal quantifier and existential quantifier. Usually we use implies connector(->) when we have universal quantifier in front of our formula and use conjunction connector(∧) when we have existential quantifier in front of our formula. If we h...
Apologies if this is a trivial question - but I can't seem to find a direct answer to this. Say program A manipulates some data, and program B does the same manipulation, except it operates on a deep copy of the data (so now there are two identical versions of the data in memory during execution). Since B essentially u...
When it is said that machine code is specific to a machine, is it specific to an architecture, or is it specific to a machine? Do two identical processors require different machine code? My guess is that people are referencing instruction sets/architecture when they say machine code is specific to a machine? If they a...
I'm looking for a good algorithm for "simple radius-search-based averaging" (or "radius search based sub-sampling") as referred to section 3.4 of the DynamicFusion article. Relevant excerpt from the paper (to save you some reading time): The set of all unsupported vertices is then spatially sub-sampled using a simple ...
Consider the immanent of $n \times n$ complex matrices \begin{equation} \operatorname{Imm}_f(A) = \sum_{\sigma \in S_n} f_n(\sigma) A_{1 \sigma(1)} \cdots A_{n \sigma(n)}. \end{equation} Here $f_n:\pi \to \mathbb{C}.$ I want to investigate the computational complexity of such function by given family of $f_n$. Special ...
Let $K$ be a convex compact set in $\mathbb{R}^d$. Suppose that a Membership Oracle $\mathcal{M}_{K}$ for the set $K$ is available; given a point $x\in \mathbb{R}^d$, the Oracle returns 0 if $x$ is in $K$, and 1 otherwise. Now consider the set $W= K+\epsilon B =\{x+\epsilon y: x\in K, y \in B\}$, where $B$ is the unit ...
Given a graph $(V,E)$, I'm interested in embedding it into a Euclidean space $\mathbb{R}^n$ such that each vertex $v\in V$ becomes a point $x_v\in\mathbb{R}^n$ and $d(x_v,x_u) \leq 1$ (Euclidean distance) iff $(v,u) \in E$. Is this embedding always possible given high enough dimension $n$? If so, given a graph, can we ...
Given a graph $(V,E)$, I'm interested in embedding it into a Euclidean space $\mathbb{R}^n$ such that each vertex $v\in V$ becomes a point $x_v\in\mathbb{R}^n$ and $d(x_v,x_u) \leq 1$ (Euclidean distance) iff $(v,u) \in E$. I know that Maxcut isn't NP-hard for planar graphs. But what if I consider graphs that can be em...
I saw this question and asked myself why the original problem is not solvable through diagonalization. Let $$L = \bigl\{\langle M \rangle \mid L(M) = \{\langle M\rangle\}\bigr\}$$ Take the complement $\overline{L}$. Suppose there is a Turing Machine $M$ which decides this language. We get the following two cases: $\la...
I found this paper: https://courses.engr.illinois.edu/cs373/fa2009/recaut.pdf But it looks like recursion is done along an edge. I would have thought you have state machines nested inside nodes. Then there is an single, innermost (one of many) state machine that is running at any given moment. However, I think that ...
so when doing digital design, lets say building a calculator we only take the 2s complement of a negative number. 13+(-12)=1 001101 + 110100 = (1)000001 the 1 in parenthesis is overflow that "falls off" what is the design so that negative numbers are converted into a 2s complement?
I have a very basic question. $\mathsf{P}$ is the class of decision problems solvable in polynomial time by a Turing machine. $\oplus \mathsf{P}$ is the class of decision problems solvable by an NP machine such that If the answer is 'yes,' then the number of accepting paths is odd. If the answer is 'no,' then the numb...
The problem is the following: You are given a collection( set, list, whatever ) C of sets, and you are given a search set S. We want to find among all sets in C the ones which are subsets of S. Hence, the statement would be: What is the best way to return all sets from C which are a subset of search set S?
I have a noiseless T-user multiple access channel. Let $[Q] = \{1, \dots , Q \}$. The users send symbols $X_i ∈[Q], i = 1, \dots , T$ . The channel is defined as follows $$(X_1, X_2, \dots , X_T) → Y$$ $Y=\cup_{i=1}^T X_i$, $X_i$ are i.i.d uniform For example: $(1, 2, 3) → \{1, 2, 3\}$, $(1, 1, 2) →\{1, 2\}$ How to fin...
Given an (undirected) graph $G = (V,E)$ with $|V| = 2n$, what is the complexity of the problem of finding the subgraph $G' = (V',E')$ with $V' \subset V, |V'| = n$, such that the number of edges $|E'| = |\{(v,u) \in E\ |\ v,u \in V'\}|$ is maximized? I feel like this is similar to Max-Bisection problem but focuses on t...
The Y combinator is defined as $$Y=\lambda f.(\lambda x. f (x x))(\lambda x. f (x x))$$ It has the following useful property: $$Y g = g (Y g)$$ for some expression $g$. It can be easily used to implement a recursive function, e.g. factorial: Y = lambda f : (lambda x : f(lambda v : x(x)(v)))(lambda x : f(lambda v : x(x)...
I am trying to solve a problem set to practice for an exam. How can I approach questions like these ? Is there a way to verify solutions or is it just trial and error ?
Say that two complexity classes are equal, i.e. TIME(n) = TIME(nlogn). Does this imply that for some proper complexity function f(n) >= n we can show TIME(f(n)) = TIME(f(n)(logf(n)))? If so, how can we strongly argue that they are equal and one is not just strictly contained in the other?
Problem: find sum of k element in array and it is biggest? time complexity of my algorithm is O(k*n).Is it linear complexity?
Let $P$ and $Q$ be two disjoint point sets in the plane. (Think of them as a red point set and a black point set.) Let $p \in P$ and $q \in Q$ be two points from these sets that minimize the Euclidean distance $|pq|$. Prove that $pq$ is an edge of $\text{DT}(P\cup Q)$. I know this property of DT, the closest neighbor ...
So essentially as the title says, I just want to understand how its done. I have a light idea from my own research, but its failing at one point, and I feel it maybe due to crucial point missing in my understanding. My understanding is to form a multiplication circuit of 2 n-bit variables, so for ex. X0 x1 .. xn and al...
Problem Background: Let $a\in(0,1)$ to be an irrational number. Suppose there is a black box, the input is a real number in $[0,1]\backslash \{a\}$, denoted as $x$, the black box outputs boolean values according to the following rules: When $x>a$, the output is True. When $x<a$, the output is False. Given $k$, we nee...
i tried to see from my course book at university but i didn't understand much, can someone help me? even looking around on the internet I did not find anything useful
I was reading section 3.2 of Advanced Data Structures by Peter Brass (which is about weight-balanced search trees) for self-study. I got stuck on a proof about rebalancing properties. $\alpha$ and $\epsilon$ are parameters, where $$\epsilon \le \alpha^2 - 2\alpha + \frac{1}{2}$$ The weight of a node is recursively defi...
Here is the source for the problem below: https://leetcode.com/problems/least-operators-to-express-number/discuss/1675169/java-or-recursion-or-greedy-or-math For completeness, below is the problem statement and the code. Following the code are the questions I have that would help me understand the solution better. Prob...
Given a bounded, convex polytope $C \subset R^d$, I have $n$ partitions of the polytope $C$ into at most $m$ smaller polytopes (disjoint on all but sets of measure zero). These smaller polytopes have colors assigned to them. Given a color, I would like to find a point $p \in C$ such that $p$ is that color in the maximu...
There are some threads that discuss it but I haven't came across an inductive one yet. All of them involve creating a finite automaton which I would like to avoid (as per my professors requests).
I keep seeing the term "energy" used in computer vision literature, specifically when speaking about Image Segmentation. For example on this page on Graph-Cut. I'm just wondering if someone could give me a layman's explanation of what "energies" are. I'm pretty new to the subject, and I'm not finding anything online ex...
I am trying to reverse engineer the following image. So far, the way I would take into account of duplicate letter handling is the following . I am unsure how I could code this such that the duplicates are not colored incorrectly. For example, in my code output in the first row, the first "N" should not be yellow, but ...
I want to calculate the runtime of the following code as a function of n: sum = 0 i = 1 while (i < n) j = 1 while ( j < i) k = 1 while ( k < ^2) sum = sum + 1 k = k+ i*i j = j + 1 i = i + 1 If understand correctly then i will run from 1 to n and j from 1 to i in each iterati...
This is my problem: The chess match starts with a board where chess pieces are randomly placed. Both players are controlled by the same deterministic algorithm so if two games start with the same positions both games will end with the same result. I need an algorithm capable of efficiently calculating which player wi...
I tried to solve the following recurrence: $\ T(n) = T(n-5) + \log(n) $ and $\ T(5) = 1 $ using iterative substitution: $$\ T(n) = T(n-5) + \log(n) = \\T(n-10) + \log(n) + \log(n-5) = \\ T(n-15) + \log(n) + \log(n-5) + \log(n-10) $$ and so eventually I get for $\ i$ iterations: $$\ T(n) = T(n-5i) + \sum_{k=0}^{\frac{n}...
To my understanding, the time-complexity of an algorithm is a measure of its actual run time. For instance, an algorithm with a worst-case time-complexity $T(N)=$(constant)$\times N^2+$(lower order terms) has time-complexity $O(N^2)$ and, thus, has a run-time that increases at most quadratically with the size of its in...
So I've been mechanizing some simple linear lambda calculus stuff. The basic framework is $$ \frac{}{x \colon t \vdash x\colon t} $$ $$ \frac{\Gamma \vdash e \colon t \rightarrow t' \quad \Delta \vdash e' \colon t}{\Gamma, \Delta \vdash e \, e': t'} $$ $$ \frac{\Gamma, x \colon t \vdash e \colon t' }{\Gamma \vdash \lam...
Upon googling all I get is the definition of finite-state automaton but what's the difference between it and finite-state automata or are they the same
I've got 14GB of compressed data for a class assignment. I need to run a unit test on modules I've created to make use of the uncompressed data, which will be an object of nested dictionaries with the innermost dictionary having lists for its values. Both my ideas and where I'm getting stuck: My first idea was to have...
For an arbitrary spay tree with n nodes, if we perform n find operations, is there a way of generalizing what the tree would look like after n operations and proving it mathematically? One such example (Sequential Access Theorem): if the splay tree has the elements V1, V2,..., Vn, where V1 ≤ V2 ≤ ... ≤ Vn. And the find...
Edit 3/14 to refer to textbook question: I am trying to understand the concept of external regret better, and am working through the Nisan et al. (eds.) Algorithmic Game Theory book (https://www.cs.cmu.edu/~sandholm/cs15-892F13/algorithmic-game-theory.pdf). I am looking for insights on the second part of Problem 4.8 on...
Consider the following variant of linear programming, where we want to maximize the number of linear inequalities that are satisfied: Input: linear inequalities $A_1x\le b_1$, ..., $A_nx \le b_n$; an integer $k$ Output: does there exist $x \in \mathbb{R}^d$ that satisfies at least $k$ of these linear inequalities? To m...
I have a question that asks me "What is the expected number of observations in a state?" with the note: $$\sum^{\infty}_{d=1}d a^{d=1} = \frac{1}{(a-1)^2}\text{ when } |a| < 1$$ Prior to that I have a Markov Model with 3 states and the transition probabilities as follows: S1: $P(S1) = 0.4$, $P(S2|S1) = 0.3$, $P(S3|S1)...
Are there locality sensitive hashes that work nicely with sets? Each set would get a hash, the order of the elements in the set does not change the hash, and sets that share more elements are closer together. Specifically, I am working with sets that each have approximately 10 elements, and there are a total of 1000000...
I can't understand why the Java HashMap load factor is 0.75. If I understand well, the formula for the load factor is n/m, where n is the number of key and m is the number of position in the hash table. Since HashMap utilize bucket (i.e., a linked list) to store the value it is possible to have a load factor > 1 withou...
Let $n \in \mathbb{N}$ and $G := \{1,2,...,n\}$. Now let $P_2(G)$ be a power set of $G$ but only with sets of cardinality $2$, e.g. if $n = 3$ then $P_2(G) = \{ \{1, 2\}, \{1, 3\}, \{2, 3\} \}$. Now I'd like to order these sets in a list so adjacent sets are disjoint. This only works for $n > 4$. Furthermore given a pa...
My question comes from solving this LeetCode question, in which we are given a string of characters with size N, and one of the solutions is to use a hashmap (dictionary in Python) to count the characters, with the character being the key, and the count being the value. For instance, "abbcddd" results in a hashmap {'a'...
I found this task in an old exam and couldn't get my head around it: We define the class of languages $\mathsf{QP}$ as follows: $$\mathsf{QP} = \bigcup_{k \in \mathbb N} \mathsf{DTIME}(2^{\log(n)^k})$$ Show that there is no $L \in \mathsf{QP}$ such that $K \leq_p L$ for all $K \in \mathsf{QP}$ Some details on notatio...
Are there any decision problems that have deterministic polynomial time algorithms and proven non-linear lower bounds?
Consider the $(\ge k)\mathit{-SAT}$ problem, where you are given a CNF (conjunctive normal form) formula $F$ such that each clause has at least $k$ literals, and the goal is to determine whether $F$ is satisfiable. A literal can occur at most once in a clause. Prove that the $(\ge n)\mathit{-SAT}$ problem is in $\math...
Let $G = (V, E)$ be a weighted, undirected graph, with $f: E \to \mathbb{R}$ its weight function. Given a path $P = (e_1, \dots, e_k)$, we call $\operatorname{bwd}(P) = \min_{1 \le i \le k} f(e_i)$ the "path-bandwidth" of $P$. Let $\mathcal{P}_G(v, w)$ be the set of paths between two vertices $v, w \in V(G)$. Given two...
Despite the huge number of theoretical articles about k-WL, I can't find any implementation online beside some provably failed attempts: https://trac.sagemath.org/ticket/25802 Is my Google-Fu very bad or is there just no available implementation?
Question: Is language $L \in \mathbf{P}$ also $\mathbf{P}$-complete with respect to polynomial-time reduction? My thoughts: Given a language $L \in \mathbf{P}$, we want to show that for any other language $L' \in \mathbf{P}: L' \leq_p L$. To do this, given any input $w' \in \Sigma^*$, we can check in polynomial time if...
lemma ejercicio_36o: "(p ∨ q) ∧ (p ∨ r) ⟹ p ∨ (q ∧ r)" apply (frule conjunct1) apply (frule conjunct2) apply (erule disjE) apply (erule disjI1) apply (erule disjE) apply (erule disjI1) apply (rule disjI2) apply (erule conjI) apply assumption done I mana...
I have a program which finds the touching pairs of a given value in a binary image. For example, consider the below image: [ [1, 0, 0, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 0, 1], [1, 1, 0, 0, 0] ] When the algorithm is run with a value of 0, it finds the following pairs: [(1, 2), (22, 23), (23,...
In Sec 2.1 of Principles of Model Checking, by Christel Baier and Joost-Pieter Katoen, the authors talk about what constitutes a deterministic transition system (T.S.), and mention two kinds - action-deterministic and state-deterministic. Regarding the latter, they say that a T.S. is state-deterministic if "for any sta...
I've been looking online and through a couple youtube videos but I cannot understand how exactly conditional entropy is being applied here. From what I'm understanding is that p(Y=1 | X=1) is 0 because of (1,1) on this table being 0 at that point, but then p(y=2 | X=1) = 1, which is where I'm getting lost because I th...
I play around with Monte Carlo tree search and tic-tac-toe. For now I have followed the Wikipedia article. There is one place, where I am stuck, the selection phase. The given procedure is the following: Selection: Start from the root and choose child nodes based on their number of $w$, number of playouts $n$ and the ...
I tried to solve by explicitly writing strings of length $2$, $3$ and $4$ (other than $1011$ and $1101$), but it creates a lengthy regular expression. Can someone suggests underlying pattern that helps in writing concise regular expression ?
Let's say I want to make a Stack class in JavaScript. The class will have a push() and a pop() method. I have two options for the underlying data structure I can use: Linked Lists or Arrays. Using a Linked List I will have O(1) average and worst time complexities. Using an Array I will have O(1) average and O(n) worst ...
Definition: A formal logic system is decidable – if there is an algorithm that can determine if any given sentence is a theorem (or not). Based on this definition, I am not sure how to move to prove that, "any first-order logics with equality and a relation/functional symbol of arity more than 1." Example also can help...
Suppose we have a tree data structure with root $r$ with two operations: Add($x, y$) - adds the node $y$ as a child to the node $x$ Zip($x$)- this makes the node $x$ and all of $x$'s ancenstors direct children of the root. So if we had a tree like $r \rightarrow 1 \rightarrow 2 \rightarrow 3 \rightarrow 4$ then Zip($3$...
In the Balanced Partition problem, there are $2m$ nonnegative integers with sum $2s$. The goal is to decide whether they can be partitioned into two subsets of $m$ integers and sum $s$. The problem is obviously in NP. I am trying to prove that it is NP-complete. So far, I have found the following reduction from the sta...
Intersection of any finite regular language with anything( CFL or not CFL) will be finite but what about intersection of infinite regular language with CFL or not CFL. Does the resultant will be finite or not ?
I've come across this problem that uses hashing to compute dot products (for non-negative vectors). Suppose we are in $d$-dimensional space and $M$ will be our target for our hash. That is we have a universal hash family $\mathcal{H}$ from which a hash function $h : [d] \rightarrow [M]$ is chosen. Then given a vector $...
I am trying to find a proof of A ∩ B where A is a CSL and B is a CFL. Also I know that CFL is a strict subset of CSL. Does that mean that their intersection will give CFL. I am stuck
I was confused how to label this for (int interval = n/2; interval > 0; interval /= 2) with counting operation and estimating this operation so that I can get that exact Running time of this shell short algorithm for (int interval = n/2; interval > 0; interval /= 2) { for (int i = interval; i < n; i +=...
Is there a formulae for this summation? I wonder this could be not a constant or to say that i * i? $\sum\limits_{k=i}^\mathbb{N}{i}$
Notes I apologize if the question is not formed well, I tried my best. "Only" means anything else is discarded. A stupid man’s report of what a clever man says can never be accurate, because he unconsciously translates what he hears into something he can understand. (You are the clever man here, so please try to be si...
I was curious if someone knew the answer/reference for the following. So it is well-known that if $S\in \{0,1\}^n$, then $$ \frac{1}{2^n}\sum_{x\in \{0,1\}^n} (-1)^{\langle S, x\rangle}=1 $$ if and only if $S=0^n$ and is $0$ otherwise. Suppose I replace the exponent from a degree-1 term to a degree-2 or degree-k term, ...
Let us look at the two questions that are NP-complete for a classical computer: Given an arbitrary Boolean expression, find an assignment of variables that evaluates the expression to $0$ (SAT). Given an arbitrary Boolean expression, count the number of assignments that evaluates the expression to $0$ (#SAT). We know...
I came across this context-free grammar for the language L = {xy||x|=|y|, x≠y}, but I can't seem to see how it can generate all lengths for x and y. Could someone illustrate this? For example, how would you derive the string "abba" or "aaabbaaa"?
I have two lists l1 and l2 of possibly unequal sizes (say, m and n). I wrote an algorithm to find out all ways l1 and l2 can be merged while preserving their order. l1 = ["NYC", "LA"] l2 = ["A", "B"] output: [['NYC', 'LA', 'A', 'B'], ['NYC', 'A', 'LA', 'B'], ['NYC', 'A', 'B', 'LA'], ['A', 'NYC', 'LA', 'B'], ['A', ...
On the Wikipedia page for AVL trees, the time/space complexity for common operations is stated both for average case (in Big Theta) and worst case (in Big O) scenarios. I understand both Big O and Big Theta in general but am having trouble understanding why they are used in such a way here. A source is linked but it do...
The half-sample mode is a mode estimator that homes in on the highest density region of a set of samples in search of the mode. It is one of the better mode estimators, though it fails for J-shaped and U-shaped distributions. I coded an algorithm for the half-sample mode that may be O(N^2 log N) or possibly O(N log N l...
Below is a question on synchronization mechanism which was asked in an interview in Indian Statistical Institute, M.Tech CS. I got hold of it from here. There is a forest where there are tigers and elephants. There are two processes named tiger and elephant. Design a concurrency processing using semaphore, such that t...
I have a dataset with 9912 images, what is the best way to train them based on the pixels and features of the images to be able to predict a continuous target ranging from 1 to 100? The goal is to predict the “Pawpularity” of pet photos. The Pawpularity Score is derived from each pet profile's page view statistics. In ...
Assume we have n items with each having a different length and m wrappers each has a different length. The cost of every wrapper is proportional to its length. An item can be covered with one or more wrappers but the wrappers can not be divided. What is the algorithm to wrap the item in the cheapest possible way (least...
"Fundamental of Database Systems", 3rd ed. by Elmasri and Navathe, page 136 says: "We can physically order the records of a file on disk based on the values of one of their fields [...]" How could this "physical ordering" possibly enforced, especially with regard to fragmentation? Most databases use system calls to sto...
I have a small personal CAS project around linear algebra which involves, among other things, manipulating tensors. When I talk about tensors, I mean them according to the physical / mathematical definition, so this is of little importance for the rest of the question, but I would like to make it clear that what I want...
this is my first post here so bare with me :). What i'm looking for is an algorithm that can find the maximum sum of values in a square grid under the restriction, that you can only pick 1 value from each column and row. so for example: $$ \begin{matrix} 3 & 2 & 5 \\ 4 & 1 & 4 \\ 3 & 1 & 2 \\ \end{matrix} $$ in the fir...
I think it's a regular language but I can't find a DFA or a regular expression. Would anyone know how to help me?
When doing complexity analysis, they never account for the costs of memory allocation/deallocation on the heap. In particular, this is the case for the announced complexities of the operations on containers. But allocation/deallocation does not come for free and unfortunately is implementation-dependent. Furthermore, o...
From the text A language $L$ is in the class $NP$ iff there exists a polynomial-time Turing machine, denoted $V$, that gets an input string $x$ as well as a read-only string called the witness $w$, such that for any input string $x$, if $x \in L$, then there exits a witness string $w$ such that $V^{w}(x)$ = "yes". i...
Given a undirected graph $G=(V,E)$ with $|V|=n$ and $|E|=2022n$ and some weight function $w\colon E\to \mathbb{R}$, and $0≤ w(e) ≤n$ for all $e∈E$, Describe an algorithm that determines if the MST of $G$ only uses edges with an integer weight. i got this question in exam 2 weeks ago and my solution didn't get any po...
When determining the capacity of a discrete channel, we maximise mutual information, and in doing so find the optimal input distribution for that channel. I know that the noisy-channel coding theorem does not give us a practical scheme to design a code that achieves a communication rate equal to the capacity of the cha...
How do you simulate an ordinary turing machine using a right reset turing machine ? (A right reset machine is in which you can move left and reset to right end position. Moreover the tape is unbounded on left but it is bounded on right)
I want to implement regexp search via translation to deterministic automata, as a toy project. TLDR: how to combine the extended regular expressions with the weighted regular expressions, with the goal of translation to weighted deterministic automata? How to calculate a derivative of a weighted regexp complement? Whil...
My purpose is to write a academic paper related to shared computing more abstractly and I need to refer to these variables in both equation and its corresponding pseudocode. In my pseudocode I have nested structs, where it makes it harder to represent them in simplified equations. Assume I have following nested struct...
I've faced this question in my homework, I tried to solve it but I couldn't. We're given a DFA: Every time I tried to define the language, I found a word that the DFA accepts but the language I defined doesn't. I'll be thankful if anyone can at least tell the language the DFA defines without giving any explanation o...
I have gone through the questions related to store-and-forward and transmission delays but they didn't answer my question. My question is directly related to one of the excerpts in the book (Computer Networking: A Top-Down Approach). Book says: Store-and-forward transmission means that the switch must receive the enti...
I am studying logic gates and I encountered this problem: A set of three sensors in a factory detects whether the pollution level it is outputting from an incinerator exceeds the safety limit. In which case the incinerator is shut down. An alarm A goes off if at least two the three sensors s1, s2 and s3 detect a pollut...
First some context: A Boolean Network of $n$ components is a function $f$ from the set $\{0,1\}^n$ (set of vectors of $n$ components whose values are 0 or 1) to itself. The dynamical behavior of a Boolean Network $f$ is given by the iteration of the function itself, i.e. for all $x(t)\in \{0,1\}^n$, $x(t+1) = f(x(t))...
Is there any finite automata ((N/D)FA, NPDA, DPDA, or any variation of a Turring Machine) that can accept the following language: $\{s \text { is a string over } \{a,b\} \text { such that the number of $a$'s is a perfect square}\}$ Why or why not? I know it shouldn't belong to a DFA because there are no possible cycle...
Suppose that I have a stream of data packets in the form of unsigned 64 bit integers. And I want to make sure that I am not processing the same packet content more than once. A way of doing this would be using a hash map or dictionary, with the packets content as the key. And before processing a packet, I would need to...
Suppose given $2n$ points in the plane and we want to partition points into two clusters $C_1$ , $C_2$ such that each cluster contains exactly $n$ points and we want to minimize the sum of the diameters of two clusters. The diameter of a cluster is the maximum distance between any two points in that cluster. I have a g...
I asked a question at this link, where I suggested a greedy algorithm for this problem: Suppose given $2n$ points in the plane and we want partition points into two clusters $C_1$ , $C_2$ such that each cluster contains exactly $n$ points and we want to minimize the sum of diameter of two clusters. The diameter of a c...
I am wondering about the claim from the book "Probability and computing" that the number of products required to multiply monomial coefficients is $\Theta(d^2)$, where $d$ is the number of monomials that forms the polynomial $$P(x) = (x-a_1)(x-a_2)\cdots(x-a_d).$$ I think this answer is wrong and it takes $\Theta(2^d)...
For example, is $(X \vee 1)$ a valid formula in conjunctive normal form (CNF)? If yes, then I would have to consider such formulas when trying to prove a statement about all CNF formulas.