graphs – What is the difference between Partition and Division?

I will explain this with an example :

Consider a set $S$ which contains a collections of sets with a constant k such that:
$$ S = { {S_1}, {S_2}, {S_3},{S_4},……….{S_k} }$$

In Partition of Set S :

Then we can form the set again by

$ S=S_1cup S_2cup S_3cup S_4………..cup S_k$

$where S_icap S_j = phi$

$and ineq j and i,jin mathcal{N} $

In Division of Set S :

We just have this

$ S=S_1cup S_2cup S_3cup S_4………..cup S_k$

ac.commutative algebra – Rings with terminating division chains of a given length

Let $R$ be an integral domain. Given $a,bin R$, then a division chain for $(a,b)$ is a sequence where we take $r_{-1}=a$, $r_0=b$, and for each $n>0$ we take $r_n=r_{n-1}s_n+r_{n-2}$ for some $s_nin R$. We say that the division chain terminates if $r_n=0$, and it terminates at length $n$ when $r_ineq 0$ for $i<n$.

These concepts, of course, have a lot to do with Euclidean domains, etc…

I ran across the following very interesting fact, proved by Cooke and Weinberger in 1975. Let $K$ be a number field, and let $R=mathscr{O}_{K,S}$, the ring of $S$-integers, where $S$ contains all the infinite places of $K$. Assume (some appropriate version of) GRH. If the unit group of $R$ is infinite, and $aR+bR=R$, then there is a terminating division chain for the pair $(a,b)$ of length $5$. Under some additional restrictions, like $S$ has a non-infinite place, or $K$ has a real embedding, the number $5$ can be lowered to $4$ or $3$. Moreover, they give examples showing that these numbers are best possible in some cases.

I’m interested if the following appears anywhere in the literature: For each $n>5$, there exists an integral domain $R$ such that for any $a,bin R$ with $aR+bR=R$, there is a terminating division chain for the pair $(a,b)$ of length $n$; and there is some pair of comaximal elements in $R$ that doesn’t have a smaller terminating length. The example will have to be somewhat complicated, since it won’t be a ring of integers over a number field.

python – Integer division when implementing Karatsuba’s algorithm

So im currently implementing Karatsuba’s algorithm in python and I cam across a very odd issue. I will provide two sets of code and I believe that they both theoretically do the same thing, but provide different answers (one right and one wrong).
The first set of code:

def decompose(x, n):
    a = int(((x)//10**(n)))
    b = int(x % (10**(n)))
    #print("a", a, "t", "b", b)
    return a, b


def digits(x):
    return len(str(x))

# both x and y are n digit numbers


def multiply(x, y):
    n2 = min(digits(x), digits(y))//2
    if x < 10 or y < 10:
        return x*y
    a, b = decompose(x, n2)
    # print("a", a, "t", "b", b)
    c, d = decompose(y, n2)
    # print("c", c, "t", "d", d)

    if min(digits(a), digits(b), digits(c), digits(d)) == 1:
        ac = int(a*c)
        bd = int(b*d)
        adbc = int((a+b)*(c+d) - a*c - b*d)
    else:
        ac = multiply(a, c)
        bd = multiply(b, d)
        adbc = multiply(a+b, c+d) - ac - bd

    return (10**(2*n2))*ac + (10**(n2))*(adbc) + bd


x, y = 3141592653589793238462643383279502884197169399375105820974944592, 2718281828459045235360287471352662497757247093699959574966967627
print(multiply(x, y))
print(x*y)

Second set of code:

def decompose(x):
    n = digits(x)
    a = int(((x)//10**(n//2)))
    b = int(x % (10**(n//2)))
    #print("a", a, "t", "b", b)
    return a, b


def digits(x):
    return int(len(str(x)))

# both x and y are n digit numbers


def multiply(x, y):
    n2 = min(digits(x), digits(y))//2
    if x < 10 or y < 10:
        return x*y
    a, b = decompose(x)
    # print("a", a, "t", "b", b)
    c, d = decompose(y)
    # print("c", c, "t", "d", d)

    if min(digits(a), digits(b), digits(c), digits(d)) == 1:
        ac = int(a*c)
        bd = int(b*d)
        adbc = int((a+b)*(c+d) - a*c - b*d)
    else:
        ac = multiply(a, c)
        bd = multiply(b, d)
        adbc = multiply(a+b, c+d) - ac - bd

    return (10**(2*n2))*ac + (10**(n2))*(adbc) + bd


x, y = 3141592653589793238462643383279502884197169399375105820974944592, 2718281828459045235360287471352662497757247093699959574966967627
print(multiply(x, y))
print(x*y)

In the first set, I pass n2, where n2 = 32 because x and y have 64 digits. In this case I get the correct answer for the product of x and y. However, in the second set of code, I manually find the number of digits and then divide it by 2 using integer division, which should also give 32 but gives me the wrong answer. Any help would be appreciated.

nt.number theory – Explicit construction of division algebras of degree 3 over Q

In his book Introduction to arithmetic groups, Dave Witte Morris implicitly gives a construction of central division algebras of degree 3 over $mathbb{Q}$ in Proposition 6.7.4. More precisely, let $L/mathbb{Q}$ be a cubic Galois extension and $sigma$ a generator of its Galois group.If $p in mathbb{Z}^+$ and $p neq tsigma(t)sigma^2(t)$ for all $t in L$, then
$$ D=left{ begin{pmatrix}
x & y & z\
psigma(z) & sigma(x) & sigma(y)\
psigma^2(y) & psigma^2(z) & sigma^2(x)
end{pmatrix} :(x,y,z)in L^3 right}
$$

is a division algebra.

On page 145, just before Proposition 6.8.8, Morris claims that it is knows that every division algebra of degree 3 arises in this manner. This should follow from the fact that every central division algebra of degree 3 is cyclic. I could not find this explicit construction in my references (e.g. Pierce – Associative Algebras, though maybe I missed something) and I would like to know if there is a reference or a quick way to see that this exhausts all central division algebras of degree 3 over $mathbb{Q}$.

nt.number theory – Multiplication law in a division algebra of dimension 9 over a non-archimedean local field

Let $k$ be a non-archimedean local field, for example, a $p$-adic field (a finite extension of the filed ${Bbb Q}_p$ of $p$-adic numbers).
It is well known that there is a canonical isomorphism
$${rm inv}colon {rm Br},koversetsimlongrightarrow{Bbb Q}/{Bbb Z}.$$
Let $D$ denote the division algebra of dimension 9 over $k$ with invariant $frac13$.

Question. How can one explicitly describe the multiplication law in $D$ ?

Motivation. From the multiplication law in $D$, I can obtain the commutation law in the 8-dimensional Lie algebra ${frak g}={frak sl}(1,D)$.
From $frak g$, I can obtain an explicit trilinear alternating form on the 8-dimensional space $frak g$:
$$(x,y,z)mapsto ((x,y),z)quadtext{for },x,y,zin{frak g},$$
where $(,,,)$ denotes the Killing form.
This is a $k$-form of a generic alternating trilinear form on $k^8$.

División por zero en php

tengo una función que me calcula los likes y dislikes, para luego hacer un for con estrellas para el tema del rating. Pero tengo el problema de que si tiene 0 likes y 0 dislikes, luego al dividir salta un error de división por cero:

Esta es mi función:

function devolverRating($likes,$dislikes){
  return round($likes/($likes+$dislikes)*5);
}

Y el for con el que pinto las estrellas en función del rating que me devuelve, pero hay veces que a lo mejor me devuelve un 2 y me pinta las 5 estrellas o que tiene de rating 0 y me pinta 5 estrellas, sin contar lo de división por cero:

for($i=0;$i<5;$i++){
  if($i<=$rating){
   echo "<i class='fas fa-star'></i>";
  }
  else{
   echo"<i class='far fa-star'></i>";
  } 
}

python – Complex division for imaginary part

I seek a fast implementation of (X / Y).imag, where X, Y are complex 2D arrays (PyTorch tensors already on GPU). My approach is to move computation to a CUDA kernel via cupy, interfacing C and Python. Requirements:

  • Faster than (X / Y).imag
  • Using same or less memory than (X / Y).imag
  • Output is same as (X / Y).imag within float precision
  • #includes must be supported by CuPy (which is largely limited to standard CUDA libraries afaik)

My attempt:

extern "C" __global__
void cdiv_imag(float x(240)(240000)(2), float y(240)(240000)(2),
               float out(240)(240000)) {
    int i = blockIdx.x * blockDim.x + threadIdx.x;
    int j = blockIdx.y * blockDim.y + threadIdx.y;
    if (i >= 240 || j >= 240000)
        return;

    float A = x(i)(j)(0);
    float B = x(i)(j)(1);
    float C = y(i)(j)(0);
    float D = y(i)(j)(1);

    out(i)(j) = (B*C - A*D) / (C*C + D*D);
}

This uses half the memory, since X / Y yields a temp array of reals & imaginary, but is still ultimately slower per my benchmarks on GTX 1070:

0.02320581099999992 sec (avg of 1000 runs)
0.01924530900000002 sec (avg of 1000 runs)

Full code; Win 10 x64, Python 3.7.9, CuPy 8.3.0, PyTorch 1.8.0.

Socks5 Proxy Service Cheap Socks5


SOCKS Proxy List by Tisocks.net
If you Need Socks5 , Please visit service and add fund via PM , BTC WMZ , LTC . Thanks all!!
Add fund : https://tisocks.net/addfund
Check socks5 Online here : https://checksocks5.com
LIVE | 142.93.245.246:30588 | 0.36 | SOCKS5 | Unknown | 1012 | Des Capital B.V. | Unknown | Checked at https://tisocks.net
LIVE | 188.166.104.152:49940 | 0.4 | SOCKS5 | Unknown | Unknown | | Unknown | Checked at https://tisocks.net
LIVE | 95.179.164.28:8018 | 0.79 | SOCKS5 | Unknown | Unknown | tor-exit-5.zbau.f3netze.de | Unknown | Checked at https://tisocks.net
LIVE | 43.224.10.46:6667 | 4.84 | SOCKS5 | Gujarat | 380001 | gtpl hariom world vision | India | Checked at https://tisocks.net
LIVE | 95.179.163.1:8020 | 0.84 | SOCKS5 | Unknown | Unknown | 31173 Services AB | Unknown | Checked at https://tisocks.net
LIVE | 50.62.35.16:54803 | 3.73 | SOCKS5 | Unknown | Unknown | ip-50-62-35-16.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 103.109.58.81:5678 | 2.05 | SOCKS5 | Dhaka Division | Unknown | Skynet Chowmuhani | Bangladesh | Checked at https://tisocks.net
LIVE | 50.62.35.16:21138 | 1.47 | SOCKS5 | Unknown | Unknown | ip-50-62-35-16.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 217.12.201.190:9210 | 0.63 | SOCKS5 | Unknown | Unknown | 31173 Services AB | Unknown | Checked at https://tisocks.net
LIVE | 95.216.17.77:18700 | 3.46 | SOCKS5 | Uusimaa | 00100 | router | Finland | Checked at https://tisocks.net
LIVE | 188.166.104.152:4975 | 4.75 | SOCKS5 | North Holland | 1098 | DigitalOcean, LLC | Netherlands | Checked at https://tisocks.net
LIVE | 64.118.86.44:56557 | 1.18 | SOCKS5 | Unknown | Unknown | drive110.123servers.com | United States | Checked at https://tisocks.net
LIVE | 51.77.147.68:9095 | 0.41 | SOCKS5 | Unknown | Unknown | tor35.quintex.com | Unknown | Checked at https://tisocks.net
LIVE | 45.79.207.110:9200 | 1.1 | SOCKS5 | Unknown | Unknown | cust-147.keff.org | Unknown | Checked at https://tisocks.net
LIVE | 64.118.84.49:56102 | 0.79 | SOCKS5 | Unknown | Unknown | drive110.123servers.com | United States | Checked at https://tisocks.net


tisocks
Reviewed by tisocks on
.
[Tisocks.net] – Socks5 Proxy Service Cheap Socks5
SOCKS Proxy List by Tisocks.net
If you Need Socks5 , Please visit service and add fund via PM , BTC WMZ , LTC . Thanks all!!
Add fund : https://tisocks.net/addfund
Check socks5 Online here : https://checksocks5.com
LIVE | 142.93.245.246:30588 | 0.36 | SOCKS5 | Unknown | 1012 | Des Capital B.V. | Unknown | Checked at https://tisocks.net
LIVE | 188.166.104.152:49940 | 0.4 | SOCKS5 | Unknown | Unknown | | Unknown | Checked at https://tisocks.net
LIVE | 95.179.164.28:8018 | 0.79 | SOCKS5 |

Rating: 5



.