instruction
stringlengths
0
29.8k
⌀
{"Voters":[{"Id":19799,"DisplayName":"qwr"}]}
Suppose the 48-bit signed integers are drawn uniformly randomly from $[-2^{47}, 2^{47}-1]$. To overflow, there must be at least $n = 2^{63}/2^{47} = 2^{16}$ integers drawn, so $n$ is large enough for the [Central Limit Theorem to apply](https://math.stackexchange.com/questions/357442/distribution-of-sum-of-discrete-uni...
I'm reading about page tables in Patterson & Hennessy's [_Computer Organization and Design RISC-V Edition_](https://www.amazon.com/Computer-Organization-Design-RISC-V-Architecture/dp/0128122757). The excessive memory usage of a single-level page table is noted w/: > with a single level page table for a 48-bit addres...
Why can't a single-level page table grow dynamically?
|paging|
Suppose the 48-bit signed integers are drawn uniformly randomly from $[-2^{47}, 2^{47}-1]$. To overflow, there must be at least $n = 2^{63}/2^{47} = 2^{16}$ integers drawn, so $n$ is large enough for the [Central Limit Theorem to apply](https://stats.stackexchange.com/questions/317852/is-applying-the-clt-to-the-sum-of-...
The [Green500][1] is a biannual ranking of the world's most energy-efficient supercomputers. It was first measured in millions of floating-point operations per second per watt of power consumed, and is now measured in billions of FLOPs/watt instead due to advances in distributed computing. For instance, the Simons Foun...
I have exam next week about automata theory, languages and computation. I struggle with reductions (Undecidability). For example for this two problems, and need to check first if the language is recursive, RE but no recursive or NOT-RE. After that to prove with reduction, okay for proving is easy I think, but to check ...
Before doing reductions, it is good to have some intuitions about decidability: that helps to find which reduction can succeed. First, none of those two languages is recursive, because [Rice's theorem](https://en.wikipedia.org/wiki/Rice%27s_theorem) states that nontrivial semantic properties are undecidable. Seco...
Before doing reductions, it is good to have some intuitions about decidability: that helps to find which reduction can succeed. First, none of those two languages is recursive, because [Rice's theorem](https://en.wikipedia.org/wiki/Rice%27s_theorem) states that nontrivial semantic properties are undecidable. Seco...
Firstly, this is clearly a joke algorithm, AKA selection sort with extra steps -- you find the maximal element by splitting the array into halves, sorting them, and taking the maximum of the biggest element in each half. Your recurrence relation is correct. Since only constant work is done at each branch, the time s...
Firstly, this is clearly a joke algorithm, AKA selection sort with extra steps -- you find the maximal element by splitting the array into halves, sorting them, and taking the maximum of the biggest element in each half. Your recurrence relation is correct. Since only constant work is done at each branch, the time s...
I'm trying to prove the correctness of an interpreter for a simple extension of untyped lambda-calculus with De Bruijn indices. The interpreter is *bounded*, i.e. in order to ensure its finiteness it has an additional parameter $n \in \mathbb N$ that decreases with each recursive call. The function returns $\bot$ when ...
thanks for your help. This is my first question, so I am very sorry for the bad presentation of the question. I am studying computer science and this is the question I have been asked for the course of Theory of computation and complexity **Edited question** 1.For every two languages $A,B∈PSPACE$, there ...
PSPACE and Polynomial reduction
A process can receive two kinds of signals classified based on the source and reason. - Synchronous are the one that are generated by illegal memory access or division by zero. - Asynchronous are the one that are generated by another process like SIGKILL and etc. Quoting from the 9e OSC Book by Prof. Galvin, top...
null
null
Our problem is similar to [this](https://cs.stackexchange.com/questions/93959/optimal-flow-in-a-network-with-non-constant-edges-weights), but it details various approaches we can make. The problem also was formulated [operation research](https://or.stackexchange.com/questions/11603/numerical-infeasibility-for-movi...
In the **ABC-partition problem**, there are three sets $A, B, C$ with $m$ positive integers in each. The goal is to construct $m$ triplets with the same sum $T$, each of which contains exactly one integer from $A, B$ and $C$. The problem "feels" NP-hard, but I could not find a proof for this. I could only find reduc...
Is the ABC-partition problem NP-hard?
In the **ABC-partition problem**, there are three sets $A, B, C$ with $m$ positive integers in each. The sum of all integers is $m T$. The goal is to construct $m$ triplets with the same sum $T$, each of which contains exactly one integer from $A, B$ and $C$. The problem "feels" NP-hard, but I could not find a proof...
This seems to be the [Numerical 3D matching problem](https://en.wikipedia.org/wiki/Numerical_3-dimensional_matching). Wikipedia cites a proof of NP-Hardness by Garey and Johnson (problem SP16).
I am trying to design best solution for a chat application based on LLM model which has set of functions and based on user input can retrieve the information. I would like to ask you for some proposals regarding this because I am running of ideas. I've implemented PoC application where I am storing in mongo db colle...
Best solution architecture for: Intelligent chat to retrieve information from specific sources
|machine-learning|computer-architecture|artificial-intelligence|
How can I estimate the probability that the sum $S_n$ of $n$ uniform random 48-bit signed integers overflows a 64-bit signed integer? Edit: the overflow can occur at any step, not only on the final result. Since this is a normal distribution, I guess that the cumulative sums more or less oscillate around zero, an...
Suppose the 48-bit signed integers are drawn uniformly randomly from $[-2^{47}, 2^{47}-1]$. To overflow, there must be at least $n = 2^{63}/2^{47} = 2^{16}$ integers drawn, so $n$ is large enough for the [Central Limit Theorem to apply](https://stats.stackexchange.com/questions/317852/is-applying-the-clt-to-the-sum-of-...
Problem Statement: We want to update(only decrease allowed) elements of array to obtain a new array which is in same ratio as ratio array. Example lets say you have quantity vector as [20, 50, 20] and ratio vector as [1, 2, 1]. Now you update quantity array to [20,40,20], so you have quantity elements in same rati...
Decreasing quantity elements in quantities array to get it to be in same ratio as array of ratios
|algorithms|mathematical-programming|
null
null
null
null
null
[Hoeffding's inequality][1] gives non-asymptotic probability bounds. If $X$ is on $[a,b]$ and $C>b-a$ then $$P\left(\left|\sum_i X_i - \sum_i E[X_i]\right|>t\right)\leq 2\exp\left(\frac{-2t^2}{nC^2} \right).$$ This gives qualitatively similar bounds to the CLT that @qwr used, but slightly more rigorous since the ...
null
I am working on a project and came across the following problem I have to solve. Imagine we have a time series data `Ts` which is an array of pair, say each element is `(Xi, Yi)`. The length of this array is constant `N` but is updated regularly. Each update consists of two steps, 1. We remove `Ts[0]` 2. Add a n...
How to optimize algorithm to solve the following time series problem?
|algorithms|data-structures|optimization|discrete-mathematics|time-series-analysis|
Suppose a complete beginner(in the field of data analysis/data science), which is my case indeed, decided to make a project for his/her resume. These are the following skills he have learnt: Python(pandas, NumPy, seaborn/matplotlib)- 2 years of experience(intermediate level) 2)SQL- 1 month experience have knowle...
How do one decide topic for first data analysis project?
|python|
With Lamport clocks, each node keeps its own counter. Before sending a message, a node increments its counter by one: `LC(A)=LC(A)+1`, and sends `{1,msg}` to B. Upon receiving a message, B updates its counter using the following formula: `LC(B)=max(LC(B),LC(msg))+1=max(0,1)+1=2`. This works as expected when A and B ...
What happens when two different nodes have the same Lamport clock ID
|distributed-systems|partial-order|clocks|ordering|
I was referring to the textbook Artificial Intelligence: A modern approach 3rd by Stuart Russell and Peter Norvig. what to prove about the general "graph search": (Here I assume "within a factor of b" means multiplier $b$ instead of [addition $\pm b$][1] based on the complexity context. So if time complexity is $O(b...
Suppose an absolute beginner (in the field of data analysis/data science), which is indeed my case, has decided to create a project for his/her resume. These are the <!--following--> skills he has learnt: - Python(Pandas, NumPy, Seaborn/Matplotlib) - 2&nbsp;years of experience (intermediate level) - SQL - 1&nbsp...
null
null
While reading the example given in [1]., I couldn't understand how the authors set up the logic to compute the weakest preconditions (*wp*) in their car example in section 4.2. The dynamics of the problem are given by - $x' = x + 0.1v$ $v' = v + 0.1a + \epsilon$ I don't see the authors working on the form...
I am working on a project and came across the following problem I have to solve. Imagine we have a time series data `Ts` which is an array of pair, say each element is `(Xi, Yi)`. The length of this array is constant `N` but is updated regularly. Each update consists of two steps, 1. We remove `Ts[0]` 2. Add a n...
This is also given as Exercise 9.3 in Shai Shalev-Shwartz and Shai Ben-David's *Understanding Machine Learning: From Theory to Algorithms*, where they provide the following hint: choose the dimension to be $d=m$ and the points to be $x_i=e_i$ (the canonical vectors $(e_i)_j=\mathbf 1_{[j=i]}$). Observe that all $x_...
Given an alphabet $\Sigma$ of $n$ elements, whenever there is some order $\leq$ over the elements of $\Sigma$, we define $s^{\leq} : \Sigma^{*} \mapsto \Sigma^{*}$ as \begin{align*} s^{\leq} \left( (a_n)^m \right) &= (a_1)^{m + 1} & m \geq 0\\ s^{\leq} \left( \alpha a_i (a_n)^{m} \right) &= \alpha a_{i+...
Finding program that enumerates a language using Von Neumman's computability paradigm
|formal-languages|formal-grammars|logic|enumeration|
I am trying to convert the below context-free grammar into Chomsky Normal Form, specifically, removing rules that have three or more variables or terminators. $$S \to A a B \;\vert\; B b C$$ $$A \to A a B \;\vert\; B b C$$ $$B \to B b C$$ $$C \to x$$ I am trying to understand if the right converstion would resul...
Repeated rules with more than three symbols for conversion to Chomskys Normal Form
|formal-languages|automata|context-free|formal-grammars|chomsky-hierarchy|
Do there exist infinitely many languages that are RE-complete?
null
Yes, if the same strings are generated the productions can be shared. The "standard" conversion does not consider such "coincidences". Note that your final result does not yet satisfy Chomsky normal form. Productions are either of the form $A\to BC$ or $A\to a$. That means that one cannot produce a nonterminal and a...
|machine-learning|programming-languages|formal-methods|hoare-logic|
null
I was reading [this post](https://crypto.stackexchange.com/questions/58220/how-to-generate-hard-subset-sum-instances "How to generate hard subset sum instances"), and in it I learned how to make difficult instances of the SubSet Sum Problem. There the guy who responded to the post says that it is necessary to have ...
Why does this approach not work on the SubSet Sum Problem?
|complexity-theory|polynomial-time-reductions|subset-sum|
I was referring to the textbook Artificial Intelligence: A modern approach 3rd by Stuart Russell and Peter Norvig. what to prove about the general "graph search": (Here I assume "within a factor of b" means multiplier $b$ instead of [addition $\pm b$][1] based on the complexity context. So if time complexity is $O(b...
We know that Linear context-free languages are not closed under complement, so I encountered a challenge in finding an example to show the above theorem. I think the complement of $L={a^nb^n}$ is not linear, but I can't prove it.
The complement of a particular language
|formal-languages|context-free|linear-languages|
null
The complement of the language $L = \{a^nb^n : n \in \mathbb{N}\}$ should actually be linear, if I'm not mistaken. Take some string $x \notin L$ over the alphabet $\Sigma = \{a, b\}$, since $L \subseteq a^*b^*$ one of three cases must be true: - $x \notin a^*b^*$, or - $x = a^nb^m \in a^*b^*$ and $n > m$, or - $...
The complement of the language $L = \{a^nb^n : n \in \mathbb{N}\}$ should actually be linear, if I'm not mistaken. Take some string $x \notin L$ over the alphabet $\Sigma = \{a, b\}$, since $L \subseteq a^*b^*$ one of three cases must be true: - $x \notin a^*b^*$, or - $x = a^nb^m \in a^*b^*$ and $n > m$, or - $...
I am trying to understand this question from Prof. Onur Mutlu's [assignment solution][1] on virtual memory. I am reproducing the problem and solution followed by my question: Problem: A dedicated computer architecture student (like you) bought a 32-bit processor that implements paging-based virtual memory using a...
relationship between page table size, patge table entry and pagt table base register alignment
|computer-architecture|virtual-memory|
In the Bellman-Ford algorithm's relaxation part, I can't seem to understand why we need to use (d[v] = min{ d[v], d[u] + c(u, v) }), specifically the (c(u,v)) part. This uses the original weight. Why can't it use the least cost(shortest) between (u,v) instead of c(u,v)?
Bellman Ford algorithm rela
|algorithms|
Bellman Ford algorithm relaxation
In the Bellman-Ford algorithm's relaxation part, I can't seem to understand why we need to use (d[v] = min{ d[v], d[u] + c(u, v) }), the (c(u,v)) part. This uses the original weight. Why can't it use the least cost(shortest) between (u,v) instead of c(u,v)?
While reading the example given in [1]., I couldn't understand how the authors set up the logic to compute the weakest preconditions (*wp*) in their car example in section 4.2. The dynamics of the problem are given by - $x' = x + 0.1v$ $v' = v + 0.1a + \epsilon$ I don't see the authors working on the form...
null
null
Let $H(n)$ be the average height of a BST with nodes from ${1,...,n}$. I think that $$H(n) = \frac{1}{n}\sum_{i = 0}^{n-1}\left[\text{max}(H(i), H(n-1 -i)) + 1\right]$$ But I don't know how to prove this is correct. Can anyone help me or explain why this is incorrect? Note proving it directly seems hard because y...
Recursive formula for height of BST
|data-structures|trees|binary-trees|binary-search-trees|
The formula is wrong. Indeed, we can find by hand that $H(1) = 0$, $H(2) = 1$ and $H(3) = \frac95$ ($5$ different trees, $4$ of them being of height $2$, the last of height $1$). But: $$\frac13\sum\limits_{i=0}^2(\max(H(i), H(2 - 1 - i)) + 1) = \frac13(H(2) + H(1) + H(2) + 3) = \frac53\neq\frac95$$ The reason...
null
The complement of the language $L = \{a^nb^n : n \in \mathbb{N}\}$ should actually be linear, if I'm not mistaken. Take some string $x \notin L$ over the alphabet $\Sigma = \{a, b\}$, since $L \subseteq a^*b^*$ one of three cases must be true: - $x \notin a^*b^*$, or - $x = a^nb^m \in a^*b^*$ and $n > m$, or - $...
The complement of the language $L = \{a^nb^n : n \in \mathbb{N}\}$ should actually be linear, if I'm not mistaken. Take some string $x \notin L$ over the alphabet $\Sigma = \{a, b\}$, since $L \subseteq a^*b^*$ one of three cases must be true: - $x \notin a^*b^*$, or - $x = a^nb^m \in a^*b^*$ and $n > m$, or - $...
You must strengthen the theorem to be proved by induction. In the $e_1e_2$ case, the current induction hypothesis just tells you that $e_1$ reduces to a closure, but not anything more about how the enclosed expression reduces. Another hint that something is missing is that in the $\lambda x . e$ case (and the closure c...
In addition to the upper bound in https://cs.stackexchange.com/a/96451/12322 Lower bound $\displaystyle E(Y_n)= \frac{2}{n} \sum^n_{i=0}(E[2\max(Y_{i−1},Y_{n−i})] + 1) \geq \frac{2}{n} \sum^{n-1}_{i=0} E[Y_{i}]$
null
Adding some "trivial" but useful observations to @AnthonyLabarre's answer: * The number of necessary swaps **can't be less than 0.5** times the number of elements which are not in their "sorted position" (the position they occupy after sorting). * The number of necessary swaps **can't be more than 1** times the nu...
null
The post is old but I think someone might find this piece of information helpful: in *Kleinberg and Tardos* (I have a translated version so the numbering might be different) in chapter 10.4 there is a proof of the following statement >Every non-redundant tree decomposition of a graph with $n$ vertices has at most $n...
null