Skip to content
Name for integer "q...

Notifications
Clear all

Name for integer "quotient" rounded up (ceiling) instead of down (floor), and the "remainder" we'd subtract?

1 Posts
1 Users
0 Likes
0 Views
Illustrious Member
Joined: 4 months ago
Posts: 57367
Topic starter

If $$168$$ cookies (dividend) are shared between $$17$$ people (divisor), that's almost $$10$$ cookies each but we're $$2$$ cookies "short"; alternatively we have slightly more than $$9$$ cookies each (quotient) with $$15$$ "spare" cookies (remainder). Optimists have fifteen extra cookies to share out; pessimists need to distribute two losses; mathematicians will note that $$15 + 2 = 17$$.

What do we call the rounded up answer to the division, $$10 = lceil 168 div 17 rceil$$? It's the smallest whole number that, when multiplied by the divisor, gives a product at least as large as the dividend. It is analogous to the standard integer quotient we get from rounding down, $$9 = lfloor 168 div 17 rfloor$$, which is the largest whole number that gives a product less than or equal to the dividend.

Similarly what's the name for the complement of the remainder ($$2 = 17 - 15$$) we'd need to subtract to write the equation $$168 = 17 times 10 - 2$$, analogous to the $$text{dividend} = text{divisor} times text{quotient} + text{remainder}$$ equation, $$168 = 17 times 9 + 15$$?

This concept is clearly well-defined; given dividend $$a$$ and divisor $$n in mathbb{N}$$, we can choose a unique $$x, y in mathbb{N}cup{0}$$ such that $$a = nx - y$$ instead of the usual $$a = nq + r$$, e.g. by specifying $$0 leq y lt n$$. (In fact the two different "remainders" $$r$$ and $$y$$ don't always sum to the divisor: they are both zero if the division can be performed exactly. But that's why I'd like a name for this "anti-remainder": otherwise I'd just call it e.g. the "complement of the remainder" or "complementary remainder".)

Disclaimer: I'm using "ceiling" and "floor" loosely here, and only writing in the context of division of positive integers by positive integers: here's a great answer exploring how conventions on rounding and even the sign of the remainder differ between programming languages particularly when negative integers are involved with corresponding Wikipedia article that talks about "negative remainders". But I'm particularly interested in appropriate terminology. Certainly this is something people use all the time - did anyone read the first line of my question and immediately think "well $$17 times 9 = 153$$ and $$168 - 153 = 15$$ so it's nine cookies each and fifteen remainder"?

Related terminology questions: is there a name for the complement of the modulo operation? and is there an official name for "divisor minus remainder"?

Problem to define a key and the associated value of a table from a variable

I’m sorry for the imprecision of my question but I couldn’t find a way to describe my problem correctly.

I created a new package and in the “lua” part, I use two classes, one for points and the other for lines. Two tables `z` and `L` are associated to these classes. In the first one are stored the points and in the second the lines.
For example for points `z.a = point: new (1,2)`. This defines the point `a` whose affix (complex number) is `1+2i`. In the table here the key is `a` and the value `1+2i` . In the same way if `a` and `b` are defined, I can define a line with for example `L.a__b = line: new (z.a,z.b)`. This is a bit more complicated because tables are stored in a table.

I may be wrong but I think my problem can be translated like this:
If x=a and y=b then how do I define a function that gives me `L.a__b = line: new (z.a,z.b)`, `L.x__y` etc. gives nothing.

The package can be found on this page tkz-elements. You will find in the archive the code of tkz-elements a readme and a small documentation and several examples. All this is still experimental!

Here is the more complete code:

``````documentclass{article}
usepackage{tkz-euclide}
usepackage{tkz-elements}
begin{document}
parindent = 0pt

begin{elements}
z.a = point: new (0, -1)
z.b = point: new (4, 2)
z.c = point: new (1, 2)
z.d = point: new (-1, 3)
L.a__b = line: new (z.a,z.b)
L.a__d = line: new (z.a,z.d)
L.d__b = line: new (z.d,z.b)
-- L.c__d = line: new (z.c,z.d)
-- z.i =intersection_ll_ (L.a__b,L.c__d)

va = tostring(c__d)
for i in pairs(L) do
if i == va then
else
_, _,ft, sd = string.find( "c__d", "(.+)__(.+)" )
L["ft__sd"] = line: new (z.ft,z.sd)  -- wrong !
--  tex.print(ft..'__'..sd)   -- to show the values of ft and sd
break
end
end

-- the next code is here to show the different values
for i,k in pairs(L) do
tex.print(tostring(k)..";"..tostring(i))
for u,v in pairs(k)
do
tex.print(tostring(v))
end
tex.print('\\')
end
end{elements}

begin{tikzpicture}
tkzGetNodes

tkzDrawLines[add=1 and 1](a,b c,d)
tkzDrawPoints(a,b,c,d)
tkzLabelPoints(a,b,c,d)
end{tikzpicture}
end{document}
``````

Some explanations: 4 points are defined then 4 lines but I commented the last one `L.c__d` to show my problem.
The code allows to get the intersection of two lines if they are defined. I would like to find a test to know if one of them is not defined and in this case create it automatically.
Having commented `L.c__d = line: new (z.c,z.d)` this line is no longer defined. So I parse the expression representing this line with the `string.find` function and get `ft` and `sd` which point to `c` and `d`.

Question: How can I use `ft` and `sd` to get `L.c__d = line: new (z.c,z.d)`?

AppImage .desktop file not showing on dock

I’m on Ubuntu 22.04.2 LTS.
I have two `.desktop` executable files for the Keet AppImage in my `.local/share/applications` folder.
I didn´t create them they have been created by the app I suppose.
However they are both not showing on my dock (I have Dash to Dock installed).
All the others AppImages are showing.
If I run them form the terminal with `gtk-launch keet` or `gtk-launch appimagekit_8d9752879526b100ab8504901c9bd0a4-Keet` the app starts succesfully.
Removing one of the two files and restarting the system does not fix the issue.
What can be the reason and how can I solve the issue?
The content of the files is:

``````[Desktop Entry]
Name=Keet
Exec=/home/giovanni/snap/Keet_7695b52a4e54b87f751f760f6ab65255.AppImage %U
Terminal=false
Icon=keet
Type=Application
StartupWMClass=Keet
X-AppImage-Version=1.0.1
Comment=Keet
MimeType=x-scheme-handler/punch;x-scheme-handler/holepunch
``````

and :

``````[Desktop Entry]
Name=Keet
Exec=/home/giovanni/snap/Keet_7695b52a4e54b87f751f760f6ab65255.AppImage
Icon=appimagekit_8d9752879526b100ab8504901c9bd0a4_keet
Type=Application
Categories=Network;AudioVideo;

TryExec=/home/giovanni/snap/Keet_7695b52a4e54b87f751f760f6ab65255.AppImage
X-AppImage-Old-Icon=keet
X-AppImage-Identifier=8d9752879526b100ab8504901c9bd0a4
Actions=Remove;
X-AppImageLauncher-Version=2.2.0 (git commit 0f91801), built on 2020-09-29 21:36:15 UTC
``````

How to install Ubuntu server 20.04 with UEFI (non gui)

I have done this before but the current ISO installer does not match my notes from previous installs.

ISO: ubuntu-20.04.5-live-server-amd64 using non gui installer via idrac.

get to disk partitioning
select disk

the only option is to add a GPT partition

and no option to format as ESP.

How should I create a /boot partition for UEFI?

All the stuff I turned up in searching used the GUI install where the dialogue was different.

Elements of the coset G/H, where G=\$GL^+\$(2) and H=SO(2)

In this paper1 in section 2, a method to write the elements of the coset of G/H is provided for GL(4), but I am interested in $$GL^+$$(2).

My matrix representation of $$mathfrak{gl}(2)$$ is

$$begin{bmatrix} a+x& -b+y\ b+y & a-x end{bmatrix}$$

My matrix representation of $$mathfrak{so}(2)$$ is

$$begin{bmatrix} 0& -b\ b & 0 end{bmatrix}$$

Reading the paper, it states that the element g of G can be decomposed as g=$$gamma$$h, where

$$gamma = exp left( begin{bmatrix} a+x& +y\ y & a-x end{bmatrix} right) in G/H$$

and where

$$h = exp left( begin{bmatrix} 0& -b\ b & 0 end{bmatrix} right) in H$$

Is this correct, or no?

I am suspicious of the argument, because to me

$$exp left( begin{bmatrix} a+x& y\ y & a-x end{bmatrix} right)exp left( begin{bmatrix} 0& -b\ b & 0 end{bmatrix} right) neq exp left( begin{bmatrix} a+x& -b+y\ b+y & a-x end{bmatrix} right)$$

Thus, $$gamma h$$ does not appear to realize all elements of $$G$$. Or do we not care about some missing elements for cosets?

Project not working after moving to WSL directory

My dockerized Lumen project had slow response time so according to advices I moved my project from my classic path C:Mgrlumen_laravellumenmysql to wsl.localhostUbuntuhomesamolumenmysql, then created Z: drive so I can open terminal in that location and run “docker-compose up -d”.
In previous adress it was working.I didnt change any code and have got error. Any advices? Thank you.

error in docker

2023-03-21 22:49:00 AH00112: Warning: DocumentRoot [/var/www/html/public] does not exist

According to docker inspect Mount info it exists

/VAR/WWW/HTML Z:homesamolumenmysql

docker-compose.yml

``````version: '3.8'

services:

mysqldb:
image: mysql:5.7
container_name : mysqldb
restart: always
volumes:
- \${DOCKER_MYSQL_VOLUME:-/opt/db_data}:/var/lib/mysql
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: diplomovka
MYSQL_ROOT_PASSWORD: 1234

phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin
environment:
PMA_HOST: mysqldb
DB_READ_HOST: mysqldb
ports:
- "3400:80"
depends_on:
- mysqldb

app:
container_name: Lumen
build:
context: .
dockerfile: Dockerfile
volumes:
- ./:/var/www/html
restart: \${DOCKER_RESTART_POLICY:-always}
ports:
- "9000:80"
working_dir: /var/www/html
environment:
MYSQL_HOST: mysqldb
MYSQL_USER: root
MYSQL_PASSWORD: 1234
MYSQL_PORT: 3306
``````

vhost.conf

``````<VirtualHost *:80>
ServerName localhost

DocumentRoot /var/www/html/public

<Directory "/var/www/html">
AllowOverride all
Require all granted
</Directory>

ErrorLog \${APACHE_LOG_DIR}/error.log
CustomLog \${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
``````

Dockerfile

``````FROM php:7.4.19-apache

WORKDIR /var/www/html

RUN apt-get update && apt-get install -y
zlib1g-dev
libzip-dev
libonig-dev
curl

&& docker-php-ext-install pdo_mysql
&& docker-php-ext-install mysqli
&& docker-php-source delete

COPY ./vhost.conf /etc/apache2/sites-available/000-default.conf

COPY ./ ./

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN chown -R www-data:www-data /var/www/html
&& a2enmod rewrite

RUN cd /var/www/html && composer install && php artisan key:generate
``````

Using Root Test to see whether \$sum_{n=1}^{infty}frac{n^{n+frac{1}{n}}}{(n+frac{1}{n})^{n}}\$ converges

This exercise specifically requires that we use the root test to determine whether the series converges or not.

All I’ve done so far is get the sequence in this form:
$$sqrt[n] frac{n^{n+frac{1}{n}}}{(n+frac{1}{n})^{n}} = sqrt frac{n^{(1+n^{-2})n}}{(n+frac{1}{n})^n}=frac{n^{1+n^{-2}}}{n+frac{1}{n}} = frac{n^{frac{n^2+1}{n^{2}}}}{n^{2}+1}$$

But, I’m not even sure if I’m on the right track here. Any guidance is appreciated.

Edit: I showed my effort. I didn’t tell anyone to solve it for me. Not sure why the downvotes..

curious GoldenRatio identity

I would like to verify the following identity but I don’t know how mathematics says that it is equal to numerically.
$$prod _{k=0}^{infty } sqrt{frac{phi ^{2^{-k-1}} left(phi ^{2^{-k}}+1right)}{phi ^{2^{1-k}}+1}}=frac{sqrt{2}}{sqrt[4]{5}}$$

induction on summation with factorial

Let $$P(k, n) : exists b_{1}, b_{2}, …, b_{n} in mathbb{N}, (forall i in mathbb{Z^+}, 1 leq i leq k implies b_{i} leq i) land(k = sum limits _{i=1}^n b_{i} cdot i!)$$ where $$k in mathbb{N}$$ and $$n in mathbb{Z^+}$$.

How to show with induction $$forall k in mathbb{N}, forall n in mathbb{N^+}, k < (n+1)! implies P(k,n)$$

Any suggestions and hints would be appreciated.

How to repair an XFS volume in a RAID array

In a data server, we have a RAID array of 5 disks joined in an XFS filesystem. The dmesg output is:

``````IPv6: ADDRCONF(NETDEV_CHANGE): enp134s0f0: link becomes ready
XFS (sda2): Mounting V5 Filesystem
XFS (sda2): failed to locate log tail
XFS (sda2): log mount/recovery failed: error -74
XFS (sda2): log mount failed
clocksource: timekeeping watchdog on CPU21: hpet retried 2 times before success
clocksource: timekeeping watchdog on CPU22: hpet retried 2 times before success
clocksource: timekeeping watchdog on CPU5: hpet retried 2 times before success
clocksource: timekeeping watchdog on CPU23: hpet retried 2 times before success
clocksource: timekeeping watchdog on CPU4: hpet retried 3 times before success
clocksource: timekeeping watchdog on CPU19: hpet retried 2 times before success
clocksource: timekeeping watchdog on CPU10: hpet retried 2 times before success
clocksource: timekeeping watchdog on CPU6: hpet retried 2 times before success
clocksource: timekeeping watchdog on CPU0: hpet retried 2 times before success
usb 1-2.5: USB disconnect, device number 5
``````

and the output of xfs_repair /dev/sda2 is:

``````bad hash table for directory inode 66571995395 (no data entry): rebuilding
rebuilding directory inode 66571995395
entry ".." in directory inode 66571995396 points to non-existent inode 60129542274
bad hash table for directory inode 66571995396 (no data entry): rebuilding
rebuilding directory inode 66571995396
entry ".." in directory inode 66571995397 points to non-existent inode 4294967426
bad hash table for directory inode 66571995397 (no data entry): rebuilding
rebuilding directory inode 66571995397
Metadata corruption detected at 0x5566785ce66f, inode 0xf80000910 dinode

fatal error -- couldn't map inode 66571995408, err = 117
``````

I will appreciate any help or hint.

Trying to Understand How Multiple Percent Symbols are Processed Around Variables

``````@echo off

set var1=hello
set var2=var1
set var3=var2
echo on

echo 2. %%var3%%
echo.
echo 3. %%%var3%%%
``````

I have `echo on` so I can try to make better sense of the batch processing, though it really seems to be limited in parsing info.

When echoing a variable, are the inner/center parts processed first?

I’m trying to understand how multiple percents signs are exactly parsed when surrounding a variable.

I know every other percent symbol cancels out the previous one, but there must be more to it because I can never seem to get the result I think I should.

The logic seems to hold true when I do a simple echo using double percents %%, like so:

`echo %%var3%%`

`Result: %var3%`

The outer percent symbol is canceled, and it outputs with single percents: `%var3%`

So, when I use 3 %%%, I would think it would return `%%var3%%`, since ONLY the middle percent of the 3 %%% should be canceled, yet the result is: `%var2%`

So, obviously I’m not fully understanding how multiple percents surrounding a variable are processed.

When using 2 %%, does the 2nd % cancel the entire process of reading the value from `var3`?
Because how else could the result be `%var3%` rather than `%var2%`?

And b/c the extra % when using 3 %%%, it re-allows the process of reading the value from `var3`, which can now extract the value from `var3`, which is `var2`, and then simply apply the remaining single %s around it to give the final result: `%var2%`

Am I close or still grasping at straws? Any clarification or suggestions would be appreciated.

Share: