## Is there a way to do Partial Fractions which don’t work with apart function?

Is there a way to solve partial fractions on mathematica, other than ‘apart’ function. Maybe an add on function?

## How to stop fractions from simplifying, when inside a Manipulate[] [duplicate]

I want to stop this fraction from simplifying inside a Manipulate[]

Manipulate[            x/y            , {x, 7, 10, 1}            , {y, 7, 10, 1} ] 

i.e. when this program is evaluated the fraction should look like:

$$\frac{7}{7}$$

I have tried many different wrapping configurations of ToString, Hold, HoldForm:

but to no avail:

Surprisingly mathematica will even simplify a fraction containing strings to $$1$$

## given array of fractions find if graction can be formed

given array of fraction, numerator & denominator arrays.
check if a fraction can be expressed using given fractions.

input –

n = [a,b,c,d]
d = [x,a,d,b]

check if x/d can be evaluated

output – yes

## Circuit depth of computing the continued fractions of a rational number

If you want to convert a rational number into its continued fraction, what is the circuit depth of this process, in terms of the total number of bits of input?

I was reading through some notes which mentioned that the work being done while computing the continued fraction is basically the same as the work being done while computing a GCD. Are their circuit depths similar?

## Egyptian fractions in Python

Here’s my code for the Egyptian fraction written in Python. I need your feedback if there is any room for improvement.

def eg_fr(n, d):     ls = []     ls_str = []     fraction = n / d     total = 0     for i in range(1, 1000):         ls.append((1/i, str(1) + '/' + str(i)))     for i in ls:         while i[0] + total <= fraction:             ls_str.append(i[1])             total += i[0]             if total >= fraction:                 break     print('%s/%s = ' % (n, d), end='')     for i in range(len(ls_str) - 1):         print('', ls_str[i], '+ ', end='')     print(ls_str[-1], end='')     return ls_str   if __name__ == '__main__':     eg_fr(7, 133) 

## Homology of linear groups over integral domains and their field of fractions

Let $$A$$ be a noetherian integral domain of finite Krull dimension with the field of fractions of $$F$$. Consider the natural injections $$i_n:GL_n(A)\hookrightarrow GL_{n+1}(A)$$, $$j_n:GL_n(F)\hookrightarrow GL_{n+1}(F)$$, $$\varphi_n:GL_n(A)\hookrightarrow GL_n(F)$$ and similarly $$\varphi_{n+1}$$. Let $$x\in H_k(BGL_{n+1}(A))$$ and assume that $$\varphi_{*(n+1)}(x)$$ lies in the image of $$j_{*n}$$ i.e. for some $$y\in H_k(BGL_n(F))$$, $$j_{*n}(y)=\varphi_{*(n+1)}(x)$$. Does that imply that $$y$$ is in the image of $$\varphi_{*n}$$?

## Continued fractions with every element 1 or 2

Let’s say we have continued fractions of the form $$[a_0, a_1, a_2,…]: a_0 \in \mathbb{Z}, a_i \in \{1,2\}.$$ Is there any way to determine a number, say $$x\in [0,1],$$ that cannot be written in the form described above?

## How to select best k fractions out of n fractions (k

For example, given 4 fractions $$\frac{4}{2}$$, $$\frac{2}{3}$$, $$\frac{1}{2}$$, $$\frac{10}{20}$$, I have to select 3 fractions out of these 4 so that the value of $$\frac{\text{numerator sum}}{\text{denominator sum}}$$ is maximized. As in this case, selecting $$\frac{4}{2}$$, $$\frac{2}{3}$$, $$\frac{1}{2}$$ will result in $$\frac{4+2+1}{2+3+2}$$ = 1 which is maximized.

How can I select $$k$$ fractions which will always result in the maximum $$\frac{\text{numerator sum}}{\text{denominator sum}}$$ value?

Edit:

• Attempt 1: Sorting fractions in descending order. This passes a few test cases but that it’s. This can also be proven by example that it is not the optimal solution. Let’s say we have a list of 3 fractions sorted in descending order, $$\frac{1}{2}$$, $$\frac{20}{59}$$, $$\frac{1}{3}$$ and $$k = 2$$. The optimal solutions is $$\frac{1+1}{2+3}$$, not $$\frac{1+20}{2+59}$$.

## Egyptian fractions of the form 2/n with smallest sum of denominators

I realize this has been asked for the more general $$p/q$$ case; however, I am restricting myself to the case of $$p=2$$ and $$q$$ is odd (see the Rhind Mathematical Papyrus 2/n table).

It’s easy to show that any fraction of the form $$2/(2N+1)$$ can be written as the fraction

$$\frac{2}{2N+1} = \frac{1}{N+1} + \frac{1}{(N+1)(2N+1)}$$

which appears to be optimal for prime numbers. However, I was trying to express the problem as an optimization problem (KKT) and am not getting a solution. I’m not sure if I’m formulating it correctly, or something else. The problem can be formulated as

$$f(x) = x_1 + x_2$$ $$g(x) = \frac{2}{2N+1} – \frac{1}{x_1} – \frac{1}{x_2} = 0$$ $$h(x) = [ 2-x_1 , x_1+1 – x_2 ]^T \le 0$$

This means the Lagrangian is

$$\mathcal{L} = x_1 + x_2 – \lambda \left[ (2N+1)(x_1+x_2)-2x_1x_2 \right] – \mu_1(2-x_1)-\mu_2(x_1+1 – x_2)$$

So the KKT conditions are

$$\frac{\partial \mathcal{L}}{\partial x_1} = \lambda (2 n – 2 x_2 + 1 )+1+\mu_1-\mu_2=0$$

$$\frac{\partial \mathcal{L}}{\partial x_2} = \lambda (2 n-2 x_1+1) + 1 +\mu_2 = 0$$

$$\mu_1 ( 2 – x_1 ) =0$$

$$\mu_1 \ge 0$$

$$\mu_2 ( x_1 + 1 – x_2 ) =0$$

$$\mu_2 \ge 0$$

$$\frac{2}{2N+1} =\frac{1}{x_1} + \frac{1}{x_2} = 0$$

Solving for $$x_1$$ and $$x_2$$

$$\begin{array}{c|c|c|c|c} \hline \mu_1>0 & \mu_2>0 & x_1=2 & x_2=3 & \mathrm{violates\ constraint} \ \hline \mu_1>0 & \mu_2=0 & x_1=2 & x_2=6 & \mathrm{correct} \ \hline \mu_1=0 & \mu_2>0 & x_1=n + \frac{1}{2} \sqrt{2+4n+4n^2} & x_2=x_1+1 & \mathrm{not\ a\ solution\ over\ the\ natural\ numbers} \ \hline \mu_1=0 & \mu_2=0 & x_1=2n+1 & x_2=x_1 & \mathrm{violates\ constraint} \ \hline \end{array}$$

So is this problem not suited for KKT? Have I done something incorrect?

Any guidance would be appreciated

## Local behaviour of fractions with bounded denominator / Was it already studied?

My question is about a point process that I feel it would be natural to study, but that I have never heard of… This point process would represent, morally, the local behaviour of the set of fractions with bounded (but large) denominator, when seen from a random point. I would like to know if any of you has already heard about such a process…?

Let me give a formal definition of the point process that I would like to know more about. For $$n$$ a (large) integer, denote by $$\mathbf{Q}_n$$ the set of fractions with denominator $$\leq n$$: $$\mathbf{Q}_n := \bigl\{x \in \mathbf{R} \,\big|\, (\exists q \in \{1, \ldots, n\}) \ q x \in \mathbf{Z}\bigr\}\text.$$ So, morally this is the set of “simple enough” fractions having a bounded denominator.

You can look at $$\mathbf{Q}_n$$ from a (uniform) random point of the real line (note that $$\mathbf{Q}_n$$ is invariant by $$1$$-translations, so the notion of “uniform random point on the line” makes sense in this context): namely, for $$X_0$$ a real random variable uniform on $$[0, 1)$$, consider the point process defined by $$\mathfrak{N}_n := n^2 \times (\mathbf{Q}_n – X_0)$$ (here I see $$\mathfrak{N}_n$$ as a random variable whose values are discrete subsets of $$\mathbf{R}$$), whose law is completely well-defined. The factor $$n^2$$ in the definition of the process $$\mathfrak{N}_n$$ means that we are “zooming” on our set of simple fractions in such a way that the density of points remains of order $$O(1)$$ regardless of the value of $$n$$ (as it is a classical result that the density of points in $$\mathbf{Q}_n$$ is equivalent to $$3 n^2 / \pi^2$$ when $$n \to \infty$$).

Now, I have strong reasons to expect that when $$n \to \infty$$, the law of the process $$\mathfrak{N}_n$$ converges (for some appropriate topology on discrets subsets of $$\mathbf{R}$$) to the law of a limiting point process $$\mathfrak{N}_\infty$$. This process would somehow represent the local behaviour of the set of not-too-complicated fractions, when seen from a random point of the line. Note that one funny property of this point process in that two distinct points of it must always be apart from a distance $$\geq 1$$! (because, for $$p / q$$ and $$p’ / q’$$ two dinstinct fractions of $$\mathbf{Q}_n$$, $$\left|p / q – p’ / q’\right| \geq 1 / q q’ \geq n^{-2}$$).

My question is: has anyone studied this process? If yes, how is this process called, and could you give me references on it?…