instruction
stringlengths
35
29.1k
I was reading about online algorithms and bipartite matching. I found an implementation that works fine on several websites (like geeksforgeeks). For the online version, I found this paper https://people.eecs.berkeley.edu/~vazirani/pubs/online.pdf But there's one part that I don't understand. In this paper, they refer ...
What is the solution of the following recurrence? $$ T(n) = 3T(n/2) + n^2, \quad T(1) = 0. $$ I cannot use the master theorem since I need to know the exact final expression, not just it's big O, which I know is $O(n^2)$. I'm stuck at the following, after 4 steps: $$3^4T(n/2^4)+((3^6)n^2)/((2^6)2^6)+(3^3n^2)/((2^2)2^4)...
There is a similar question already asked on this site but does not have an answer as to how the 10x was converted into 2y. I know how to convert 8.75 or 875 into IEEE representation. But what about 106? Surely there's a better way than expanding it and then converting it into binary.
I'm kinda confused by Asymptotics, the exercises in the book I'm reading say to prove for example $f(n) = \Omega(g(n))$, and there is something I don't understand about these kind of proofs. Do I have to prove them algebraically or is it possible to find some constant ($c$) such that this statement holds? For example w...
Is there a data structure which can maintain a list of intervals and the following operations? insert(l, r): Inserts an interval [l, r] into the list query(l, r): Return the number of intervals in the list which are completely nested in [l, r] I need the data structure to handle inserting and querying without brute fo...
For network packets coming over TCP/IP protocol, have you ever confronted a situation where you need to store those network packets in tabular form similar to how tabular tables in databases? For example, keep the dst IP, dst src, TCP/UDP, payload, etc.? If you ever find yourself in a situation where you need to store ...
Let $\Sigma = \{a, b\}$ and $L = \{aa, bb\}$. Use set notation to describe $\overline L$. This is exercise 6 (page 28) from "An Introduction to Formal Languages and Automata" by Peter Linz. The author provides the following answer: $\overline L = \{\lambda, a, b, ab, ba\} \cup \{ w \in \{a, b\}^+ : |w|\geq 3\}$. Mine...
Let $L$ be any language on a nonempty alphabet. Show that $L$ and $\overline L$ cannot be both finite. This is exercise 7 (page 28) from "An Introduction to Formal Languages and Automata" by Peter Linz. My attempt: $L$ is a subset of $\Sigma^*$, so it can be either finite or infinite. If $L$ is finite, then $\overlin...
Quick question on the wording of the question from CLRS Ch2 Problems. The question goes as follows: Although merge sort runs in $\Theta(n\lg n)$ worst-case time and insertion sort runs in $\Theta(n^2)$ worst-case time, the constant factors in insertion sort can make it faster in practice for small problem sizes on man...
Prove that $(L^R)^* = (L^*)^R$ for all languages $L$. My attempt: Suppose $w \in (L^R)^*$. So, $w = w_1\dots w_l$, for some $w_1, \dots , w_l \in L^R$. Since $w^R \in L$, then $w^R = w_l\dots w_1$, for some $w_l, \dots , w_1 \in L^*$. Therefore, $(L^R)^* \subseteq (L^*)^R$. Honestly, I don't know how to proceed onwar...
how to write a program that display the total running time of a given algorithm based on different situations such as processor speed, input size, processor load, and software environment?
If it is known that for some optimization problem there is a greedy algorithm that solves it and the solution includes sorting of input at the preliminary stage, is it necessarily true that the problem belongs to P? I was told it is true that problems of this type must belong to P, but I have questions about whether th...
I was told that exponential time always beats polynomial time but doesn't this not work for: $n^{\frac{1}{2}}$ vs $2^{\sqrt{log \,n}}$? If we take $log_2$ on both of them we get: $\frac{1}{2}log \,n > \sqrt{log \,n}$ which seems that what I was told is incorrect. Did I not hear the caveats? Have I mislabelled exponent...
I have a hard time seeing what the alternative approach is in linearizing a directed acyclic graph (DAG). Chapter 3 of Algorithms by Dasgupta et al. states: Property Every dag has at least one source and at least one sink. The guaranteed existence of a source suggests an alternative approach to linearization: Find a ...
Is there any literature / results to which fragment of the modal mu-calculus the logic CTL corresponds? I know that in order to tranlsate the until operators of CTL, it suffices to use a single mu-operator. Does this imply that CTL coincides with the fragment of the mu-calculus containing those formulas that are built ...
I would like to define a grammar that produces and recognizes the counting numbers of the English language. I created the production rules below based on the assumption this is context-free, but I am not entirely sure thats the case. Is this a context-free or context-sensitive grammar? If context-free, do my product...
I am not quite sure, whether automata can construct languages over their types. For example, a Push down automaton can construct a language of type 2 - does that mean that a PDA also can construct a language of type 3? The same for turing machine?
Hey guys I am having trouble generating strings from this language, I haven't seen a grammar that looks like this and can't figure how to generate strings from this grammar, is this Context Sensitive grammar? Thank you. $G=(\{S, L_x,R_x,W_x \},\{a,b\},P,S) \\ P = \{ \\S \to \lambda \mid L_x R_x, \\ L_x \to x \mid L_x...
I was reading about paging in OS , and one of the things I saw was the page table base register (PTBR). If the CPU generates a logical address (Consists of Page number + Offset) it needs to be mapped to Physical address (Consists of Frame number + Offset). In the mapping process there must be first a lookup in the Page...
The is an improvement to the X3SAT solver I described in What is wrong with this simple proof of P=NP? I have fixed the flaw found in that solver. Now, I want to know how often the solver described below will backtrack because of a particular learned clause. Exactly 1 in 3 SAT ($X3SAT$) is a variation of the Boolean Sa...
Let us start with the following well-known definition: Definition 1. Let $C\subseteq A^n$ be a code over $A$ and let $t\in \Bbb Z^+$ be a positive integer. We say that the code $C$ is $\boldsymbol t$-error correcting if nearest neighbour decoding is able to correct at most $t$ errors, assuming that if a tie occurs in...
I'm trying to prove that a context sensitive language ⊊ Turing-acceptable language. I was thinking of working out the complement of the language $A$, where $A$ consists of all words $w$ such that $M_w$ is a 1-NTM that accepts the input $w$ without leaving the input area. Unfortunately, I can’t figure out how to really ...
I have a pipelined stream processing situation, where a number of streams is linked in the computational process S0 -> S1 -> S2 -> .... You can understand "stream" as a list of numbers. In this process, S0 is initially given in totality. S1 is a mapped result from S0 according to function f; S2 is the result from S1 by...
How can it be proven that a deterministic CSL = semi-deterministic CSL? Does that imply that a CSL = semi CSL? Would I need to build a Turing machine, since a language accepted by a Turing machine is considered semi CSL?
Text message constantly keeps adding more emoji so I know the protocol could be extended with a delimiter at minimum. How does RCS compare to extending text message protocol? I ask this because I somehow doubt Apple will adopt the new standard but could be wrong when it doesn't support encryption. Here is a list of fea...
I'm learning about Traveling Salesman in an online course (sorry I can't share the link it's paid only) and the first step to solving it then just state "as a heuristic we avoid crossed paths" and never really explained why. Why are crossed paths bad in traveling salesman?
The following is a problem statement from "Introduction to Theory of Computation" Chapter 0 Problem 0.14: Let $G$ be a graph. A clique in $G$ is a subgraph in which every two nodes are connected by an edge. An anti-clique, also called an independent set, is a subgraph in which every two nodes are not connected by an ed...
I am trying to solve an LP in which one of the constraints is mentioned below, $$\max(x_1,x_2) \ge q,$$ where $x_1 \ge 0$ and $x_2 \ge 0$. Is it possible to do in linear programming?
I want to better understand how this actually works, as my solutions are sometimes not 100% correct. I have the following relation: Check if the following relation is reflexive, symmetric, and/or transitive: $$ R_1 = \{ (x,y) \mid x,y \in \mathbb{R}, x=0 \land y \geq 0 \}. $$ so by that $$ R_1 = \{ 00, 01, 02,03,04,0...
I am reading the book An Introduction to Mathematical Cryptography. In its chapter 7, there is the following statement: In real world scenarios, cryptosystems based on NP-hard or NP-complete problems tend to rely on particular subclass of problems either to achieve efficiency or to allow the creation of a trapdoor. Q...
A symmetric matrix $A\in \Bbb{R}^{n\times n}$ is copositive if for every vector $x\in\Bbb{R}^n$ with non-negative entries, we have $$x^TAx \ge 0.$$ What are known methods to check if a specific matrix $A$ is copositive that are efficient in practice? I'm looking for something which will return an answer for a single in...
How can I solve the following recurrence $T(n) = T(n - 1) + n$ with the substitution method? I guess the solution is $\Theta(n^2)$ I try to demonstrate $O(n^2)$: $$T(n) \leq O(n^2) \\ \leq c(n-1)^2+n \\ \leq cn^2+c-2cn+n$$ How can i continue?
For a CAM (Computer Aided Manufacturing) software, and more specifically, for the simulation of the subtractive manufacturing, I would like to understand how to design the representation. In subtractive manufacturing (e.g. a Mill), a piece of raw material like a cube or a cylinder is machined. That is, a milling bit (...
Given three binary strings, find the maximum possible length of a contiguous block of 1's formed by shifting and overlapping the strings. This may be interpreted as finding the maximum window size $k$ such that for each column $(a, b, c)$ across the three strings, it holds that $a \lor b \lor c$ is true. If we instea...
I find in many references the fact that if $G$ is a connected planar graph, then for any embedding, $G^{**} \cong G$. However, all those references either say that this fact is trivial, or give the proof as an exercice. I am ok that this is clear on a small graph, with a nice embedding, but how can we prove this proper...
As the question implies, can you mention any difference between Hidden Markov Model and Non-deterministic Finite-State Machine? Are they different or the same?
Consider the following mathematical model of training a neural net : Suppose $f_{w} : \mathbb{R}^n \rightarrow \mathbb{R}$ is a neural net whose weights are $w$. Suppose during the training the adversary is sampling $x \sim {\cal D}$ from some distribution ${\cal D}$ on $\mathbb{R}^n$ and sending in training data of th...
Can someone recommend introductory articles/papers on the connections between dependent type theory and locally cartesian closed category? Many Thanks!
Most definitions of a $k$-wise independent family of hash functions I have encountered state that a family $H$ of hash functions from $D$ to $R$ is k-wise independent if for all distinct $x_1, x_2,\dots, x_k \in D$ and $y_1, y_2,\dots, y_k \in R$, $$\mathbb{P}_{h \in H}(h(x_1) = y_1, h(x_2) = y_2, \dots, h(x_k) = y_k) ...
Given: $$f(1) = 1 \\ f(n) = 4f(n-1) + f(n/3) + f(n/8)$$ (if $n<1$ then it is still 1) And I need to find $\Theta(f(n))$, can I do this? $$ \Theta( f(n)) = \Theta(4f(n-1)) + \Theta(f/3)) + \Theta(f(n/8))$$ Then solve each term and get that it is $\Theta(4^n)$ ? Or it is not possible as we basically have this: $$ f(n) =...
I understand that every modern human made computer is being operated by time sharing operating systems which allow two or more users running two or more processes at once each, from two different terminals. Take for example playing two songs at once: One from YouTube and one from MP3; they appear "mixed" but the "parti...
In the bin packing problem, there are some $m$ items of size less than $1$, and they have to be packed into as few as possible bins of size $1$. The problem is NP-hard, but if we are allowed to break some items then it becomes easy, since each bin can be filled completely. What if we are allowed to break (to as many pi...
The Akra–Bazzi method handles recurrences of the form $$ f(n) = \sum_{l=1}^k a_l f(n/b_l). $$ Does it work when then number of $a \cdot f(n/b)$ is not finite, meaning that we have a sum that depends on our input $n$? What about this: $$ f(n) = \sum_{l=1}^{n} f(n/3^l) $$ Can I say that we need to find the $p$ so that $$...
Is it possible to make an algebraic grammar LL($1$) which recognizes palindroms for an alphabet $\{a,b\}$?
I know the fact that if we have two functions $f$ and $g$ it is valid to say that: $$ \Theta( f(n) + g(n)) = \Theta( \max\{f(n), g(n)\})$$ My question is if this is valid when $g$ is not a separate function, but also some kind of $f$? For example, if we have: $$f(n) = f(n-1)+f(n/3)+ f(n/9)+\dots+ f(n/3^{\log_3(n)})$$ I...
I am trying to understand the definition of skewed circuits in these slides which is given as follows: A circuit is skew if in each product gate, at least one product has degree $\le 1$. I think author wants to say that each product gate is either a leaf node or one level above the leaf node.
I was studying CRC from lecture notes of Schwarzkopf but I am stuck at this statement: If $G(x)$ is a factor of $E(x)$, then $G(1)$ would also have to be $1$. What does this statement means? It is the third point in the third last block of the article whose link is given. I know a similar question is asked but that i...
I am currently studying the book 3rd edition CLRS Algorithms textbook, Chapter 3. I had the exact same question as this post but I have one more question now: What is a negative function? These functions are estimates that describe the time it takes to perform a function (an algorithmic sequence) onto a list. How can t...
Suppose I have a matrix that I know to be singular. This means that there is at least one row in the matrix which is a linear combination of the other rows. What is the fastest way to identify which row that is or which rows they are? I'm aware that the solution to this problem is not unique in general. The goal is to ...
Wiki describes the binary relation $\underset{\mbox{G}}{\implies}$ as "G derives in one step". I have a question on the condition when there are multiple productions for a single non-terminal. Wiki defines $G = (N, \Sigma, P, S)$ and $\underset{\mbox{G}}{\implies} \subset (\Sigma \cup N)^* \times (\Sigma \cup N)^*$ wh...
The lecturer of my graduate algorithms course suggested that, even if a Fibonacci Heap would consolidate its tree list after every operation (not just when doing deleteMin()), most operations would still have $\mathcal{O}(1)$ amortized complexity. I've been trying to prove this, starting with the classical potential fu...
I am trying to distort the image obtained from two cameras that generate a stitching image. Unfortunately, I do not have access to the cameras and I would like to know what could be the best way to apply to correct the image and get the lines below to be straight. The next step I am trying to do is to calculate the ho...
How to show that the quick-sort algorithm runs in $O(n^2)$ time on average ? Because on average, the expected running time is in $O(n\log n)$. The algorithm should not be in exponential time.
Say I have a incredibly simple input to a convolutional layer: [In1] <----- 1*1 input matrix I have two filters applied this input:[F1] and [F2] They give the results: [F1 * In1] and [F2 * In1] Then let [F1 * In1] = [Out1] and [F2 * In1] = [Out2] I then calculate ∂C/∂In1 for each filter: [∂C/∂Out1 * ∂Out1/∂In1] and [∂C...
A basic question or request for clarification regarding Karp reducibility: Let $\Sigma^*$ be the set of all finite strings of 0's and 1's. Call a subset of $\Sigma^*$ a language. Let $\Pi$ denote the set of all functions from $\Sigma^*$ into $\Sigma^*$ that are computable in polynomial time. According to Karp, a lan...
In my chess code I explore the whole tree of possible movements to find saving moves for a checked king. That is, for every one of the checked king's side pieces I search their whole tree of moves and keep those that remove the king from check in a list. Not like it's particularly expensive computationally-wise with a ...
I need an instance of 3SAT with exactly one solution but I cannot think of or find one anywhere. Can anyone please give me an example?
I tried many grammars and so far I got this one: \begin{align} &S \to aXbZ \mid abc \\ &XZ \to Ybcc \\ &Xb \to bX \\ &bY \to Yb \\ &aY \to aa \mid aaX \end{align} Is my grammar correct? Is there a simpler one?
I have 2 max-flow function f1,f2 that are different from one another (atleast on a single edge). I know they give each edge a natural even value. I constrct 2 types of average functions: A)$ g (e) = (f1(e)+f2(e))/2$ B) $h(e)=f1(e)*1/3 + f2(e)*2/3$ I want to prove or disproof their being max flow functions too. My thoug...
I have an $MST$ tree $T$. I increase the weight of a single edge $e$ by $c$(a non negative constant). I need to recompute an $MST$ as fast as i can. How I do this? The idea I had in mimd is to remove $e$ from $T$. Loop over all crossing edges between the two "halves" of $T$. See which one is minimal weight. Add her ins...
found this question online and I am trying to solve this question. I have solved this question but I think I might be missing some cases. Could someone verify if my answers are correct? Let N = (Σ ∪ {λ}, Q, δ, q0, {qf }) be a λ − NFA and let L = L(N) be the language accepted by N. For N assume q0 has no incoming transi...
I have a question about the pumping lemma for context-free languages. I understand the conditions of the pumping lemma. Assume $L$ is context-free. Let $n>0$ be the pumping length given by the lemma. $z=uvwxy$ with conditions: $|vwx|\leq n$ $|vx|\geq 1$ $\forall i >0, \exists z= uv^iwx^iy \in L$ But i need to kn...
In every group chat of six (distinct) people on Instagram, there is a group of three (distinct) people such that either: everyone in the group are friends everyone in the group are strangers (i.e not friends). Let $F(x,y)$ be a relation that denotes that $x$ and $y$ are friends on Instagram. Translate the statement...
I've read Chapter 5, Syntax Directed Translation, of the Dragon Book but am still unable to understand the following related points: How to handle L-attributed SDDs in an LR grammar when using a tool such as Bison? I believe, the book says that inherited attributes could be used with an LR parser (via Marker symbols?)...
I don't understand the last para. I corrected its typos. Please explain like I'm 5. If micro-kernels can be big, and monolithic kernels can be small, doesn't this size gradation collapse the distinction between monolithic kernels and micro-kernels? Is this what a hybrid kernel means? So.. that's the ELI5 version. Thin...
Let's say we start with $i = 1$, $j = 1$, $i \leq n$, and $j \leq i$ and then increment $i = i+1$ and $j = 2j$, respectively. The output prints $k$ times, which represents the inner loop. Output: print s $k$ times. Example when $n=5$, loop will print 11 times. How to find the complexity function of this algorithm for...
I am still trying to get my head around what is valid CNF and how distribution works, I am not even sure if the examples I have tried to convert are correct for one, but I am also unsure of the rule for distribution and when I have looked at other posts here it seems so complicated and the actual rule does not seem to ...
I am told to solve the recurrence $$T(n)=10T(n/9)+n\lg(n)$$ using the Master theorem. I then try to use case 3. However, I am unable to show that for $f(n)=n\lg(n)$ then $10f(n/9) \leq cn\lg(n)$ for $c < 1$ and all sufficiently large $n$. Is it wrong to use case 3? Or does the Master theorem even apply?
I understand that in a non-deterministic automaton, an input can lead to one, more than one, or no transition for a given state. Given this information, I would assume that if the input lead to a loop, this loop would be infinite until a determined input happened (being one || more || ε). However I would like to know i...
Is the language $\{wxw^Rx^R \mid w,x \in \{0,1\}^* \}$ context-free My thoughts, Let $x = \epsilon$ and we get $ww^R$, which is context-free. Hence the given language must be context-free. Am I right?
I am using language as a placeholder although I think it can be used in music too. I am unclear if the frequencies are given based on the text or the entire language. The latter would prove to be difficult because if we are to say that 'e' is the most common letter in English, wouldn't this shift over time with some ne...
I have to figure out the frequencies of 3 letters for Huffman encoding of {0, 10, 11}. One suggestion is in the order {$\frac{2}{3}$, $\frac{1}{6}$, $\frac{1}{6}$} as given in part (a) the 2nd slide of page 3 here. My question is whether the last 2 character frequencies need to be evenly split. Could we not have had {$...
In a weighted graph $G(\mathcal{V},\mathcal{E})$ where $w(i,j)$ is the weight of the edge $(i,j) \in \mathcal{E}$. How can I find a maximum weighted matching with a specific size (i.e specific cardinality).
I have a simple question regarding reduction using K-Maps. My professor gave this example: While I somewhat understand that we can only group quantities of base 2 numbers, why did my professor group the K-Map values like the image above instead of the image below (what I drafted): Why did my professor include element...
David Harel's StateCharts introduces hierarchical states and history mechanism, which are really powerful when modeling complex system behaviour. But when doing model based testing we need a "flattened state machine", that is an equivalent state machine without any hierarchy. By googling around I found this paper by Wa...
So I have the question: show "Show $\{0^1^|≠\}$ is not regular". I've already seen various proofs for this question, but they all have one step I don't get. They all take: $\bar{L}∩(0^∗1^∗)$ ($\bar{L}$ is the complement of $L$) and show that it's not regular. I don't get why we can't just take $\bar{L}$. Because isn't ...
I am trying to understand the proof of the master theorem and I came up with my own proof for why (4.23) is true. My argument is as follows: Claim: $g(n)=O\left(\sum_{i=0}^{\log_{b}(n)-1}a^i(n/b^i)^{\log_b{a}-\epsilon}\right)$. $$g(n)=\sum_{i=0}^{\log_{b}(n)-1}a^if(n/b^i)$$ Now by the definition of big O, we have that...
This is a GATE 2021 exam question. If the numerical value of a 2-byte unsigned integer on a little endian computer is 255 more than that on a big endian computer, which of the following choices represent(s) the unsigned integer on a little endian computer? A. 0x6665 B. 0×0001 C. 0×4243 D. 0×0100 According to me, answ...
May anyone explain me why $\forall x \in \mathbb{N}\ \Phi(x,x)$ is unary but $\Phi$ is binary? In my latest exam I wrote that the universal function $\Phi^n(x_1, x_2, ..., x_n,y) = \psi^n_y(x_1,x_2,...,x_n)$ is unary because its $n+1$ parameter is a constant referring to the number of the S-program ($y$), but my teache...
Given that array has $k$ elements (all distributed uniformly). Its length is exactly $3$ somewhere in $[0, k)$. For example, if $k=100$ then, we have $100$ numbers and they can be in $[10,13)$, but they can also be at $[89,92)$ I need to offer a sorting algorithm, which is efficient. Now, my idea was Bucket Sort, but w...
Let $\forall n \in \mathbb{N}\ \ P(n)$ a primitive recursive predicate such that $\neg P(n)$ for a finite number of values of $n$. Why this function: $$ f(x) = \begin{cases} 1 & \text{ if there are at least $x$ numbers $n$ such that $P(n)$}\\ \uparrow & \text{ otherwise} \end{cases} $$ is a recursive primitive functio...
Any help will be appreciated, as I wasn't able to find much about it online in the last few days and I can't seem to write a suitable recurrence relation for this kind of functions.. Are there any tips or general guidelines for calculating the complexity (time/space) for functions of the following form? int f1(int n) {...
I am trying to figure out the solution of the recurrence relation $$T(n) = 5T(n/3) + n \log n$$ using the Master Method. I am guessing that $f(n) = O(n^{1.46 - \varepsilon})$, but I am confused in the part that $\frac{n \log n}{n^{1.46}}$ must be polynomially smaller. If something is polynomially smaller does it mean i...
The paper “Where the really hard problems are” (https://www.ijcai.org/Proceedings/91-1/Papers/052.pdf) and others that cite it provide evidence that lots of algorithms for many NP complete problems (when suitably parametrised) perform poorly on the problems that lie on the phase transition from under constrained to ove...
I am trying to solve this by using Substitution method. My solution must work both for even n-s and odd n-s. For evens case I have solved it. But for the odd's case I am stuck at this point. Hot to continue?
I have the vocabulary $\tau = \{+, 0 \}$ and the structure $R = (\mathbb{R}, +^R, 0^R)$ where $+^R$ is a binary function symbol representing the normal addition of numbers and $0^R$ is the constant $0$ in $\mathbb{R}$. I 'm trying to prove that the bijection $$\sigma : \mathbb{R} \rightarrow \mathbb{R} \text{ with } \s...
The following algorithm for computing the number of nodes in a linked list appears in this thesis on common algorithms in the PRAM model for parallel computation. The author then argues that this is a $log(n)$ time algorithm (where $n$ is the number of nodes in the list) because the span of nodes covered by the "far" ...
I am given a sorted array with n integers. All of the elements repeat exactly twice, while there is one element without duplicate. I need to solve it as efficient as it is possible by divide-and-conquer algorithm. I have noticed that n needs to be odd to satisfy my condition. I thought about doing this: divide my array...
Is there a way to generate a bijection over integers $F : [0..n) \rightarrow [0..n)$ that satisfies the properties: $n$ is arbitrarily chosen and can be any positive integer $F$ generates a pseudorandom, potentially biased permutation of its domain $F$ is seedable and can be easily influenced to generate a different r...
can someone explain what the following notation is? For j <- 1 to n Legal <- True I've seen these in various places, including wikipedia articles. It seems to be a specific notation, but I don't know the name and can't find much of anything on it. Can someone explain what it is, where it's used, if it's in widespr...
When $\overline{M}$ is a non-deterministic polynomial by time Turing machine that final states switched: accept to reject and vice versa. I'm thinking that this equal to $P=NP$, but I saw a solution (an example) that I disagree with: $M$ is a non-deterministic polynomial by time Turing machine that decide $SAT$, if all...
I was trying to store a Huffman tree in a binary file recently. I thought it wouldn't be a big problem since you actually have the binary codes already in front of you. Well, the difference is that the file (in the hex editor) is logically coded in hex. So I tried to convert the "characters" from binary to hex. Without...
Given an arbitrary CPU - Architecture and its instruction set... What would be the outcome of the given inverted instruction within that Architect? For simplicity, let's use an 8-bit CPU architecture that has an 8-bit Bus design where that bus is used for both addressing and data transfer operations. A single instructi...
if given a language $L$ recognized by NFA $N_0$ over an alphabet $\Sigma$. Is it possible to find a general way of constructing an NFA $N_1$ that accept $L^C$ such that $L^C= \{w \in \Sigma^{*} |\mid w \notin L \}$?
Given a string s and an int k, return an int representing the number of substrings (not unique) of s with exactly k distinct characters. If the given string doesn't have k distinct characters, return 0. Input: s = "pqpqs", k = 2 Output: 7 Explanation: ["pq", "pqp", "pqpq", "qp", "qpq", "pq", "qs"] I have this solution...
I sort of know how to solve the problem but I am not sure how to do it in a systematic way. Could someone provide a step-by-step solution especially for the follow set one? Thanks!
So I get this through the math behind the SVM (Support Vector Machine), and I get this formula $$(w^T)(x_1-x_2) = 2.$$ We then divide both side with norm of $w$ then we get the new formula $$ \frac{w^T}{\|w\|}(x_1-x_2) = \frac2{\|w\|}. $$ Why do we divide by the norm of $w$ in both sides?
Can somebody help me with the formula needed to calculate the number of weights for a CNN, using the following sample question as the basis for it? Suppose we have a convolutional neural network with a 5x5x1 input volume, followed by one convolutional layer with 5 filters that have a 2x2x1 receptive field, followed by...
I had a question about a general statement regarding finding a computationally indistinguishable distribution given any distribution, observed (in the third paragraph of Section 11, page 31) here. This is the statement: For any distribution $D$ over $\{0,1\}^{n}$, there exists a distribution $D'$ such that $D$ and $D'...
The $\Leftarrow$ direction is straightforward. On the other hand for $\Rightarrow$ direction I have an idea of the prove but I don't sure about it. For NTM, Non Deterministic Turing Machine, $M$, for example TN that decide $SAT$, $L(M)=L(\overline{\overline{M}})\in NP$. It's clear that exists NTM $M'=\overline{M}$ such...