instruction
stringlengths
35
29.1k
For example on modern (32-64 bit CPUs), some sources say that manipulating a 32-bit or 64-bit integer will actually be faster than manipulating an 8-bit or 16-bit integer. This the reason for the (u)int_fastN_t types to be defined in C. Somehow the 8-bit instructions or 16-bit instructions are 'slower.' Other sources s...
Question: I'm looking for a type of connected graph where the number of vertices is $n$ and every pair of vertices is connected by a path with a length less than $k$, where $k$ is a constant. Are there any types of graphs that satisfy this property, apart from complete graphs? If anyone has insights or suggestions on d...
According to Introduction to Algorithms, to show the correctness of a greedy algorithm, we need to show: Greedy Choice Property (i.e. there exists one optimal solution that includes the greedy choice) Optimal Substructure Also, the book states: "Optimal substructure... is argu[ing] that an optimal solution to the sub...
a TM has states and a tape, and a set of symbols that can get put on the tape. when it 'reads' a symbol on the tape, it's current 'state' tells it what to do next; write a new symbol, where to move next, and what state to transition to. i do not understand how 'reading' one set of symbols out of the limited set the UTM...
Given a graph with $n$ vertices and $m$ edges, $m \le {n \choose 2}$, we index the vertices from 1 to $n$, and denote every edge by $(l,r)$ where $1\le l < r \le n$. Find the maximum $k$ such that there is a matching consisting of $k$ edges satisfying $l_1<l_2<...<l_k$ and $r_1<r_2<...<r_k$. This can also be thought of...
I have a graph, and I want to determine the largest possible set (or partition) of nodes such that no two nodes within this set have an edge between them. I am looking for an efficient algorithm to solve this problem. For instance, given the following graph: 1: [2] 2: [1, 3, 5, 6, 4] 3: [2, 4] 4: [3, 5, 6, 2] 5: [4, 2]...
what is the time complexity of: for (i = 1; i <= n; i = 2*i) for (j = 0; j < i; j++) sum++; ? I thought it is O(nlogn) since the otter loop run logn time and the inner loop run i time
I think I have developed a logic circuit which by using combinational logic and flip flops learns to perform the XNOR logic between 2 bits.It is a kind of state machine. Suppose we built a computer made of blocks which use a built in neural network (such as mine logic circuit).Wouldnt that save a lot of memory and let...
The problem I'm arranging a "gift swap" for Christmas with N people involved (N > 2). I want to create an algorithm that generate the pairing gifter->giftee so that: everyone receives a gift no one sends gift to themselves no pair end in a "gift-closed loop" (person 1 sends gift to person 2, person 2 sends gift to per...
What is the reason for this behavior? Usually, in other programming languages, it is either 4/8 bytes, if I am correct.
In layered architecture, the operating system is broken into a number of layers (levels). The bottom layer (layer 0) is the hardware; the highest (layer N) is the user interface. Each layer is implemented only with operations provided by lower-level layers. The layers are selected so that each uses functions (operation...
I am trying to come up with a grammar for arithmetic expressions with the following order of operations: Parentheses Factorials Exponents Functions / unary plus and minus Juxtaposition (implied multiplication) Multiplication and division Addition and subtraction Comma separated expressions Functions should not requir...
Consider this variant of multiset covering problem. Input: a collection of sets $S = \{s_1, s_2, \ldots, s_n\}$ and a universal set $U$, in which $s_k \subseteq U$ and $s_k \neq \emptyset$ for all $k$. The problem is, given an non-empty multiset $M$ containing elements from $U$, we are allowed to pick at most one elem...
I have a list $[1, 2, \ldots, T]$. I want to create a collection of subsets, such that: each element belongs to a small number of subsets each prefix is a union of small number of subsets (these subsets can intersect, but they must exactly cover the prefix) For a given collection of subsets, let $F$ and $G$ be the ma...
I've been trying to design an in-program programming language. Like any programming language, the input source code must go through various stages: Divide the source code into tokens. (Tokenizer) Parse the tokens into an abstract syntax tree (Parser) Either interpret or compile the program etc. With the 2nd step I do...
I was going through the proof that DNF-SAT can be solved in polynomial time. The strategy was to go through all clauses, find a clause that doesn't contain both x and x' for any variable x and then output the satisfying assignment. The input size for this problem is the number of variables (say n). My doubt is that if...
In computational complexity theory, decision problems are typically defined as formal languages, and complexity classes are defined as the sets of the formal languages that can be parsed by machines with limited computational power. https://en.wikipedia.org/wiki/Formal_language Can function problems also be seen as p...
The proof of $HALT$'s undecidability usually goes like this: we assume the existence of a halting decider and incorporate it into a machine $D$ that takes a TM as input, runs it on its own encoding and does the "opposite" action. We then notice $D(D)$ has a contradicting behavior and conclude a halting decider cannot e...
I'm taking a course in graph algorithms. I've just implemented recognition of chordal graphs for an assignment. I'm wondering: what are the use cases for chordal graphs? In other words, what are the chordal graphs one can obtain from studying other computational problems? I'm interested in any problems, no matter how r...
I was trying to understand the proof of MIP is inside NEXP. I was referring to Rutger's university scribes (link). They define MIP as a class with exponential proof, but that is not the definition I am familiar with. It is much easier to understand why that definition would be in NEXP, but I am unclear on how having po...
Suppose I have a list of numbers, say $L$, that grows every day when a new batch of numbers get added to it every night. Right now, say the list is of size $M$, with the daily batch size is of the order $O(n)$ with $M>>n,$ so tomorrow the list will roughly have $M + O(n)$ numbers. Based on this list $L$, I also maintai...
I have been reading a paper on private learning [1]. In the proof of lemma 3.3. they claim that $$ 2\left(\frac{2e n_\text{pub}}{d}\right)^{2d}e^{-\alpha n_\text{pub}/4} $$ is upper bounded by $\beta$ via standard manipulation when $n_\text{pub}=O\left(\frac{d\log(1/\alpha)+\log(1/\beta)}{\alpha}\right)$, $\alpha, \bet...
For this question (154. Find Minimum in Rotated Sorted Array II ), I have a solution: def findMin(self, nums: List[int]) -> int: n = len(nums) left, right = 0, n - 1 while left < right: mid = left + (right - left) // 2 if nums[mid] == nums[right]: ...
Given a boolean function it can always be represented by a family of circuits. Query 1: Is it true that, for any integer $N$ and for all $I_{in}$ such that $I_{in} \leq 2N$ There exists a circuit of size $N$ with $I_{in}$ input bits such that this same logic cannot be created with a smaller circuit. Query 2: We know th...
This is related to my previous question: Do proofs of $HALT$'s undecidability make it clear that it's practically relevant? I made a mistake of leaving something implicit when I asked it; namely that the machine that decides the bounded version of the halting problem should also be bounded. Consider the following state...
I would like to have a formal description on how parametrizing the threshold in the approximation of vertex cover using LP would impact the approximation factor of the problem. The linear programming problem would became: Let $0\leq t\leq 1$ be the threshold (as a parameter) \begin{align} &\min \sum_{v \in V} x_v \\ \t...
I am presented with the following problem: In an array of $n$ sorted numbers and $f(n)$ unsorted numbers where $f(n)=O(\log n)$, find an algorithm to sort the entire array in $O(n)$ time. What I am getting from this is that I should find an algorithm to sort $n + O(\log n)$ numbers in $O(n)$ time. I think the first ste...
So I am covering succinct trees, and in the lecture, it mentioned that "An n-node tree takes 2n pointers or 2n lg n bits (can be easily reduced to n lg n + O(n) bits). First, question is why 2nlgn bits, and how we can reduce it to nlgn?
Consider a graph tree $T$, where we are given $k > 1$ unique pairs of nodes $\{u_1,v_1\}\dots \{u_k,v_k\}$. Let $P_{i}$ denote the unique path on $T$ between $u_i$ and $v_i$. Then, my problem is to efficiently find the intersection of all paths $\bigcap_{i=1}^k P_i$ (in terms of vertices). Note that the intersection i...
In Sheeran, Mary, and Gunnar Stålmarck: A tutorial on Stålmarck’s proof procedure for propositional logic there is an example application of the method to(((p -> p) -> p) -> (p -> q)) -> (((p -> q) -> p) -> q) in which the authors mention that a triplets is "dropped" once it triggered a change in the equivalence relati...
Let P be the language of palindromes over the alphabet Σ = {0, 1}. and let P‘ be the subset of the palindromes with different numbers of 0s and 1s. Is P' context-free? I know that for the language of the set of palindromes with the same numbers of 0s and 1s is not context-free.
This is a somewhat philosophical question, but I would like to know if there is a hard answer. Also, please excuse my likely unconventional terminology here, this is not my field of expertise. Multiply Realizable: can be instantiated in many different ways but still be the same system. Example, command line Chess is st...
I have a list of objects that have a defined measure of distance between them and I'm trying to store them in a data structure such that I can easily and quickly query which of the objects is closest to a key which is not necessarily in the list (like nearest-neighbor). The problem is that these objects aren't points a...
I want to include the distance of a node to the closest obstacle in the cost function, so that the path length is not only minimal, but also not near obstacles. We know that: Dijkstra's algorithm uses cost function $f(n) = g(n)$ whereas A* uses cost function $f(n) = g(n) + h(n)$, with $g(n)$ being the cost of the path ...
I am going through Justin Thaler's book - https://people.cs.georgetown.edu/jthaler/ProofsArgsAndZK.pdf - "Proofs, Arguments, and Zero-Knowledge" He presents the Sumcheck protocol & then claims on Page 41 that the interactive Sumcheck protocol helps solve the SAT problem in better than exponential time. What Sumcheck do...
Here is the proof of a∗ being star-free: $\Sigma* = \bar{\emptyset} $ $ A∗= \overline{Σ∗(Σ∖A)Σ∗} $ Would this be a proof for $a * b$? : $ A∗B= \overline{Σ∗(Σ∖A)Σ∗(Σ∖B)} $ For $(A * B )*$ it seems more complicated if not impossible, but is that proofable?
I have been trying to understand the logical and physical address of some data/instruction the logical address is a address generated by the CPU during a execution cycle.So if I write this code int a = 0; printf("%d",&a); what will be printed is the logical address right?So everything from the OS which is running in t...
Given a weighted directed graph with nonnegative edge weights and a vertex $r$ designated as root, at each step I will do one of the following: Add a new edge to the graph. Remove an edge from the graph. After each step I need to find a minimum weight arborescence rooted at $r$. An arborescence is a spanning tree whe...
Let $T = \{0, 1\} ^ {n}$, i.e. set of all $n$-bit binary strings ($n$-tuples). Let $f : T \to T$ be a function, that maps one string to another. $f$ is bijective, but $f^{-1}$ is hard to compute. It is obviously known, that $f^{k}(t) = t$ for some $k \in \mathbb{N}$, and some $t \in T$, i.e. $f$ has at least one cycle....
So I think the above language is regular. I tried using pumping lemma but pumping up or down, changes the value of w1 but has no relation with w2 or w3. The resulting string after pumping will also be in the language. I think the language w1w2w3 is just similar to {0,1}* . I can create a NFA for {0,1}* , so that is why...
I have this proof for the optimality of the greedy algorithm for the interval scheduling problem in my algorithms class, but I'm struggling to understand it fully, especially starting from the second slide. Does anyone know how to simplify this proof explanation? Thanks!
I'm currently having trouble coming with context free grammar to describe this language. My current intuition is to generate an arbitrary amount of a,b,c's on my string and then whenever the character d is added to my string, I add two instances of either a,b,c to my string. However, I'm struggling in defining the inst...
In the Computer organization and design book, there is an exercise in chapter 1 that stated: Assume that, as the program is parallelized to run over multiple cores, the number of arithmetic and load/store instructions per processor is divided by 0.7 × p (where p is the number of processors) but the number of branch in...
I got this question in an exam and my approach was to use probability. Jarvis's march is better than Graham's scan if h < log(n) So I calculated the probability of a point being on the circle boundary and showed that since probability of being on the circle < log(probability of being inside the circle), Jarvis's march ...
Define that an srlist ("self-referential list") over $X$ consists of a list of elements of $X \sqcup \mathrm{srlist}(X).$ So basically, the items can be primitive values, or further self-referential lists, or a mixture of both. Cycles are allowed. For example, $S = [S]$ is a perfectly good definition of an srlist. Defi...
I'm really stuck here and do not know what to do. So far, I've constructed a DFA and a regular expression that produces the aforementioned set of strings. Namely, the DFA looks like: After a lot of efforts I managed to find a concise regular expression of it, namely: $$ b^*\left( a + (b \; | \; bbb+)\right)^*a^*b^*.$...
As we know, the operating system maintains a data structure for every process called process control block. My question is where this data structure is stored inside the OS ?
The name of a computer should never be bound into an operating system at compile time. Explain why. I don't see a reason why this should not be allowed? Say we have couple of computers all with the name "desertfx" hardcoded in the operating system. What's the downside of this. Not small downside like "unable to chang...
Theorem: "If A is mapping reducible to B and B is recognizable, then A is recognizable." I know that the following statement is FALSE. "If A is mapping reducible to B and A is recognizable, then B is recognizable." But I can't come up with an example to prove that.
Here an interesting graph problem I've recently saw: After a heist in New York City, a group must reach Miami within a set timeframe to catch an escape boat. Their vehicle's GPS shows U.S. routes with city-to-city distances (in term of number of days), but it has a limited fuel range. Refueling requires a full day's st...
What is the minimum length of a string that is accepted by a DFA, shows that the language accepted by that DFA is infinite? I checked this post How to determine if an automata (DFA) accepts an infinite or finite language? and in the answer provided by Rick Decker, he states, "The language accepted by a DFA M with n sta...
Everything I can easily find on applying permutations in-place relies on treating swaps as elementary operations. But in reality, every swap requires at least two moves (to move the first item into the se ond place and the second item into the first place), and we should be able to do better than that when permuting mo...
The FLP paper provides proof in section "4. Initially Dead Processes" that consensus is possible if majority of processes live and no process dies during the consensus protocol. The proof has 4 main steps: Build G graph in way that each process broadcast it's process number and waits for the message from L other proce...
We define Fibonacci words as: $F_0 = a, F_1 = b, F_{n+2} = F_n F_{n+1}$, $a, b$ can be any symbols. How can we find the longest Fibonacci sub-word in a given string in linear time? This question is similar to: Complexity of a naive algorithm for finding the longest Fibonacci substring But I'm in particular interested i...
In NLP, it's common to study the semantic similarity between pieces of text, which can be calculated in a number of ways. Are there any tools, methods, algorithms or processes that can be used to compare the semantic similarity of programs? That is, compare if two programs produce a similar output given similar inputs....
I'm studying the garbage collection code of Alex Aiken's COOL programming language's runtime system. (This is the language used in a relatively famous Stanford Online Compilers course) A major garbage collection is triggered according to a formula described in the runtime system's code: # breakpoint: Point where a ...
We have this recurrence: $$T(n)=10T(\frac{n}{3})+n\sqrt{n}.$$ We can solve it using Master Theorem and say it is $\Theta(n^{\log_3{10}})$. I want to prove it using induction but I don't know the correct and perfect procedure for proving these kinds of problems using induction. I know that $f(n) = \mathcal{O}(g(n))$ if...
Let $A_{n} = (aa|aaa|aaaa|\dots |a^{n-2})(a^{n})^* $ where $n \geq 4$ is some natural,and $A_2 = (a^2)^*, A_3 = (a^3)^*$. Clearly every transition is thus labeled by an $a$. From now on let $A_n$ denote the DFA that accepts the given $n$th regex. Clearly we can model $A_n$ with a DFA that is one big loop with every ...
Given A memory chip that has 4-addresses and each address location holds 8-bits is denoted as (4×8) RAM chip. I want to draw a block-diagram showing the memory address that the first 3 chips will hold if using low and high order interleaving. Does anyone have any similar examples? I am completely lost.
Recently, I am studying grammar in automata. And, I have few information about this subject. I have a grammar with rules $\{S\to ASA, A\to aA, A\to \epsilon\}$. Is it true if I say that $S\to aASA$ by rules $S\to ASA, A\to aA$?
Given a closed polygon defined in the 2D Euclidean plane. My objective is to determine the point within this polygon that is furthest away from its boundary. In other words, I want to find the point where the distance to the polygon's boundary is maximized. More formally, given a polygon $P \in \mathbb{R}^2$, for any p...
Definitions: Let $n \in \mathbb{N}$. If $\alpha$ and $\beta$ are propositional formulas, then we'll call $\alpha$ and $\beta$ independent if neither implies the other, or more formally, if $\lnot (\alpha \rightarrow \beta)$ and $\lnot(\beta \rightarrow \alpha)$ are each satisfiable, perhaps under different variable ass...
Local Binary Pattern is a way to determine a pixel, with a single number by comparing the center pixel with its neigbours. The result will be a binary number. Dos this number have a gaussian distribution?
So my understanding of updating the PC is as follows: Put memory address indicated by PC into memory address register Load the contents of the address pointed to by memory address register into memory data register Place this instruction in the current instruction register. Update PC Decode instruction by passing it t...
Given an $m\times n$ matrix $M_{ij}$ where $M_{ij}\in\{0,1\}$, find the minimal range $[a,b]$ for $1 \leq a \leq b \leq m$ such that each column has at least one value set to $1$ within that window, i.e. $\sum_{i=a}^bM_{ij} \geq 1$ for each $j \in \{1\dots n\}$. I have come across this real-world problem that I have be...
In the Morris Mano's book on Digital Circuits Edition 3, it is defined that r's complement for N=0 is 0 and r-1 complement is not even defined. But lets say r = base = 2 Then 2'd complement of 0, based on his formula is $r^n - N$ where $n$ is number of digits is $2^1 - 0 = 2$. This also makes sense because $(0)'' = (0)...
I'm referencing this Leetcode question: https://leetcode.com/problems/cheapest-flights-within-k-stops/solution/, which asks you to find the length of the shortest path from source to dest using less than or equal to K intermediate nodes. Since the solution is behind a paywall, I've taken screenshots of the solution and...
I try to find the time complexity of following recurrence relation: $$T(n) = 3T(n-2) + O(n)$$ After subtitution,I get: $$T(n)=3^{\frac{n}{2}}T(0)+\sum_{i=0}^{\frac{n}{2}-1}3^iO(n-2i)$$ I wonder if the ans is $O(3^{\frac{n}{2}})$ or $O(3^{\frac{n}{2}} n)$, can someone give a help to determine the ans and give a proof ab...
I am having trouble answering the question below: "Explain why the statement, “The running time of algorithm A is at least O(n^2)”, is content-free." The statement apparently does not give any information on the running time of A but if A = T(n), then T(n) >= O(n^2). Doesn't this at the very least tell us that A runs b...
So I was reading the use complement operation in the digital logic and found, it is used to give additive inverse of the number and subtracting a number (like we do) is difficult for computer. So it adds the negative representation of the number, which is $a - b = a + (-b)$. Now both complement's used to represent the ...
TL;DR: I'm looking for the fastest known algorithm to perform optimal register allocation (optimal in the sense of minimizing the number of spills and reloads) for straight-line programs. Context I am working on an optimized implementation of certain computational kernels. I have a code generator which outputs variants...
This question considers the design of a deterministic self-stabilizing algorithm for vertex coloring in uniform anonymous networks. Uniform anonymous networks do not have distinguished nodes and all nodes run identical programs without access to globally unique node identifiers. The problem vertex coloring requires the...
I am looking for an algorithm similar to the unweighted maximum coverage. However, I have been unable to find a similar algorithm for the weighted version. How should I modify the algorithm above to take into account the weighted version whereby each element is weighted and would the approximation ratio of $(1 - 1/e)$ ...
Microsoft COM, in its object RPC part, had a peculiar mechanism that could be used to prohibit concurrent calls to the same object (or another object serviced by the same event loop) but permit callbacks. When a COM call first crosses an process boundary, it is assigned a unique identifier called a causality ID or a lo...
I read here that the reason that intptr_t and uintptr_t are optional in C is because there might be a platform where pointers are much bigger than any built-in integer type. They specifically cite some platforms with 128-bit pointers. However a 128-bit pointer seems a pointless (no pun intended) waste as a 64-bit point...
My question relates to the conclusions drawn from the Halting Problem. I understand that the Halting Problem proves that no program H(P,i) exists that determines if P(i) halts or not for P in general. However, I think that this does not show that there is no program HN(P,i) that computes the Halting problem for a progr...
We have recurrence $T(n)=2T(\dfrac{n}{2})+\mathcal{O}(n\log{n})$ and assume $T(1)$ is a constant. Find asymptotically tight bounds $\Theta(f(n))$ for $T(n)$. There's something that confuses me. We know $\{n\log{n}, n, \sqrt{n}\}\subset \mathcal{O}(n\log{n})$. So with Master Theorem applied: if $T(n)=2T(\dfrac{n}{2})...
Say you have a segment defined by 2 points $a,b$ and a third point $p$. You want to know the distance from $p$ to the midpoint of the edge. This is very straightforward: $$d = \|\frac{a + b}{2} - p\|$$ I am wondering if it is possible to do this faster. Asymptotically you cannot do better than $O(n)$, where $n$ is the ...
Evaluate WP(a = i + 2; i=i+1, ((a=6)^(i=5)) WP(x=x+1,y=y-1. (xxy>0)) wp(if x > 2 then y = 1 else y = -1,(x > 0)) wp(while n <> 0 do n:=n-1; n = 10) wp(while n = 0 do n:=n-1; n=-10) wp(while n <> 0 do n:=n-1; n=-10)
What is the difference between abstract machines and automata? Looking at the respective Wikipedia pages, only automata has a rigorous (mathematical) definition – abstract machines does not. And I can't find any source that clearly distinguishes the two; many sources leave it unclear as to whether there are any differe...
I've been experimenting with making a binary calculator lately, and I've got the addition and subtraction working. I now want to start making a multiplier, but I have no idea where to even start. I know how to multiply two binary numbers. After all, it's the same as how we used to learn how to multiply. Observe this -5...
I'm intending on writing a program to let my friends make pairwise comparisons of computer generated images, ranking them. I'm mostly doing this for fun and to do some learning and I picked computer generated images because they are easy to come by. And also as I came a cross a thought experiment/problem I funny how go...
Assume that you are given a vector 0b1101001001011001 etc. And you are going to classify it. One can use Support Vector Machine, but is that method good for classifying data that are spare and binary? Assume that you are given a real vector $x$ with dimension $N$. The vector contains only ones and zeros. $x = [0, 1, 0,...
I have a problem as follows. Given a set of sets $U = \{S_1, S_2, … S_N\}$ where $S_i = \{s_1, s_2, ... s_m\}$. Each $s_j \in S_i$ contains a set of distinct elements. I need to pick one $s_j \in S_i$ to form $N$ sets in total such that $|\bigcup_{j=1}^N s_j|$ is minimized. Is there an efficient algorithm to solve this...
Please first take a brief look at my previous question. Here I want to do something similar but for $T(n)=2T(\dfrac{n}{2})+\Theta(n\log{n})$. I know the answer is $T(n)=\Theta(n\log^2{n})$ and I want to prove it using induction. I reached this assuming for $m<n$, we have $T(m)\leq cm\log^2{m}$: $\begin{align*} T(n)=2T(...
I'm writing a program which uses an undirected graph to represent certain social connections, and I'm trying to check whether or not it's contains a specific induced subgraph. Given a dense an undirected graph $G=(V,E)$ where I have a large amount of vertices and $|E|\in O(|V|^2)$ many edges, I would like to check whet...
In the context of adding sparse polynomials, you have two alternative approaches to combine the terms from two separate polynomials. One option is to use the line of code result += self.terms[i:] + other.terms[j:], which efficiently concatenates the remaining terms from both polynomials. The other option is to employ t...
To properly insert a data entry in my database, I have to reach the last box in this diagram. A box represents either a flag or a data structure that participates in determining a single entry. What is the name of this type of diagram? Alternatively, what do you call the procedure of making such a diagram? (cross-poste...
I have been scouting the internet for resource son how to properly implement Ruppert's algorithm and what I ahve found is always lacking in details. The best resources I have so far are these 2: https://sites.google.com/site/samsoninfinite/multivariable-calculus/constrained-delaunay-triangulation https://en.wikipedia...
I have a concept binary search which doesn't split at the midpoint of a list, but at a ratio of 1:2. If we abstract the search function time complexity into $T(n)$ then the function can recurse into two options: $T(n/3) + C(n)$ $T(2n/3) + C(n)$ I am unable to understand how to properly find this time complexity using...
I am given a $N$ x $M$ sized grid and $K$ start points $S = (s_1, s_2, .. s_k)$ where each $s_k = (x_k,y_k)$ representing the position on the grid. I am also given a single endpoint $(x_{end}, y_{end})$. Some cells of the grid contain obstacles which are undesirable to pass through. Given that we have a routine getPath...
I think you can compute the index of the n^{th} ancestor of the node at index i using the formula: $\lfloor i / 2^n \rfloor$ where $n \in \mathbf{Z}^+$. Note that I am assuming that the parent node is at index 1 for this. Left child nodes have even indexes, and right child nodes have odd indexes. Nodes are number from ...
I am going through Justin Thaler's book - https://people.cs.georgetown.edu/jthaler/ProofsArgsAndZK.pdf - "Proofs, Arguments, and Zero-Knowledge" He is describing the Sumcheck Protocol on Page 34 $H = \sum_{b_1 \in \lbrace 0,1 \rbrace} \space \sum_{b_2 \in \lbrace 0,1 \rbrace} \space ... \space \sum_{b_v \in \lbrace 0,1...
Let $L$ be a regular language. Is the language $L_2 = \{ ww | w \in L \}$ context-free? Does it have a name?
Say I have two integers,i and j, which for the sake of example will be 2 and 5, represented by $010_2$ and $101_2$ respectively. I have a third bit set to 0. If $j \geq i$, then this bit should change to 1. I am trying to understand how in principle this is done. My understanding is if you flip the bits in j, and then ...
I am a beginner in the computer science track. I have some problems with the following problems Problem 1: Assume that $NP \ne coNP$. If $L_1, L_2 \in NP$, is $\bar{L_1} \cap L_2$ necessarily in $coNP$. My attempt: I intend to choose $L_1, L_2$ such that $L_1= \emptyset $, $L_2$ is in $NP$ complete. Then $\bar{L_1} \ca...
I've read this scribe that provides a public coin interactive proof for graph non-isomorphism. In the proof, the verifier samples both a pairwise-independent hash function and a target $y$. Then it continues to show bounds for the probability that there's a pre-image of $y$ w.r.t. the hash function that's also inside a...
I have read a lot of times, that models that can parse Dyck-2 are of great importance. It appears that Dyck-2 is interchangeably used like Dyck-N. Afaik the Chomsky-Schützenberger representation theorem states that you can convert and context-free language into a Dyck-N language, using a homomorphism and a intersection...
Given a fully connected undirected graph, is there a quick way for me to know if the graph will remain fully connected if I delete a given edge from the graph? Quick = O(lg V) or something like that. O(V) is not quick. Fully connected = every node is reachable from every other other node in the graph. i.e., given any t...
In multithreading models, we have a two-level model in which we multiplexes many user-level threads to a smaller or equal number of kernel threads but also allows a user-level thread to be bound to a kernel thread. Why we need such a model ? Can someone give an example where we need to use this model?