partitions: partition of the set pool so that each set in a group has a unique element

Suppose I have a bag (or multiple set) of games $ S = {s_1, s_2, dots, s_n } $ and $ emptyset notin S $. I want to partition $ S $ in set groups so that within each group each set has at least one element that is not found in any other set in that group. Formally, the criteria for a group $ G = {g_1, g_2, dots } subseteq S $ is:

$$ forall i: left (g_i setminus bigcup_ {j neq i} g_j ; neq ; emptyset right) $$

Partition $ P = { {s_1 }, {s_2 }, dots } $ It always meets this requirement, so there is always a valid solution. But what is the smallest number of groups needed? Is this problem feasible or NP-complete?

Another formulation of this problem is to divide a multiple set of integers into groups so that each integer has a bit set in its binary expansion that no other integer in its group has established.

Performance – Optimize Python code for the Euler Project Problem 78: Coin Partitions

I was working on this problem and made a code that got the answer in an average of 11 seconds. How can I optimize this code to work in less than 5 seconds?

import time
def pentagonal(n):
    return int(n*(3*n - 1) / 2)
z = ()
for i in range(-1, -300, -1):
    z.append(pentagonal(abs(i)))
    z.append(pentagonal(i))

part = (1, 1, 2)
start = time.time()
for i in range(3, 100000):
    print(i)
    n = 0
    t = 0
    while i >= z(n):
        if n % 4 <= 1:
            t += part(i - z(n))
        elif n % 4 >= 2:
            t -= part(i- z(n))
        n += 1
    if t % 1000000 == 0:
        print("FOUND. N is:", i)
        break
    part.append(t)
print(time.time()-start)

combinatorics – entire partitions and permutations

They give me the pair $ (n, lambda) $ where $ lambda $ it is a partition of $ n $ such that 6 is not part of $ lambda $. They tell me to leave $ lambda ^ * $ represent the partition of $ n $ conjugate $ lambda $. Now we are assuming $ (n, lambda) $ It has the following property: there is a $ theta in S_n $, the set of permutations of $ {1,2, points, n } $and $ theta ^ * in S_n $ such that both $ theta, theta ^ * $ have order 6, $ theta $ It has a cycle structure $ lambda $and $ theta ^ * $ It has a cycle structure $ theta ^ * $. I am asked to determine the possible values ​​of n. Not sure where to start here. Any help would be great.

ssh – How to mount LVM partitions in sysrcd

I have a dedicated Ubuntu 18.04 server, I tried to change the SSH port (the SSH port was 63058 before), I edited / etc / ssh / sshd_config and added # to the 63058 port line.

However, after restarting the server, I cannot access the server with 22 or 63058, I think I forgot to allow 22 ports in the UFW Fireware.

As it is an unmanaged wholesaleinternet server, they only provide sysrcd to handle the problem, I reload it on sysrcd and try to mount the partitions on my hard drive, but it doesn't work.

root@sysresccd /root % lsblk -f
NAME        FSTYPE   LABEL UUID                                   MOUNTPOINT
sda
├─sda1
├─sda2
├─sda5      ext2           8b9e94c0-06f3-4c63-9288-4eeb4991e341
└─sda6      LVM2_mem       onKTmN-cX7h-6p2z-3Pib-xKiy-hCwr-FXOqSf
  ├─vg-root ext4           74e59bb4-a5df-4bb5-b1ac-4c0813d1385b
  ├─vg-tmp  ext4           45a2d5a2-60e9-4e9e-adf9-5d2874fefbbc
  └─vg-swap swap           c1c0a0c6-a81c-4f9c-b9fd-7b796a7121f6
loop0       squashfs                                              /livemnt/squas
root@sysresccd /root %

root@sysresccd /root % mount /dev/sda6 /mnt
mount: unknown filesystem type 'LVM2_member'

root@sysresccd /root % lvdisplay
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  --- Logical volume ---
  LV Path                /dev/vg/root
  LV Name                root
  VG Name                vg
  LV UUID                B4YUxD-fQiD-sopx-kGl7-kh9H-tRBx-P3e5pB
  LV Write Access        read/write
  LV Creation host, time s147887, 2019-07-01 10:20:35 +0000
  LV Status              available
  # open                 0
  LV Size                445.13 GiB
  Current LE             113953
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Path                /dev/vg/tmp
  LV Name                tmp
  VG Name                vg
  LV UUID                86L32t-B98f-Sfg5-8cmo-7y1D-vIyc-Bn9k4R
  LV Write Access        read/write
  LV Creation host, time s147887, 2019-07-01 10:20:35 +0000
  LV Status              available
  # open                 0
  LV Size                976.00 MiB
  Current LE             244
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

  --- Logical volume ---
  LV Path                /dev/vg/swap
  LV Name                swap
  VG Name                vg
  LV UUID                pdD373-lBCI-583I-FP8C-htu5-B97D-NDR7h0
  LV Write Access        read/write
  LV Creation host, time s147887, 2019-07-01 10:20:35 +0000
  LV Status              available
  # open                 0
  LV Size                92.00 MiB
  Current LE             23
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

root@sysresccd /root %

 lvscan
  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  ACTIVE            '/dev/vg/root' (445.13 GiB) inherit
  ACTIVE            '/dev/vg/tmp' (976.00 MiB) inherit
  ACTIVE            '/dev/vg/swap' (92.00 MiB) inherit
root@sysresccd /root %


root@sysresccd /root % mount /dev/vg/root /mnt
mount: wrong fs type, bad option, bad superblock on /dev/mapper/vg-root,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
root@sysresccd /root %

Can anyone help?

postgresql: Postgres 12 scalability using table partitions and external data wrappers

I have reviewed the files and cannot find any discussion on the following topic.

I have a pretty deep question with which I would appreciate some guidance.

Current environment

  • Current version of Postgres: 10
  • Os: Ubuntu 14:04 (Soon to update to 18.04)
  • The hard drive has 2.3 TB of maximum space. (Raid 10 SSD & # 39; s)
  • Current Postgres data size: 1.6 TB (growing at 100 gb per month)
  • It currently has 1 master database and 2 replicas. (1 slave ascending and 1 descending using cascade replication)
  • 1 warehouse with logical replication

Based on the above, I am sure that it is quite obvious that I will have some serious problems regarding the available disk space within a few months.
Just a couple of things to mention before providing my long-term theoretical solution.

Currently, the cloud-based solution is not an option due to costs and complexity
The servers are housed in an external DC and the maximum possible disk size that we can achieve using SSD in a Raid 10 configuration is 2.3 TB
We are currently handling the load at a reasonable level. Although that could change as our business grows

My thoughts on a possible solution

I need a scalable solution in the long term and we have been looking to upgrade to Postgres 12. Using the seemingly incredible partition of tables with foreign data wrappers, could we achieve a horizontal scale if we divide the key tables by date? If this is possible, we could have the data of the current years on our primary PostgreSQL master server and our annual partitioned tables on a different server. Therefore, alleviating our space problems and achieving long-term scalability

The above seems feasible, but how would this affect my aftershocks? I think that any partitioning change I make in my Master DB would be "replicated" through replications. More importantly, how would this work relate to foreign data containers?

Alternative solutions

I could get away from using SSD to get more space in a raid configuration 10. (In the long term, I would still encounter the same problems eventually and my application could pay a performance penalty)
You could use a different raid configuration to achieve more available space. (The same long-term problems mentioned above)
I could look to build a manual archiving process that copies my "cold" data to a different server and deletes it from the master's data.

Sorry for the long question.

dual boot – Installation issues – Many unknown partitions

I am trying to install Ubuntu on my new laptop, but I am having problems when I try to partition my disk.
Partition step

I don't know what partition I should change to install Ubuntu next to Windows. I guess I should change the 500 go partition because that's the size of my SSD but the type of this partition is unknown … is it important? And what partition should I delete to put Ubuntu …
Thank you !

co.combinatorics – Possible supervision in the role of Greene and Kleitman on chains in order of domination in partitions?

This question is about a possible loophole in a role of Greene and Kleitman that Zarathustra Brady let me know.

The article in question is "Longer chains in the network of entire partitions sorted by wholesale" (available online here). In that document, they calculate the length of the longest chain in the order of dominance in the partitions and, in general, give an algorithm to find the longest chain in any interval of order of domination.

In order of domination we have a coverage relationship $ lambda gtrdot mu $ If and only if $ mu $ is obtained from $ lambda $ moving a single box in a row $ i $ row $ i + 1 $or moving a single frame in the column $ i + 1 $ to the column $ i $. In the first case, Greene and Kleitman say that $ lambda gtrdot mu $ is a Step h (Because, perhaps confusingly for modern readers, the box moved a unit horizontally according to its non-standard scheme of drawing partitions with vertical parts, see Figure 2), and in the second case they say that $ lambda gtrdot mu $ is a V step (because the box moved a unit vertically according to its representation). Keep in mind, as the authors point out, that it is possible that $ lambda gtrdot mu $ it is both a step H and a step V (and in fact this is the source of the possible lagoon!).

Greene and Kleitman say a chain $ lambda ^ 0> lambda ^ 1> cdots> lambda ^ L $ is a H string yes every step $ lambda ^ i> lambda ^ i + 1} = lambda ^ i gtrdot lambda ^ i + 1} $ it's a step H, and similarly say that the chain is a V string yes every step $ lambda ^ i> lambda ^ i + 1} = lambda ^ i gtrdot lambda ^ i + 1} $ It's a step in V. Also, they say $ lambda ^ 0> lambda ^ 1> cdots> lambda ^ L $ is a HV chain if there is any index $ i $ such that $ lambda ^ 0> cdots> lambda ^ i $ it's an H chain and $ lambda ^ i> cdots> lambda ^ L $ It is a V chain.

In a crucial motto of the article, Lemma 3, they affirm that if $ lambda = lambda ^ 0> lambda ^ 1> cdots> lambda ^ L = mu $ is any chain in order of domination, then there is some HV chain between $ lambda $ and $ mu $ in length at least $ L $. The argument they give is: we can assume that each step in the chain is a hedging relationship; we assure that it is true for the chains $ lambda_0> lambda_1> lambda_2 $ of length 2; then, by repeatedly applying this case of length 2 we can convert any length string $ L $ to an HV chain of at least length $ L $.

But this last point about the repeated application of the case of length 2 seems suspicious, for the following reason. Suppose we have a chain of length 3 $ lambda_0> lambda_1> lambda_2> lambda_3 $ such that $ lambda_0> lambda_1 $ it's a V step that is not an H step, $ lambda_1> lambda_2 $ it's a step V and H, and $ lambda_2> lambda_3 $ it is a step H that is not a step V. (This situation may arise: $ (5,4,3,2)> (4,4,4,2)> (4,4,3,3)> (4,4,3,2,1) $.) Then the problem is that, from the perspective of substrings of length 2, things look good: $ lambda_0> lambda_1> lambda_2 $ it is a V chain, so it is in particular an HV chain; Similary $ lambda_1> lambda_2> lambda_3 $ it is an H chain, so in particular it is an HV chain. But $ lambda_0> lambda_1> lambda_2> lambda_3 $ It is obviously not an HV chain.

Question: Is this a real oversight in the role of Greene-Kleitman? If so, is Lemma 3 true, and can the test be repaired?

co.combinatorics – Asymptotics of the Steenrod algebra / $ s $ -partitions?

Remember that a $ s $-partition is a partition of a natural number $ n $ such that each part has the form $ 2 ^ r-1 $. For a fundamental theorem of Milnor, the number $ p_s (n) $ from $ s $-partitions of $ n $ counts the dimension of the algebra of Steenrod mod-2 in degree $ n $. I am interested in the asymptotic function. $ p_s (n) $, as well as related functions for odd primary Steenrod algebras.

Questions:

  1. The number of $ s $-partitions $ p_s (n) $ grow sub-exponentially in $ n $?

  2. If so, are there effective constants? $ p_s (n) leq C_ epsilon (1+ epsilon) ^ n $?

  3. What about the dimension of odd primary Steenrod algebras?

The OEIS page (here is the link again) leads to this document that offers an asymptotic formula for $ ln p_s (n) $, and all terms are in fact sublinear in $ n $, except possibly for the term that implies a craft function $ W (z) $, whose growth I don't know how to estimate.

As for odd primary Steenrod algebras, Milnor showed that for $ p $ a strange cousin, Steenrod's dual algebra in the first $ p $ is the tensor product $ P ( xi_1, xi_2, dots) otimes E ( tau_0, tau_1, tau_2, dots) $ where $ deg ( xi_i) = 2p ^ i – 2 $, $ deg ( tau_i = 2p ^ i – 1) $and $ P, E $ denote polynomial and exterior algebras respectively $ mathbb F_p $. Therefore, counting the dimension is reduced to a combinatorial partition problem of a similar taste.

Windows 7 – Merge two NTFS partitions

Yes partition 2 is empty And it is right next to partition 1 then simply delete it and resize partition 1 to fill the new empty space. Any tools You can resize partitions without losing data, such as MiniTool Partition Wizard, AOMEI Partition Assistant, EaseUS Partition Master, Macrorit Partition Expert or gparted can do so. Even the Windows disk manager can do the same, although with less flexibility (probably because it tries to avoid moving data as much as possible to avoid data loss)

If the partitions are separated from each other, then it is much more complicated. There are 2 solutions.

  • Convert the disk to dynamic disk that is the Windows logical volume manager and is the analogue of LVM on Linux. Then, partition 1 can be extended to any other empty dynamic volume
  • Remove partition 2, then move all partitions between partition 2 and partition 1 to fill the unallocated space and change the size of partition 1. This takes much longer and is more risky.

partitions: where is the information from / proc / dumchar_info used on MediaTek devices?

There are many instructions to change the partition layout on Android, including MediaTek devices, and they say I need to edit MBR, EBR and a "scatter file" and feed the latter to SP Flash or MTKDroidTools. However, as noted in a response to "Where does partition information come from / proc / dumchar_info, on MTK devices?", The MediaTek-specific one /proc/dumchar_info You can't change it with those means.

Hence the question, where is the information from /proc/dumchar_info used? And if it does not reflect the actual partition design and does not agree with MBR, EBR and the "scatter file", what effects should I expect?