instruction
stringlengths
35
29.1k
So I've got a bit of category theory under my belt, and I am reading a few papers about calculating functional programs. I've expressed programs like summing a list as a catamorphism, and I've fused some catamorphisms, too. I thought it might be interesting to see how far I could take what I now know about catamorphi...
The problem is as follows. Background: Given an alphabet $\varSigma$. If $u,v,w,x \in \varSigma^*$ and $w=uxv$ then $x$ is a factor (substring or infix) of $w$. A language $L$ is factor-free if, for all distinct words $x, y \in \varSigma^*$, $x \in L$ and $y \in L$ imply that $x$ and $y$ are not factors of each other. ...
QUESTION does CPU time reflect Big O time complexity? WHAT I MADE I implemented two Fibonacci functions in C programming language. The former has recursive behaviour while the latter has iterative behaviour. I found out that the worst case scenario for the recursive version is exponential time (i.e. $2^n$) and linear t...
(Decidable or not?) Formulate the following problem as a language: Given a Turing machine $M$ and a string $w$, determine whether $M$ visits each of its states exactly once during the computation with input string $w$. Prove your answer. So the problem above is what I am trying to solve. I am looking for a general...
I have a question about contingent sentences. To my knowledge, contingent sentences are sentences that are neither tautologies nor contradictions. In a textbook I read that a sentence might always be true and still be contingent. The example given was as follows: If there never were a time when the universe contained f...
I have to prove the NP-completeness of the following set: QUADRUPLE-SAT:={F is Formula in CNF|F has at least 4 satisfying interpretations} My idea so far has been to reduce the problem to the normal SAT by constructing a new formula, copying the original formula 4 times and using a new set of literals in every copy, th...
I know there is a polynomial time algorithm for 2-coloring. But should the answer be "No" or should it be "Maybe"? Since 2-coloring is in NP and we dont know if there is a reduction of any NP-complete to 2-color.
I am currently learning about NP-complete problems and I want to make sure my understanding is correct. Here is a problem I am working on currently: The exact distance problem is, given an edge-weighted graph $G = (V,E)$, vertices $v_1,v_k$, and a distance $D$, is there a simple path from $v_1$ to $v_k$ with length ex...
I was reading the book lambda calculi , encountered an equality theory called "the rule of weak extensionality", which is shown as follows. $\frac{M \, = \, N}{\lambda x.M \, = \, \lambda x.N}$ Yes, it is obviously true. But why it is called the rule of weak extensionality? what is weak? what is extensionality here ...
Zero and one are defined by the successor function. $$ \begin{align*} &0 ≡ λsz.z \\ &1 ≡ λsz.s(z) \end{align*} $$ But why? $λsz.z$ is irreducible to a value. If I call this function on some value, I get back $z$, which is merely a variable in itself. If I call the function on two values, I get back the second value, wh...
will an OS which favors I/O bound processes over CPU-Bound processes, experience less average waiting time? If yes, why?
The underlying question: What does lambda calculus do for us that we can't do with the basic function properties and notation generally learned in middle school algebra? First of all, what does abstract mean in the context of lambda calculus? My understanding of the word abstract is something that is divorced from the...
From our computational complexity, there's a question asking to prove 3CLIQUE is decidable. The definition of 3CLIQUE is: $$\{(V,E) : G = (V,E)\text{ is an undirected graph that contains a clique of size 3}\}.$$ I know this is an NP problem, and NP is a set of problems that easy to verify but hard to solve, but I don't...
I have to take input in an array(no. of elements in array <=10^5). For ex:- Let the array be {2,3,4,16,9,45,81,27} Now I need to find the order of the maximal set such that any pair of elements in the set have gcd > 1. In the example:- {3,9,45,27,81} is such a set.It's order is=5, hence 5 is my ans. Note that {2,4,16} ...
As I understand, the concept 'computation' started dependent on hardware (like looms for instance). The Hardware defines (physical cascades) what happens between input and output. I think I saw in a CS class, a mention about universal calculation where software is not limited by hardware? It's hard to find a succint...
There is a set of all possible letters: $A = \{ a, b, \ldots, z \}.$ Then the set of all possible 3-grams looks like that: $A^3 = A \times A \times A = $ $\{$ $\;\;(a, a, a), $ $\;\;(a, a, b), $ $\;\;(a, a, c), $ $\;\;\;\; \ldots, $ $\;\;(a, a, z), $ $\;\;(b, a, a), $ $\;\;\;\; \ldots, $ $\;\;(z, z, y), $ $\;\;(z, z, z...
There are $N$ boxes and every box has some weight(non-zero). We start from $Box$ $1$ and move towards the $Box$ $N$ one by one. Now there are 2 option ,either to lift that box or leave it. We want to lift the maximum number of boxes possible. But there is a condition that must be fulfilled for the lifted boxes. For ev...
Consider the language $$ L = \{0^p 1^q 0^p | p, q ≥ 0\}. $$ How to make a finite automaton for $L$? How to make a regular expression for $L$?
What are the exact assumptions behind the use of UPGMA? Can I use a non-Euclidean metric? This may result in a non-Euclidean distance matrix. What kind of bias may I encounter if I do so? References are appreciated.
Let $G$=$(V,E)$ with $V=$ {$1,2,...n$} and $E$ = {$e_1$,$e_2$,...$e_m$}. On the set of edges we have a cost function $c : E → R$, with a property like if i $\neq$ j then c($e_i$) $\neq$ c($e_j$). We also know that the graph is represtend with adjancency lists, $A(v)$,v$\in$V, and for $u$ $\in$ $A(v)$, i can find the ...
Let f be the function with one argument - positive integer n function f(n) j = 1 for i=1 to n: j = 2*j k = j while k > 0: k-- print * My approach: let n = 6 breakdown the for cycle breakdown the while cycle -> when i == 1, we print two *, when i == 2, we print four *, etc. So I've assu...
We are given $m$ arrays of $n$ elements each. For 90% of these arrays we run an $\mathcal O(n)$ algorithm and for the other 10% an $\mathcal O(n\log n)$ algorithm. What is the total time complexity? I think it is $\mathcal O(m n \log n)$ but I am not sure.
In this video clip the teacher presents a grammar $A \rightarrow A \alpha | \beta$ and after providing the parse tree explains that the regular expression for the language generated is represented as $\beta \alpha ^*$. Why isn't it $\alpha ^* \beta$ instead? Isn't the grammar left-recursive into terminal $\alpha$ and o...
Given a sparse matrix $M \in \mathbb{R}^{n \times m}$ with $n \ll m$ and $\mathsf{nnz}$ being the number of non-zero-components. What is the running time of computing $M M^T$?
Suppose we are doing a random walk on the infinite integer line and that we take $2n$ total steps. At every step of this walk, the position of the walker is an integer point on this line. For the next step of this walk, the walker moves to one of the two adjacent/neighboring integer points with equal probability (assum...
Let G = (V,E) be a connected graph and a ∈ V be an articulation point of G. How can be proved that there is an edge e ∈ G incident with a with the property that e doesn't belong to a perfect matching of G? Let's say that there are two vertices u,v ∈ G so that the only paths between them go through a. Then there is no e...
I'm trying to figure out what is the optimal order for running a sequence of tasks in a pipeline. Each task filters a percentage of the dataset. Assuming I got the tasks t1, t2, t3, ..., ti and a dataset. Each task have an execution time per item in the dataset denoted as e1, e2, e3, ..., ei and each task filters a cer...
I have a homework assignment dealing with caches. We are asked to compute the total number of bits of storage required for the cache, including tags and valid bits. Then compute the overhead for the cache incurred by the tags and valid bits. Info given: Consider a direct-mapped cache with 16KBytes of storage and a bloc...
I was reading CLRS about BFS and DFS, and the algorithms presented therein, which I take to be somewhat standard, construct a forest with DFS that includes all the nodes, whereas BFS only constructs a tree from a chosen node $s$, and leaves out all the other nodes that are not reachable from $s$. It seems BFS can be ad...
I am trying to understand the following claim: For a fixed size cache, each increase by a factor of two in associativity doubles the number of blocks per set (i.e., the number or ways) and halves the number of sets – decreases the size of the index by 1 bit and increases the size of the tag by 1 bit. I am ju...
Can anyone explain why can't we use a Turing machine's transition diagram? For e.g. The definition of a USELESSTM is as follow: A useless state in a TM is one that is never entered on any input string. USELESSTM = { ⟨ M, q⟩ ∣ q is a useless state in M } I know this problem can be proved to be undecidable by reduc...
Instance: a directed graph $G = (V, A)$ with weights $w_a\in\mathbb{R}$ on the edges and a root $v\in V$. Solution: A directed tree with root $v$. Objective: Minimize total weight. My formulation: My AMPL code: param n >= 1, integer; # number of vertices set V := 0..n-1; set E within {V,V}; param r := 0; param w{E...
This question is about whether every mathematical theorem can be reduced to the question of whether a single Turing machine halts. In particular, I'm interested in conjectures that are currently unproven. For example: Wikipedia says that it's currently unknown whether there are any odd perfect numbers. Since it's decid...
I'm interested in compression algorithms where the compression ratio increases as the amount of data to be compressed increases. Let's call this "super compression". Could super compression be achieved through recursive compression algorithms? Here's the kind of algorithm I'm contemplating. The binary file is first s...
I have a very basic question. Can we have a PDA which can accept a string by both final states and empty stack? Can the same PDA accept by the two modes simultaneously ? If there are final states for acceptance and in addition to that at some point in time the input string is read completely and simultaneously the s...
I have the following code: n - number of 1-d points (real numbers) numbers[n] - array of numbers n list, se_list - list variables to store cluster starting points _____________ sort(numbers) find_cluster(start, end, ci): \\ ci - cluster index best_se = +infinity \\ best squared eror list = {start} for i from s...
i have the following CFG E -> ABC A-> a|Cb|epsilon B-> c|xA|epsilon C-> y|z and the First of the Non-Terminal : First(E) = {a,y,z,epsilon} Frist(A) = { a,y,z,epsilon} First(B) = { c,x,epsilon } First(C) = {y,z} the follow of Non-Terminal : follow(E)={$} follow(A)={c,x,y,z} follow(B)={y,z} follow(C)={b,$} my problem ...
While doing some digging around in the GNU implementation of the C++ standard library I came across a section in bits/hashtabe.h that refers to a hash function "in the terminology of Tavori and Dreizin" (see below). I have tried without success to find information on these people, in the hopes of learning about their h...
Problem: Consider a k-SAT solver that assigns values independently uniformly at random to all the variables. Given the formula has $m$ clauses provide an upper bound for the probability of a random assignment to be unsatisfiable. The issue is that I have no clue from where to start. Both Markov, Chernoff, Chebyshev a...
I have a clue as to how this code/traversals work but I'm still confused. For example, in the first traversal (Preorder), it prints 31, 12, 25 but then it backtracks all the way to 68? How does it know to do this? My professor referenced a stack but I am still a bit confused. As for the other codes, I don't know how ...
I need to classify the set $$\{p|∃y : \operatorname{Dom}(φ p ) ⊇ \operatorname{Dom}(φ y )\}$$ as decidable, semidecidable or not semidecidable. I don't know how to start. Any ideas? Dom (φp) it's all the inputs that are accepted by a turing machine "p", and the same for Dom (φy). So if My(some input) accepts then Mp(s...
(Note: I couldn't put "balanced tree" in the tags ; this topic isn't about balanced search trees, just balanced trees.) Let $A$ a binary tree. We have the relation: $log(|A|+1) \leq h(A) \leq |A|-1$ where $|A|$ denotes the size of A (the number of nodes) and $h(A)$ its height. Then I was told that A is balanced if $h(A...
I read that the following language is decidable. $\{w | w \in \{0, 1\}^* \text{ and } 1^{|w|} \text{ is a substring in binary expansion of } \pi \}$ The proof has been given by considering the two possible cases Suppose it is true that there exists a minimal integer $N$ such that the binary expansion of $\pi$ only con...
I found that sorting algorithms such as Insertion Sort and Djikstra's Smoothsort approach O(n) complexity when the list is nearly sorted. What are some real world scenarios where a list is nearly sorted?
Need to prove equivalence for (or disprove equivalence for): $ \hspace{1cm}\square ϕ → \lozenge ψ ≡ ϕ\textsf{ U }(ψ ∨ ¬ϕ) \\ $ My current attempt using the LTL equivalnce rules to determine equivalence: $ \square ϕ → \lozenge ψ \\ ≡\ ¬\square ϕ \lor \lozenge ψ \hspace{1cm}(\textsf{"Mutual implication"} ϕ →ψ≡¬ϕ\lor ψ )\...
Would be possible to encode dependent types as regular expressions? if so, ¿is there some work about? It's common to represent restrictions for elements in a traversable data structure with them, like clojure.spec do for sequences. But i tried to find some references about using them to represent restrictions at type l...
Apologies if a duplicate. New to this community and did try to search. I want to create a mapping document that equates defect severity levels together so it looks like || System 1 || System 2 || System 3 || | level1-1 | level1-2 | level1-3 | | level2-1 | level2-2 | level2-3 | So that I can effectively do a loo...
How words can instruct hardware to do an operations . I understand that these are converted to 0s and 1s . But still I can't intuitively understand How it works . A detailed explanation would be appreciated .
Bob has $2$ cranes and $M$ available containers ($1 \leq C_i \leq M$) and he has to do $N$ transports from one container to another given an input list (the order of the transports must be respected). To execute a transport from container $C_i$ to $C_j,$ Bob must choose a crane and move it to $C_i$, pick up the suppli...
Consider the following algorithm for the maximum matching problem: Sort all nodes by their $\deg(v)$ Take the node with minimal $\deg(v)$ Take a random edge $(u,v)$ $\in$ $E$ Add $(u,v)$ to $M$ Delete all edges of $u$ and $v$ in $E$ I have to show that the algorithm isn't correct for undirected graphs with maximum de...
Say I have the following memory scheme: Data bus: 8 bit Main Memory Store: 256 Byte Cache Store : 32 Byte Block Size : 4 Byte How would I go about listing the assigned bits for tag,offset and block number for location 12? I think the right answer is 12 is binary is 00001100 since we have 8-bit representation. Then t...
Want to clarify few things. It is said that two $\lambda$-terms are equal up to renaming of bound variables, such as $\lambda x.x$ equals $\lambda y.y$, so I think it is a relation actually, about how two terms are equal. Is that (such equality up to renaming) is same as equivalence relation? To show a relation is an e...
I am trying to implement a context-free grammar for $L=\{a^n b^m \mid n \neq 2m\}$. I have a difficulty trying to implement it because I don't know how to ensure that $n \neq 2m$. I can easily implement $n=2m$ but the other way around doesn't seem intuitive. How can I approach this problem?
I've been going back and forth with this for a dew days, can't quite be sure. When I look at the pumping lemma method, I think a context-free language could possibly be reduced to a regular language.
I'm not sure if it's the right place for this question. Sorry if going a bit off-topic. Choosing a suitable Language for the first programming course is one of the most important things that every related teacher/lecturer should bear in mind; especially if the students are young or having a limited math knowledge. I'm ...
From time to time I am trying to implement automatic programming system. We already have the formalization of norms (laws/legislation, business policies and rules) as some kind of deontic logic (there have been endeavours to convert deontic logic formulae into executable rules). We have ontology of GUI elements. So - w...
I am confused about a statement in The Art of Multiprocessor Programming: Theorem 3.6.2: Let inv(m) be an invocation of a total method. If <x inv P> is a pending invocation in a linearizable history H, then there exists a response <x res P> such that H · <x res P> is linearizable. ... This theorem implies that lineari...
I am a CS student learning about neural nets. Currently I am confused about how to train a neural net in batches. If I calculate error in a batch, I will get a vector of errors e.g. real1 - predicted1, real2 - predicted2, etc... How do I then calculate a single gradient value to adjust the weights with?
Variabled $x_1, \dots, x_6$ have hidden, distinct integer values from [$1,\dots,6$]. How to identify each variable's value with minimum number of comparison operations?
I am working on a project that requires the creation of a database. Of course we have used ERwin, which seems to be a well known tool for data modeling. My team member just completed the implementation of our database in ERwin. However, the relationships between tables do not remind of how they looked in Microsoft Acce...
What image properties are given by similitude moments? These are image moments of the form shown below: $$\eta_{pq}=\frac{\sum_x\sum_y(x-\mu_x)^p(y-\mu_y)^qI(x,y)}{(\sum_x\sum_yI(x,y))^{\frac{p+q}{2}+1}}$$ Specifically, I'm looking for the properties given by this set of similitude moments: [$\eta_{02}$, $\eta_{03}$, $...
• Given the above virtual to physical address mapping, 1 What is the page size? 2 How many virtual pages can we have in maximum? 3 How many physical pages can we have in maximum? Approach: 1 For the page size I would say I don't know because we have no information that gives us a clue about page size. 2 I think that w...
I entered into a discussion with a friend on the following question, which asks if mutual exclusion holds: Consider two processes: $s_1$ and $s_2$ are two variables, set equal initially. P1: while $s_1 = s_2$: wait. /execute critical section/ $s_1$ is set such that it is not equal to $s_2$ P2: while $s_1 = s_2$:...
Please can any one describe this picture? I am not getting that 4 entries to 001.
"The Little Book of Semaphores" (2nd Ed. by Allen B. Downey, section 4.5.1) as well as Wiki (link) mentioned that a trivial solution (as shown below) to the 'Cigarette smokers problem' will cause a deadlock. Somehow I couldn't wrap my head around it. Pls help me undersatnd how deadlock can occur for the below solution....
I want to know if for any base the most significant digit is 1 or not. Here is the code: for(int i=3;i<=a;i++) { int x = i; int r = a; while(r/x) { r = r/x; } int rem = r%x; if(r==1) { count++; } } is there any optimal way to replace the while loop nested in the for ...
Consider the following grammar: $$ A\to Ba|Aa|c \\ B\to Bb|Ab|d $$ How do I convert this grammar to be LL(1) by eliminating direct and indirect left recursion? I have tried applying the rule which converts $A \to A\alpha|\beta$ to $A \to \beta A'$ and $A' \to \alpha A'$: For $A \to Ba|Aa|c$, $\beta = Ba|c$ and...
I have read that $L^* = L^+ - \epsilon$, but if we write $(\epsilon + a + b)^+$, is it equivalent to $(a+b)^*$?
Imagine you have a vector of pairs $(id, x)$ where $id \in I$, some set of opaque identifiers (hereafter, ids), and $x \in \mathbb{N}$ some value. Assume that every $id$ value is unique in your list. You can sort such a list on the $x$ values - below we will generally refer to this as a sorted list. Given two such sort...
I had an idea for a theoretical super computer. Supposing, one was able to optimise(or significantly increase efficiency) all algorithms used in most computing tasks(An open source project on algorithm optimisation maybe? The system design is being optimised from the barest tools, the "axioms" of the RAM model(algorith...
I am interested in the precise relation between $P$, $NP$ and $EXPTIME$ classes. What I know so far: $P \subseteq EXP$ (from Time Hierarchy Theorem [1]) We don't know an exact relation between $P$ and $NP$, and between $NP$ and $EXPTIME$. What do we know: 2.1 $\forall problem \in P \Rightarrow problem \in NP$ (Any pr...
I've looked around and can't find my answer. I have a set of $n$ numbers. In each iteration I would like to find an arbitrary number and change it. Is it possible to perform each iteration in $\log n$ time? There are data structures like a min-max heap which allow insertion and deletion in $\log n$ time, but that only ...
We have the word "w = aabceefgeebdaabbceeffghdcbbeefbbbbghhie ". I have created a Huffman tree for the string w. We get the following table: Now I want to create a Huffman tree for a Block-Code with length of block $4$. Do we maybe take each consecutive 4 letters, i.e., {aabc, eefg, eebd, aabb, ceef, fghd, cbbe, ...
Given a digraph, determine if the graph has any vertex-disjoint cycle cover. I understand that the permanent of the adjacency matrix will give me the number of cycle covers for the graph, which is 0 if there are no cycle covers. But is it possible to check the above condition directly?
My intuition says yes. I think so because if we could find arbitrary length cycles, couldn't we just look for an n length cycle and then solve HAM-CYCLE? But I saw a post that seems to suggest a polynomial time method for finding cycles! I feel as if perhaps I do not understand something here.
I have a translation function which translates $\lambda$-terms to another representation let me call it $G_\lambda$, as follows. $\chi(x)$ $=$ $ X^2$ if $ x \notin \Gamma$ $\chi(x)$ $=$ $X$ if $ x:X \in \Gamma $ $\chi(\lambda x.t_1)$ $=$ $abs(X^1,\chi(t_1))$ and ...
I am designing a graph algorithm. Some steps of the algorithm, are set operations (union, difference, intersection, set-membership). Can I assume them as $~ \mathcal{O}(1)$ operations? Have someone used them as $~\mathcal{O}(1)$ in his paper? What minimum complexity should I assume for these operations? References are ...
A colleague of mine and I have just hit some notes of one of our professors. The notes state that there are tasks that are possible to solve in polynomial time (are in the class of PF) but that are NOT verifiable in polynomial time (are NOT in the class of NPF). To elaborate about these classes: We get some input X and...
Say I'd like to transmit a 100-bit packet which has a field containing a continuous value. I'd like to protect this value with an error correction code but an error in the MSB of this value is much more catastrophic than an error in the LSB, so how do I have to design the code so that it will be optimal by means of pro...
The problem is the following. Suppose we have a sequence of n non-negative numbers, each element with index i having its own value, value[i]. We want to put some cells in a subsequence Plus, and some cells in the subsequence Minus. Not all the elements have to be in one of these subsequences, one might not be in an...
One of the inputs to my neural network is a set. I have a set $S = \{s_0, s_1, ..., s_n\}$ in which all values $s_i$ are constant. An example of such a set could be the set of French wines (Beaujolais, Languedoc-Rousillon, Champagne) or the set of players in a sports event (Player A, Player B, ...). The input to the n...
I have a very large graph of ~7 million vertices and ~100 million edges. One dfs run in my current implementation runs in 30 seconds. The graph is an unweighted directed strongly connected graph. I need to find the mean and median distances of the graph (median and mean distances over all shortest-path distances of t...
MAX-3-CUT gets a graph and a number $k$, and determines whether three sets of vertices can be found within that graph, where at least $k$ edges are in the cut. We define the cut as all edges $(u,v)$ where $u$ and $v$ are in a different set. MAX-CUT also gets a graph and a number $k$, and does the same but by dividing i...
System is in safe state if there exists a safe sequence of all processes. Sequence $[P_1, P_2 …P_n]$ is safe, if for each $P_i$ the resources that can still request can be satisfied by $P_i$ currently available resources + resources held by $P_j$ with $j \lt i$ The above is from a presentation distributed by my OS I...
This problem is from codechef.Can anyone please help me out with this one as I am unable to find out the subproblem.Thanks in advance! Problem -: In IPL 2025, the amount that each player is paid varies from match to match. The match fee depends on the quality of opposition, the venue etc. The match fees for each match...
It is possible to prove the correctness of algorithms, and two algorithms can be compared to see which has better performance using $O$ and $o$ notation. Is it possible to prove the efficiency of an algorithm? I.e. That that algorithm is the most efficient possible algorithm for a problem. Let $K_i$ be the set of all ...
What does the symbol "$\triangleright$" mean programming language semantics? I've seen it in the context of datatypes in and the evaluation of expressions in environments. For example : $$tenv \triangleright erht \implies tval $$ or $$tenv[tval/x]\triangleright ebody\implies t\,.$$ Here, $tenv$ is an environment and $...
In the context of disjunctive normal forms, which terminology do you use for the conjunction of atoms? E.g., for the disjunctive normal form $(x₁ ∧ ¬x₂ ∧ x₃) ∨ (¬x₁ ∧ x₂ ∧ x₃)$, how are the constituents "$x₁ ∧ ¬x₂ ∧ x₃$" and "$¬x₁ ∧ x₂ ∧ x₃$" called? Terms or clauses? I saw boths variants as well as "disjunctive clause...
I can't figure out a recurrence equation for a dynamic programming assignment. Formally, we aim to minimize the total sum of distances between matched points with the following constraints: Every point from both vectors has to be matched at least once, but can be matched multiple times. A point i can only be matched w...
Two algorithms to solve a particular problem can have theur efficiency compared using the $O$ and $o$ notation. However, this is very crude method, and tells us no information on how more effective one is than the other. Is there a yard stick that can be applied to ALL algorithms, with ALL time complexities, that can b...
I’ll define my question more specifically: Lets suppose we have an $n$ bit quantum computer, with qubits labelled $q_{1},…,q_{n}$, and let $b$ be any bit string of length $n$ (let’s assume we’ve labelled each qubits’ states $0$ and $1$ so that we obtain an $n$ bit bit string when we measure the qubits). The question i...
Lets say I have 1000 bytes that are supposedly random. I want to verify to a certain certainty that they are indeed random and evenly distributed across all byte values. Aside from calculating the standard deviation and mean value, what are my options for a robust verification process?
When I was trying to prove a problem at hand to be NP-complete, I coined the following problem: Given two integer sets $A = \{ a_1, \cdots, a_n \}$ and $B = \{ b_1, \cdots, b_n \}$. We know that there are $n!$ bijections between $A$ and $B$. For a bijection $f\colon A \to B$, define $$\max f = \max_{a \in A} \...
This is my third installation of my "Reasoning on Efficiency" series. This question builds on my first question in the series: "Reasoning on Efficiency (1)" The question in this installment builds on the ideas developed in the first question. Advertising out of the way, let's proceed. My question is this: Giving a par...
I want to know the theoretical representation of a double push or a double pop in pda
GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data. Source: http://graphql.org/learn/ So GraphQL allows a server to implement a HTTP-endpoint that accepts queries which are only constrained by the type system defined by the server....
I know $P$ vs $NP$ is an open problem in Computer Science. However the people concerned (at least according to Wikipedia) believe $P \neq NP$. I have two questions: $(1.)$ Given that it is possible to prove lower bounds for problems. Does there exist any problem(s) for which the solution can be verified in polynomial ...
The most recent challenge on Advent of Code involves constructing an image in a binary pixel array from a sequence of instructions: rect AxB, which sets all of the pixels in a rectangle A pixels wide by B tall at the top left corner of the array. rotate row y=A by B, which performs a circular rotation of row A by B pi...
Algebraic normal form (ANF) is a way of describing digital circuits made up of AND and XOR gates. The below is an example of an ANF expression which evaluates to true if two or more of it's three inputs are true ($\oplus$ being XOR, implicit multiplication being AND) $x_0x_1 \oplus x_0x_2 \oplus x_1x_2$ When a digital ...
The following statement is considered true: In a DAG, for every vertex $v$, there exists a sink $s$ such that there is a path from $v$ to $s$. However, my counter example to this is a binary search tree. The leaf nodes in a binary tree do not have a path from themselves to a sink. Hence, am I interpreting this sta...