[PDF] Sorting Balls and Water: Equivalence and Computational Complexity





Previous PDF Next PDF



Untitled

22 juil. 2019 ÉPREUVE ÉCRITE D'ADMISSIBILITE: MATHÉMATIQUES. Ce sujet comprend 7 pages numérotées ... Exercice 3: la « waterball » d'Emmanuel (3 points).



Grandeurs et mesures

De nombreux domaines des mathématiques sont concernés : géométrie statistiques



La station de métro Question : À la lecture des instructions de l

Un forain vient d'acheter cette water-ball mais malheureusement la notice d'utilisation n'était pas avec. À l'aide des documents répondre aux questions 



Compétences travaillées

» Utiliser les outils mathématiques adaptés. Domaine du socle : 2. Page 2. Extrait des programmes 2016 « Questionner le monde ».



TD dexercices de Géométrie dans lespace.

Sur la figure ci-contre on a un cône de révolution tel que SA = 12 cm. Un plan parallèle à la base coupe ce cône tel que SA' = 3 cm (la figure ci-contre 



ESPACE

Waterball. 2 € / 15 min / pers. VTT à partir de 5 €. Mini-golf à partir de 1 € 30. TARIFS. Ne pas jeter sur la voie publique - Imprimerie Fresnoise.



Sorting Balls and Water: Equivalence and Computational Complexity

19 févr. 2022 2012 ACM Subject Classification Mathematics of computing ? Discrete ... Keywords and phrases Ball sort puzzle recreational mathematics



CE D ERTIFICA DE LENS CON AT DAPT SEIGNEM NCOURS

10 mai 2017 comme suit pour ce qui concerne la section mathématiques : ... Une Water Ball est une boule remplie d'air grâce à laquelle on peut marcher ...



Quest-ce quune sphère? Définition : Soit O un point de lespace et r

La boule de centre O et de rayon r est l'ensemble des points M de l'espace tels que OM soit inférieur ou égal à r. Remarque : •. Une sphère est une surface 



Fiche professeur Modalités de gestion possibles Appropriation

Fiche professeur Water-Ball Niveaux et objectifs pédagogiques 3 e : notion de 3 Savoir utiliser des connaissances et des compétences mathématiques 



[PDF] 20190722112024150pdf - drhfpnc

22 juil 2019 · ÉPREUVE ÉCRITE D'ADMISSIBILITE: MATHÉMATIQUES DURÉE : 3 HEURES Exercice 3: la « waterball » d'Emmanuel (3 points)



Water Ball PDF - Scribd

Water Ball - Free download as Excel Spreadsheet ( xls / xlsx) PDF File ( pdf ) Text File ( txt) or read online for free ?ater ball for trading



[PDF] Grandeurs et mesures - Eduscol

De nombreux domaines des mathématiques sont concernés : géométrie statistiques proportionnalité fonctions calcul numérique et littéral Un travail 



Cycle 4 - Mathématiques - Euler Versailles

Page tirée du site éduscol Programmes de mathématiques 2020 Cycle 4 ( pdf 7199 ko) Cycle 4 (document avec modifications apparentes) ( pdf 6996 ( )



Tâches complexes : les volumes – IREM Orléans

12 mai 2015 · Elles sont au format docx et pdf waterball La structure gonflable : il faut Fabrice ARNAUD Enseigner les mathématiques au collège



[PDF] Excès de vitesse : Mathématiques et Physique-Chimie 4e

Mathématiques et Physique-Chimie 4e Co-intervention mathématiques/physique-chimie : fiches d'activités pour élèves modules AP : water-ball Février



[PDF] La station de métro Question

La water-ball est fabriquée en PVC dont la masse surfacique est de 106 kg/m² Document 4 : Consommation moyenne d'oxygène à l'effort pour un kilogramme



IterativeWatershed Algorithm with Reduced Oversegmentation

Waterball - IterativeWatershed Algorithm with Reduced Oversegmentation Download conference paper PDF MATH Google Scholar

:

Sorting Balls and Water: Equivalence and

Computational Complexity

Takehiro Ito?Graduate School of Information Sciences, Tohoku

University, JapanJun Kawahara?

Kyoto University, Japan.

Shin-ichi Minato??Kyoto University, Japan

Yota Otachi??Nagoya University, Japan

Toshiki Saitoh?

Kyushu Institute of Technology, Japan.Akira Suzuki??

Graduate School of Information Sciences, Tohoku

University, Japan

Ryuhei Uehara??

Japan Advanced Institute of Science and Techno-

logy, JapanTakeaki Uno?

National Institute of Informatics, Japan.

Katsuhisa Yamanaka??Iwate University, Japan

Ryo Yoshinaka?

Graduate School of Information Sciences, Tohoku

University, Japan.Abstract

Various forms of sorting problems have been studied over the years. Recently, two kinds of sorting puzzle apps are popularized. In these puzzles, we are given a set of bins filled with colored units, balls or water, and some empty bins. These puzzles allow us to move colored units from a bin to another when the colors involved match in some way or the target bin is empty. The goal of these puzzles is to sort all the color units in order. We investigate computational complexities of these puzzles. We first show that these two puzzles are essentially the same from the viewpoint of

solvability. That is, an instance is sortable by ball-moves if and only if it is sortable by water-moves.

We also show that every yes-instance has a solution of polynomial length, which implies that these puzzles belong to NP. We then show that these puzzles are NP-complete. For some special cases, we give polynomial-time algorithms. We finally consider the number of empty bins sufficient for making all instances solvable and give non-trivial upper and lower bounds in terms of the number of filled bins and the capacity of bins.

2012 ACM Subject Classification

Mathematics of computing→Discrete mathematics→Combin- atorics→Combinatorial algorithms

Keywords and phrases

Ball sort puzzle, recreational mathematics, sorting pairs in bins, water sort puzzle FundingThis research is partially supported by JSPS Kakenhi Grant Number 18H04091. Takehiro Ito: Partially supported by JSPS KAKENHI Grant Numbers JP19K11814 and JP20H05793,

Japan.

Yota Otachi: JSPS KAKENHI Grant Numbers JP18K11168, JP18K11169, JP20H05793, JP21K11752. Akira Suzuki: Partially supported by JSPS KAKENHI Grant Numbers JP20K11666 and JP20H05794,

Japan.

Ryuhei Uehara: JSPS KAKENHI Grant Numbers JP20H05961, JP20H05964, JP20K11673.

Katsuhisa Yamanaka: Partially supported by JSPS KAKENHI Grant Numbers 19K11812, Japan.arXiv:2202.09495v1 [cs.CC] 19 Feb 2022

2 Sorting Balls and Water: Equivalence and Computational Complexity1 34

3 412
2 3 4121
3 4 3 412
2 3 412
1 3 4 3 412
2 3 4121
3 43
4 12 2 34
121
3 43
4 12 23
4 121
3 4 3 412
2 3 412
1 34 3 412
2 3

4121 3

4 3 412
2 3

4121 3

4 3 412
2 3

412Figure 1An example of the ball sort puzzle.

1 3 3 1 22
3311
2 2 a bcdef 13 3 1 22
3311
2 2 a bcdef 3 3 22
3311
2 2 a bcdef 3 3 22
3311
2 2 a bcdef (1)(2)(3)(0) 1 1 1

1Figure 2

Rules of the water sort puzzle. From the initial configuration (0), we obtain configuration (1) by moving two units of water of label1fromatof, configuration (2) by moving two units of

water of label1fromatob, and configuration (3) by moving one unit of water of label2fromctoe.1Intro duction

Theball sort puzzleand thewater sort puzzleare popularized recently via smartphone apps.1 Both puzzles involve bins filled with some colored units (balls or water), and the goal is to somehow sort them. The most significant feature of these puzzles is that each bin works as a stack. That is, the items in a bin have to follow the "last-in first-out" (LIFO) rule. In the ball sort puzzle, we are givenhncolored balls innbins of capacityhandk additional empty bins. For a given (unsorted) initial configuration, the goal of this puzzle is to arrange the balls in order; that is, to make each bin either empty or full with balls of the same color. (The ordering of bins does not matter in this puzzle.) The rule of this puzzle is simple: (0) Each bin works like a stack, that is, we can pick up the top ball in the bin. (1) We can move the top ball of a bin to the top of another bin if the second bin is empty or it is not full and its top ball before the move and the moved ball have the same color. An example withh= 3,n= 4, andk= 1is given in Figure 1. The water sort puzzle is similar to the ball sort puzzle. Each ball is replaced by colored water of a unit volume in the water sort puzzle. In the water sort puzzle, the rules (0) and (1) are the same as the ball sort puzzle except one liquid property: Colored water units are merged when they have the same color and they are consecutive in a bin. When we pick up a source bin and move the top water unit(s) to a target bin, the quantity of the colored water on the top of the bin to be moved varies according to the following conditions (Figure 2). If the target bin has enough margin, all the water of the same color moves to the target bin. On the other hand, a part of the water of the same color moves up to the limit of the target1

These sort puzzles are released by several different developers. As far as the authors checked, it seems

that the first one is released by IEC Global Pty Ltd in January, 2020.

T. Ito et al.3

bin if the target bin does not have enough margin.In this paper, we investigate computational complexities of the ball and water sort puzzles.

We are givenn+kbins of capacityh. In an initial configuration,nbins are full (i.e., filled withhunits) andkbins are empty, where each unit has a color in the color setC. Our task is to fillnbins monochromatically, that is, we need to fill each of them withhunits of the same color. We defineBSPandWSPas the problems of deciding whether a given initial configuration can be reconfigured to a sorted configuration by a sequence of ball moves and water moves, respectively. We assume that instances are encoded in a reasonable way, which takesΘ(nhlog|C|+logk)bits. Without loss of generality, we assume that each color c?Coccurs exactlyhjtimes for some positive integerjin any instance since otherwise the instance is a trivial no-instance. (This implies that|C|is at mostn.)

1.1 Our results

We first prove that the problemsBSPandWSPare actually equivalent. By their definitions, a yes-instance ofWSPis a yes-instance ofBSPas well. Thus our technical contribution here is to prove the opposite direction. As a byproduct, we show that a yes-instance of the problems admits a reconfiguration sequence of length polynomial inn+has a yes-certificate. This implies that the problems belong to NP. We also show thatBSPandWSPare solvable in timeO(hn). We next show thatBSPandWSPare indeed NP-complete. By slightly modifying this proof, we also show that even for some kind oftrivialyes-instances ofWSP, it is NP-complete to find a shortest reconfiguration to a sorted configuration. We show that if the capacityhis2and the number of colors isn, thenBSPandWSP are polynomial-time solvable. In this case, we present an algorithm that finds shortest reconfiguration sequences for yes-instances. We also consider the following question: how many empty bins do we need to ensure that all initial configurations can reach a sorted configuration? Observe thatBSPandWSP are trivial ifk≥hn. It is not difficult to see thatk≥nis also sufficient by using an idea based on bucket sort. By improving this idea, we show thatk≥ ?h-1h n?is sufficient for all instances. We also show that some instances needk≥ ?1964 min{n,h}?empty bins.

1.2 Related studies

Various forms of sorting problems have been studied over the years. For example, sorting by reversals is well investigated in the contexts of sorting network [6, Sect. 5.2.2], pancake sort [2], and ladder lotteries [8]. There is another extension of sorting problem from the viewpoint of recreational mathematics defined as follows. For eachi? {1,...,n}, there are h balls labeledi. Thesehnballs are given innbins in which each bin is of capacityh. In one step, we are allowed to swap any pair of balls. Then how many swaps do we need to sort the balls? This sorting problem was first posed by Peter Winker for the caseh= 2in

2004 [7], and an almost optimal algorithm for that case was given by Ito et al. in 2012 [4].

The ball/water sorting puzzles are interesting also from the viewpoints of not only just puzzles but also combinatorial reconfiguration. Recently, thereconfiguration problems attracted the attention in theoretical computer science (see, e.g., [5]). These problems arise when we need to find a step-by-step transformation between two feasible solutions of a problem such that all intermediate results are also feasible and each step abides by a fixed reconfiguration rule, that is, an adjacency relation defined on feasible solutions of the original problem. In this sense, the ball/water sort puzzles can be seen as typical implementations of

4 Sorting Balls and Water: Equivalence and Computational Complexitythe framework of reconfiguration problems, while their reconfiguration rules are non-standard.

In most reconfiguration problems, representative reconfiguration rules arereversible; that is, if a feasible solutionAcan be reconfigured to another feasible solutionB, thenBcan be reconfigured toAas well (see e.g., the puzzles in [3]). In the ball sort puzzle, we can reverse the last move if we have two or more balls of the same color at the top of the source bin, or there is only one ball in the source bin. Otherwise, we cannot reverse the last move. That is, some moves are reversible while some moves are one-way in these puzzles. (In Figure 1, only the last move is reversible.) In the water sort puzzle, basically, we cannot separate units of water of the same color once we merge them, however, there are some exceptional cases. An example is given in Figure 2; the move from configuration (2) to configuration (3) is reversible, but the other moves are not.2Equivalence of balls and w ater This section presents fundamental properties ofBSPandWSP, from which we will conclude

thata configuration is a yes-instance ofBSPif and only if it is a yes-instance ofWSP, andBSPandWSPboth belong toNP.

2.1 Notation used in this section

LetBandCbe finite sets ofbinsandcolors, respectively. The set of sequences of colors of and denoted bycl. The empty sequence is denoted asε, which is, in our terminology, also is a configurationSsuch that|S(b)| ? {h,0}for allb?B. A binbissortedunderSif S(b)? {ε,ch}for somec?C. A configurationSissortedorgoalif all bins are sorted under S. Sometimes we identifyb?BwithS(b)whenSis clear from the context.

color sequenceαisTC(α) =α[|α|]ifαis not empty. In caseαis empty,TC(α)is defined to

ori= 0, and the set of borders ofαis denoted byD(α). We count non-trivial borders under

SasD(S) =?

b?B|D(S(b))\ {0}|. For example, in Figure 2, the values ofDare4,3,3,3in (0), (1), (2), (3), respectively. We now turn to define a move of the sort puzzles with the terminologies introduced above. Intuitively, we pick up two binsb1andb2fromB, and pour the top item(s) fromb1tob2if b2is empty or the top item ofb2has the same color. The quantity of the items are different in the cases of balls and water. In the ball case, a unit is moved if possible. On the other hand, two or more units of water of the same color move at once until all units are moved or b2becomes full. We define the move more precisely below. Aball-movecan modify a configurationSintoS?, denoted asS→S?, if there are

b1,b2?Bandc?Csuch thatS(b1) =S?(b1)·c,TC(S(b2))? {c,ε},S?(b2) =S(b2)·c, andS(b) =S?(b)for allb?B\ {b1,b2}.

Awater-movecan modifySintoS?, denoted asS?S?, if there arem≥1,b1,b2?B

andc?Csuch thatS(b1) =S?(b1)·cm,TC(S(b2))? {c,ε}, andS?(b2) =S(b2)·cm,eitherTC(S?(b1))?=cor|S?(b2)|=h, and

T. Ito et al.5S

0SS ?Figure 3The configurationScan be obtained from the initial configurationS0and can be modified into the tight oneS?. The top-bordersTBSofSare shown with thick lines. This figure does not care the units below those borders. All ofS0,S, andS?haveFred(TBS) = 9red units, Fgreen(TBS) = 7green units, andFblue(TBS) = 3blue units above the borders in total. The colors red, green, and blue requireMred(TBS) = 0,Mgreen(TBS) = 1, andMblue(TBS) = 1monochrome

bins, respectively, which coincide with the number of the monochrome bins of respective colors inS?.S(b) =S?(b)for allb?B\ {b1,b2}.

The reflexive and transitive closures of→and?are denoted as→?and??, respectively. Clearly any single water-move can be simulated by some number of ball-moves. Thus we have??? →?.

2.2 Fundamental Theorems ofBSPandWSP

quotesdbs_dbs42.pdfusesText_42
[PDF] combien de temps peut on rester dans une waterball de 2m de diametre

[PDF] rediger une reponse a une question

[PDF] répondre ? des questions de lecture ce1

[PDF] on tire au hasard une carte dans un jeu de 32 cartes. on s'intéresse aux événements

[PDF] on tire au hasard une carte dans un jeu de 32 cartes combien l experience compte t elle d issues

[PDF] dans un jeu de 32 cartes il y a 4 couleurs

[PDF] on tire une carte d'un jeu de 32 cartes on appelle

[PDF] dans un jeu de 32 cartes on tire successivement et avec remise deux cartes

[PDF] rédiger une phrase réponse problème

[PDF] dans un jeu de 52 cartes on tire une carte au hasard

[PDF] bilan biologique d'urgence

[PDF] liste des examens réputés urgents

[PDF] analyse de sang en urgence

[PDF] histoire de la chine antique pdf

[PDF] bilan sanguin complet aux urgences