instruction
stringlengths
0
29.8k
⌀
I am taking my first network class and I came across a question I just cant wrap my head around. We have an external machine that has a public IP address from using NAT, the external machine want to contact one other machines but using their local IP address no the one public provided by NAT. How can initiate the co...
How to resolv this NAT problem?
|computer-networks|
I am taking my first network class and I came across a question I just cant wrap my head around. We have an external machine that has a public IP address from using NAT, the external machine want to contact one other machines but using their local IP address no the one public provided by NAT. How can initiate the co...
|computer-networks|security|
Although not an assignment, just out of curiosity; I am trying to compare a two cases 1. A scenario where I pick a tree out of the set of possible binary search trees on the keys $1,2,\ldots,n$, with each tree equally likely (with a probability say, $p(T)$) and\\ 2. Generating a binary search tree by inserting the nu...
Randomly generated binary search trees case comparison
|binary-trees|search-trees|binary-search-trees|
1. Any tree structure of size $n$ is a possible structure for a binary search tree on $\{1, …, n\}$. Since there are $C_n = \frac{1}{n+1}\binom{2n}{n}$ such trees (see [Catalan numbers](https://en.wikipedia.org/wiki/Catalan_number), if $T$ is a BST, we get $p(T) = p_n=\frac{n+1}{\binom{2n}{n}}$. For example, $p_3 = \f...
The whole idea of the ad-absurdum proofs is that the world we prove something in is based on logic and is logically consistent. This is kind of an axiom (a given). If you now show that some assumption leads to a contradiction, you show that either one is true: - The assumption is false. - The way you use to s...
Another way to look at it is, by reaching a contradiction you've shown that one of your assumptions is incorrect. This is usually the assumption stated at the start of the proof, but it could also be another, unstated assumption. _"The system I'm working in is inconsistent"_ is one possibility _(albeit unlikely)_. T...
Implication == All of science is built on the principle of implication: truth can only imply truth. It cannot imply falsehood. False can imply anything, therefore you cannot rely upon it to derive truth. By starting with a set of truths, one can derive more truths without a falsehood sneaking in. This is logically ne...
I know that if I have $n$ different values in an array of size $m$ (where $m>n$) under simple uniform hashing, the average probability of the total number of collisions is: $$\sum_{i=1}^{n-1}\frac{i}{m}=\frac{n(n-1)}{2m}$$ Since it is not possible, to avoid collision with a hash as the goal is just to minimize coll...
Simple Uniform hashing with chances of no collision
|hash-tables|hashing|
null
null
null
In condition 1 : CPU can execute only either the child() or wait() which evr is invoked . In 2 and 3 , during an interrupt generally CPU can either serve the interrupt while keeping the current process on postponed ( or wait ) or can continue with current process and later serve the interrupt. in 4 , CPU has no opt...
In condition 1 : CPU can execute only either the child() or wait() which ever is invoked . For 2 and 3 , during an interrupt generally CPU can either serve the interrupt while keeping the current process on postponed ( or wait ) or can continue with current process and later serve the interrupt. in 4 , CPU has no o...
[This post answers major part of your question][1]. > Does that mean the CPU becomes idle? It can, but the chances are extremely slim. The goal of scheduling is to maximise cpu utilization, in modern operating systems, the cpu is almost never "idle"(different from [idle][2]). However for arguments sake, the cpu ...
{"Voters":[{"Id":146718,"DisplayName":"rudr"}]}
{"Voters":[{"Id":146718,"DisplayName":"rudr"}]}
null
null
I understand your question the following way: > There are multiple computers behind a NAT. The NAT has a global IP address while the computers behind the NAT only have a local IP address. > > A computer in the Internet wants to send some data to a computer behind the NAT. > > How is this possible? First of al...
I understand your question the following way: > There are multiple computers behind a NAT. The NAT has a global IP address while the computers behind the NAT only have a local IP address. > > A computer in the Internet wants to send some data to a computer behind the NAT. > > How is this possible? First of al...
I've encountered many examples which its format is like: a^n b^n. For this I understand that w = 2n and is pretty straightforward, but what happens in my case? Is w = 1 + 2n? And in this case would |xy| be a subword of just a, or a subword of a b^n? I'm struggling to pump the language in any meaningful way to get my...
I understand your question the following way: > There are multiple computers behind a NAT. The NAT has a global IP address while the computers behind the NAT only have a local IP address. > > A computer in the Internet wants to send some data to a computer behind the NAT. > > How is this possible? First of al...
Q1. Choice means that there are several candidate processes that could be wakened. So some arbitration rule must exist. Q2. No, situations 1 and 4 do arise all the time and it is obviously out of question not to "support" them. Non-preemptive schemes are poor because they let processes monopolize the processor. ...
Q1. Choice means that there are several candidate processes that could be wakened. So some arbitration rule must exist. Q2. No, situations 1 and 4 do arise all the time and it is obviously out of question not to "support" them. Non-preemptive schemes are poor because they let processes monopolize the processor. ...
In the normal case of a [chord ring][1] the big O notation of the look up is O(logn) because of long haul pointers of the Finger Table (or Routing Table). In this question what if the Finger Table has a limit of size 3 (1) I would like to ask the Big O notation of the look up AND (2) I would like to know the form...
Chord Ring with limited table size of 3
|algorithms|distributed-systems|hash-tables|peer-to-peer|
null
A CTL* formula `EFG p` is equivalent to mu-calculus formula `Y.(<>Y | νZ.(<>Z & p))`. In this formula, the alternation depths are `ad(Y)=ad(Z)=1`. Is there a CTL* formula that translates into `YνZ(...)` with alternating depths 2,1 for Y,Z? And a similar question:<br/> Is there a CTL* formula that translates into `...
Is there a CTL* formula that translates into mu-calculus formula Y.νZ.(...) with alternating depths 2,1 for Y,Z?
|computation-tree-logic|mu-calculus|
1. Any tree structure of size $n$ is a possible structure for a binary search tree on $\{1, …, n\}$. Since there are $C_n = \frac{1}{n+1}\binom{2n}{n}$ such trees (see [Catalan numbers](https://en.wikipedia.org/wiki/Catalan_number)), if $T$ is a BST, we get $p(T) = p_n=\frac{n+1}{\binom{2n}{n}}$. For example, $p_3 = \...
null
I'm looking for an algorithm that is closely related to the [2-dimensional nesting problem][1] (also known as lay planning, bin packing, and the cutting stock problem). The main differences between this and normal nesting are: * A fixed number of elements to be placed * The elements cannot rotate * The elements m...
null
Another way to look at it is, by reaching a contradiction you've shown that one of your assumptions is incorrect. This is usually the assumption stated at the start of the proof, but it could also be another, unstated assumption. _"The system I'm working in is inconsistent"_ is one possibility _(albeit unlikely)_. T...
**Executable:** Sat *prog* <br/> **Definition:** The exit status of "Sat *prog*" is 1 iff there exists an instance <br/> *prog arg* which runs in P-time and the exit status is 1. <br/> <br/> From the definition, Sat computes a ℕℙ problem. <br/> If ℕℙ=ℙ, then, an executable f exists that "Sat f" should run in P-t...
About a ℙ≠ℕℙ proof
|np-complete|complexity-classes|
**Executable:** Sat *prog* <br/> **Definition:** The exit status of "Sat *prog*" is 1 iff there exists an instance <br/> *prog arg* which runs in P-time and the exit status is 1. <br/> <br/> From the definition, Sat computes a ℕℙ problem. <br/> If ℕℙ=ℙ, then, an executable f exists that "Sat f" should run in P-t...
**Executable:** Sat *prog* <br/> **Definition:** The exit status of "Sat *prog*" is 1 iff there exists an instance <br/> *prog arg* which runs in P-time and the exit status is 1. <br/> <br/> From the definition, Sat computes a ℕℙ problem. <br/> If ℕℙ=ℙ, then, an executable f exists that "Sat f" should run in P-t...
null
I know that if I have $n$ different values in an array of size $m$ (where $m>n$) under simple uniform hashing, the average probability of the total number of collisions is: $$\sum_{i=1}^{n-1}\frac{i}{m}=\frac{n(n-1)}{2m}$$ Since it is known that the probability of no collision is $$1\cdot\left(1-\frac{1}{m}\right...
|hash|hash-tables|hashing|
null
You want to prove the following: $$\prod\limits_{i=0}^{n-1}\left(1-\frac{i}m\right)\leqslant \left(1-\frac{n-1}{2m}\right)^n$$ One way to prove it is to prove: $$\left(1-\frac{i}m\right)\left(1-\frac{n-1-i}m\right)\leqslant\left(1-\frac{n-1}{2m}\right)^2$$ for all $i\in \{1, …, \left\lfloor\frac{n-1}2\right\rfloo...
null
A CTL* formula `EFG p` is equivalent to mu-calculus formula `Y.(<>Y | νZ.(<>Z & p))`. In this formula, the alternation depths are `ad(Y)=ad(Z)=1`. Is there a CTL* formula that translates into `YνZ(...)` with alternation depths 2,1 for Y,Z? And a similar question:<br/> Is there a CTL* formula that translates into `...
Is there a CTL* formula that translates into mu-calculus formula Y.νZ.(...) with alternation depths 2,1 for Y,Z?
This is a NP statement, so there is a zero-knowledge proof for it (as there is a zero-knowledge proof for every NP statement). The exact form of the proof will depend on which signature algorithm is chosen, and what is already known to Bob (e.g., does Bob know the message? can it be disclosed to him safely?). ----...
What you showed is that no such program "Sat" can exist. Note that the complexity didn't matter here, since the argument still holds valid for any other complexity classes (a sign of this is that the analysis does not make a reference to the complexity of "Sat"). In fact, this is a well known fact! One can reduce th...
null
The Church-Turing thesis proves that there is no algorithm (or program) $H$ that says whether a program $P$ written in a language, say $C$, on an input $I$ outputs the sentence `Hello World` or not. This is his proof, visit Hopcraft and etc. `introduction to automata theory languages and computation`, chapter 8. The...
null
null
I'm looking for an algorithm that is closely related to the [2-dimensional nesting problem][1] (also known as lay planning, bin packing, and the cutting stock problem). The main differences between this and normal nesting are: * A fixed number of elements to be placed * The elements cannot rotate * The elements m...
|linear-programming|packing|
null
In the book "Automata, Formal Languages, and Automata" written by Dr. Emre Sermutlu and in page 153, it is stated that the following grammars are not in CNF: > G1 : <br> S --> TT | a <br> T --> ST | b <br> > G2 : <br> S --> TT | a <br> T --> a | b | € The definition of Chomsky Normal Form is defined here: (http...
Why the Following Grammars Are Not in CNF
|context-free|formal-grammars|
You seem to be confused about what it means for a program to run in polynomial time. It expresses a relationship between the size of the input offered to the program and its execution time on that input, namely, that that time is bounded by a polynomial in the input size. > The exit status of "Sat prog" is 1 iff the...
In the book "Automata, Formal Languages, and Automata" written by Dr. Emre Sermutlu and in page 153, it is stated that the following grammars are not in CNF: > $G_1$ : <br> $S\rightarrow TT\mid a$ <br> $T\rightarrow ST \mid b$ <br> > > $G_2$ : <br> $S \rightarrow TT \mid a$ <br> $T \rightarrow a \mid b \mid \vare...
|context-free|formal-grammars|normal-forms|
For the first one, the transition $T\rightarrow ST$ is not allowed, because in a transition $A\rightarrow BC$, neither $B$ nor $C$ must be the start symbol. For the second one, the transition $T\rightarrow \varepsilon$ is not allowed, because only the start symbol ($S$) can be replaced with $\varepsilon$.
For what example would Maekawa's algorithm allow out of timestamp order access to the critical section. It is mentioned that ordering is not satisfied in Maekawa's algorithm. But in what scenario would this be true? From my understanding, we will always have the queue at each process that follows FIFO and will ensur...
For what example would Maekawa's algorithm allow out of timestamp order access to the critical section
|distributed-systems|mutual-exclusion|critical-section|
null
(0011)*(^ + 0)(1+10+101+10011)* Regex: {0,1} :Every pair of adjacent zeros appears before any pair of adjacent ones('^'->null).
(0011)* (^ + 0)(1+10+101+10011)* Regex: {0,1} :Every pair of adjacent zeros appears before any pair of adjacent ones('^'->null).
(0011)* ((^ + 0)(1+101+10011)(1+01+0011))*(^+0) Regex: {0,1} :Every pair of adjacent zeros appears before any pair of adjacent ones('^'->null).
null
O(log(N^2/3)) Because you will divide the chord into 3 equal parts and so does every node's neighbour. Thus, Maximally you will go through 2/3's of the chord for each node. Draw 2-3 nodes on a circular diagram and it will be easier to understand.
I'm trying to prove that $f \in \mathcal{O}(\lfloor f \rfloor)$ given that $\forall m \in \mathbb{N}, f(m) \geq 1$ Here's what I've thought of so far, we can set C = 10 and k = 1 and somehow prove that this would eventually dominate the function? Not sure how I can prove this without a concrete function defined fo...
How can it be formally proved that $f \in O(⌊f ⌋)$
|runtime-analysis|proof-techniques|big-o-notation|
Let R be a TM that decides ATM. Build a new machine G = "On input x: For i = 1,2,... Simulate M for i steps. If M halted before the i'th step, accept. Otherwise, continue to next i iteration." Now run R on input (G,42). if R accets, accept. if R rejects, re...
$$f\in[1,2)\implies \frac{\lfloor f\rfloor}f=\frac1f>\frac12\implies \lfloor f\rfloor>\frac12f$$ and more generally $$f\ge1\implies\lfloor f\rfloor>\frac12f.$$
I trying to learn about virtual memory at the moment and one of the explanations I've look at has a diagram like below. You can see that 32 bit virtual addresses are used so the virtual address space is 2^32 addresses and the computer must have RAM of a capacity 4GiB or smaller. You can see the physical addresses in th...
How many bits are needed to reference physical vs virtual addresses?
|computer-architecture|memory-management|memory-hardware|virtual-memory|paging|
I am reading the book "Automata, Formal Languages, and Automata" written by Dr. Emre Sermutlu and in page 153, it is stated that the following grammars are not in CNF: > $G_1$ : <br> $S\rightarrow TT\mid a$ <br> $T\rightarrow ST \mid b$ <br> > > $G_2$ : <br> $S \rightarrow TT \mid a$ <br> $T \rightarrow a \mid b ...
Intel built 32 bit chips a while ago that could access more than 4 GByte of RAM. You have two addresses for data: You have a logical address that your software cares about, and you may have a physical address with actual RAM (or video memory, or hardware that can be controlled with memory read/write instructions). ...
A key benefit of virtual memory is a complete decoupling between the virtual address space and the physical locations. The virtual memory manager maps the virtual addresses of a process to some physical space that can reside on disk or in RAM (as pages), and that mapping changes dynamically. The RAM space of the machin...
null
Your processor typically uses 8 bytes to store the information for 4,096 byte table. So 1 GB of page table could handle 512 GB of address space. Yes, there is a limit where it might be impossible to use all of the theoretically possible address space. But then many processors now have 64 bit of address space (256 billi...
A key benefit of virtual memory is a complete decoupling between the virtual address space and the physical locations. The virtual memory manager maps the virtual addresses of a process to some physical space that can reside on disk or in RAM (as pages), and that mapping changes dynamically. The RAM space of the machin...
You haven't specified what entries are put in the finger table. The answer depends on that, so the question is not answerable. A lookup might take as many as $O(N)$ steps if you choose the finger table poorly (e.g., you select the next 3 nodes in the circle), or might take as few as $O(N^{1/4})$ steps if you choose t...
$$\{f\}<1\le\lfloor f\rfloor\implies f=\lfloor f\rfloor+\{f\}<2\lfloor f\rfloor.$$
$$\{f\}<1\le\lfloor f\rfloor\implies f=\lfloor f\rfloor+\{f\}<2\lfloor f\rfloor.$$ Together with $\lfloor f\rfloor\le f$, that makes $f=\Theta(\lfloor f\rfloor)$. [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/LLz8p.png
$$\{f\}<1\le\lfloor f\rfloor\implies f=\lfloor f\rfloor+\{f\}<2\lfloor f\rfloor.$$ ---------- Together with $2\lfloor f\rfloor\le2f$, that makes $f=\Theta(\lfloor f\rfloor)$. [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/LLz8p.png
null