Showing posts with label Education. Show all posts
Showing posts with label Education. Show all posts

Friday, September 6, 2019

ACAB.BASIC

2 REM "DADES ENTRADES A MA"
10 PRINT "Humanitat:"
20 DIM A$(4,6)
100 A$(0,0)="ESSER_HUMA"
110 A$(0,1)="Adam"
120 A$(0,2)=""
130 A$(0,3)=""
140 A$(0,4)=""
150 A$(0,5)=""

200 A$(1,0)="ESSER_HUMA"
210 A$(1,1)="Eva"
220 A$(1,2)=""
230 A$(1,3)=""
240 A$(1,4)=""
250 A$(1,5)=""

300 A$(2,0)="CIUTADA"
310 A$(2,1)="Abel"
320 A$(2,2)="Adam"
330 A$(2,3)="Eva"
340 A$(2,4)="Escola del Paradis"
350 A$(2,5)=""

400 A$(3,0)="POLI"
410 A$(3,1)="Caim"
420 A$(3,2)=""
430 A$(3,3)="Eva"
440 A$(3,4)="Escola del Paradis"
450 A$(3,5)="1"

460 REM " Bucle que no existeix a OOP:"

480 V=0
500 FOR N=0 TO 3 STEP 1
505 V=N
510 IF A$(N,0)="ESSER_HUMA" THEN GOSUB 1990
520 IF A$(N,0)="CIUTADA" THEN GOSUB 2990
530 IF A$(N,0)="POLI" THEN GOSUB 3990
540 NEXT
1000 END

1990 REM "Print EsserHuma"
2000 PRINT USING " "; A$(V,1);"  "; A$(V,2);"  "; A$(V,3)
2010 RETURN

2990 REM "Print Ciutada"
3000 PRINT USING " "; A$(V,1);"  "; A$(V,2);"  "; A$(V,3);"  "; A$(V,4)
3010 RETURN

3990 REM "Print Poli"
4000 PRINT USING " "; A$(V,2);"  ";  A$(V,5)
4010 RETURN

5000 REM "//////////////////MÓN REAL/////////////////////////////////"
5500 REM "
///////Primera referència al Twitter sobre aquest arxiu:"
5501 REM "//////https://twitter.com/macajo/status/1170044137510461441?s=20
6000 REM "///////////////////////////////////////////////////////////"

Thursday, September 5, 2019

Acab2.java

/* By: Maurici Carbó of nummolt apps Sept 2019
Convenció de Colors:
Comanaments de les Classes de Java
Classes de Java Prefabricades
@anotacions
Paraules Clau de Java
Cadenes de paraules
////Comentaris  */


//////////////////////Acab2.java////////////////  


import java.time.LocalTime;
import org.eclipse.jdt.annotation.Nullable;


public class EsserHuma {
    public LocalTime m_dataNaixement;
    public EsserHuma m_papa;
    public EsserHuma m_mama;
    public String m_nom;

    public EsserHuma(){/*buit*/}
    public EsserHuma(LocalTime datanaixement,@Nullable EsserHuma papa,
                            EsserHuma mama, @Nullable String nom){
        m_dataNaixement=datanaixement;
        m_papa=papa;
        m_mama=mama;
        m_nom=nom;
    }
    public void print() {
        if(m_papa != null || m_mama != null) {
        System.out.println(m_dataNaixement+ " nom propi: "+ m_nom +"Pare: "+ m_papa.m_nom+ " Mare: "+m_mama.m_nom);
        }
        else {
            System.out.println(m_dataNaixement+" nom propi: "+ m_nom);
        }
    }
}




public class Ciutada extends EsserHuma{
    Escola m_escola;
   
    public Ciutada(LocalTime datanaixement,@Nullable EsserHuma papa,
                EsserHuma mama, @Nullable String nom, Escola escola){
        super(datanaixement, papa, mama, nom);
        m_escola= escola;
    }
  
    static Poli nomenarPoli(Ciutada ciutada){
        return Poli.nomenarPoli(ciutada);
    }
    public void print() {
        System.out.println(m_dataNaixement+ " nom propi: "+m_nom +" Pare: "+ m_papa.m_nom+ " Mare: "+m_mama.m_nom);
    }
}


public final class Poli extends Ciutada{
    int m_numeroPlaca;

    private Poli(LocalTime datanaixement, EsserHuma mama, Escola escola){
        super(datanaixement, null, mama, "-", escola);
        Humanitat.m_darrerNumPlaca++;
        m_numeroPlaca=Humanitat.m_darrerNumPlaca;
    }      

     static Poli nomenarPoli(Ciutada ciutada){
        return new Poli(ciutada.m_dataNaixement, ciutada.m_mama, ciutada.m_escola);
    }
    
     public void print() {
         System.out.println(m_dataNaixement+ " nom propi: "+ m_nom + " Mare: "+m_mama.m_nom + " Poli num Placa: "+ m_numeroPlaca);
     }
}



public class Escola {
    String m_nomEscola;
    EsserHuma m_director;
    ArrayList<Ciutada> m_arlExAlumnes;
 
    public Escola(String nomEscola,EsserHuma director){
        m_arlExAlumnes=new ArrayList<Ciutada>();
        m_nomEscola= nomEscola;
        m_director= director;
    }

    public Ciutada ensenyar(EsserHuma esserhuma){
        Humanitat.m_arlHumanitat.remove(esserhuma);
        EsserHuma alumne=esserhuma;
        Ciutada alumneEnsenyat=new Ciutada(alumne.m_dataNaixement, alumne.m_papa,
                                        alumne.m_mama, alumne.m_nom, this);
        Humanitat.m_arlHumanitat.add(alumneEnsenyat);
        m_arlExAlumnes.add(alumneEnsenyat);
        return alumneEnsenyat;
    }
}


public class  Humanitat {
    static ArrayList<Escola> m_arlEscoles;
    static ArrayList<EsserHuma> m_arlHumanitat;
    static int m_darrerNumPlaca=0;
  
    public Humanitat() {
        m_arlEscoles = new ArrayList<Escola>();
        m_arlHumanitat= new ArrayList<EsserHuma>();
    }
  
    static public void nouMembreHumanitat(EsserHuma nouesserhuma){
        m_arlHumanitat.add(nouesserhuma);
    }

    public static void ferEscola(String nomEscola, EsserHuma director){
        m_arlEscoles.add(new Escola(nomEscola, director));
    }
  
    public static Ciutada ensenyar(EsserHuma esserhuma, Escola escola){
        return escola.ensenyar(esserhuma);
    }

    public static void nomenarPoli(Ciutada ciutada){
        m_arlHumanitat.remove(ciutada);
        Ciutada anticCiutada=ciutada;
        Poli nouPoli=Poli.nomenarPoli(anticCiutada);
        m_arlHumanitat.add(nouPoli);
    }
    public static void llistatHumanitat() {
        for(EsserHuma esserhuma: m_arlHumanitat) {
            esserhuma.print();
        }
    }
}


public class Acab {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
            new Humanitat();
            EsserHuma adam=new EsserHuma(); ////buit
            EsserHuma eva=new EsserHuma();  ////buit
            adam.m_dataNaixement= LocalTime.now();
            eva.m_dataNaixement=  LocalTime.now();
            adam.m_nom="Adam";
            eva.m_nom="Eva";
            Humanitat.nouMembreHumanitat(adam);
            Humanitat.nouMembreHumanitat(eva);
            Humanitat.ferEscola("EscolaDelParadís", adam);
            EsserHuma caim= new EsserHuma(LocalTime.now(),adam, eva, "Caim");
            EsserHuma abel= new EsserHuma(LocalTime.now(),adam, eva, "Abel");
            Humanitat.nouMembreHumanitat(caim);      
            Humanitat.nouMembreHumanitat(abel);
            Ciutada caimEnsenyat= Humanitat.ensenyar(caim, Humanitat.m_arlEscoles.get(0));
            Ciutada abelEnsenyat= Humanitat.ensenyar(abel, Humanitat.m_arlEscoles.get(0));
            Humanitat.nomenarPoli(caimEnsenyat);
            Humanitat.llistatHumanitat();
    }
}




////////////////////////////MÓN REAL/////////////////////////////////
///////Primera referència al Twitter sobre aquest arxiu:
///// https://twitter.com/macajo/status/1169660828087402498https://twitter.com/macajo/status/1169660828087402498://twitter.com/macajo/status/1169660828087402498?s=20
/////////////////////////////////////////////////////////////////////






Sunday, September 1, 2019

Acab.java

/* By: Maurici Carbó of nummolt apps Sept 2019
Convenció de Colors:
Comanaments de les Classes de Java
Classes de Java Prefabricades
@anotacions
Paraules Clau de Java
////Comentaris  */

//////////////////////Acab.java////////////////   

    class EsserHuma{
        Date m_data;
        EsserHuma m_papa;
        EsserHuma m_mama;
        String m_nom;

        public EsserHuma(){/*buit*/};
        public EsserHuma(Date datanaixement,@Nullable EsserHuma papa,
                                EsserHuma mama, @Nullable String nom){
            m_data=datanaixement;
            m_papa=papa;
            m_mama=mama;
            m_nom=nom;
        }
    }

    class Ciutada extends EsserHuma{
        Escola m_escola;
       
        public Ciutada(Date datanaixement,@Nullable EsserHuma papa,
                    EsserHuma mama, @Nullable String nom, Escola escola){
            super(data, papa, mama, nom);
            m_escola= escola;
        }
       
        Poli nomenarPoli(Ciutada ciutada){
            return Poli.nomenarPoli(Ciutada ciutada);
        }
    }

    static class Poli extends Ciutada{
        int m_numeroPlaca;

        private Poli(Date datanaixement, EsserHuma mama, Escola escola){
            super(datanaixement, null, mama, null, escola);
            Humanitat.m_darrerNumPlaca++;
            m_numeroPlaca=Humanitat.m_darrerNumPlaca;
        }       
   
        static Poli nomenarPoli(Ciutada ciutada){
            return new Poli(ciutada.m_data, ciutada.m_mama, ciutada.m_escola);
        }
    }

    class Humanitat{
        static ArrayList<Escola> m_arlEscoles;
        static ArrayList<EsserHuma> m_arlHumanitat;
        static int m_darrerNumPlaca=0;
       
        public Humanitat() {
            m_arlEscoles = new ArrayList<Escola>();
            m_arlHumanitat= new ArrayList<EsserHuma>();
        }
       
        static public nouMembreHumanitat(EsserHuma nouesserhuma){
            m_arlHumanitat.add(nouesserhuma);
        }

        public static ferEscola(String nomEscola, EsserHuma director){
            m_arlEscoles.add(new Escola(nomEscola, director);
        }
       
        public static Ciutada ensenyar(EsserHuma esserhuma, Escola escola){
            return escola.ensenyar(esserhuma);
        }

        public static void nomenarPoli(Ciutada ciutada){
            Ciutada anticCiutada=m_arlHumanitat.remove(ciutada);
            Poli nouPoli=anticCiutada.nomenarPoli();
            m_arlHumanitat.add(nouPoli);
        }
    }   

    class Escola{
        String m_nomEscola;
        EsserHuma m_director;
        ArrayList<Ciutada> m_arlExAlumnes;
       
        public Escola(String nomEscola,EsserHuma director){
            m_arlExAlumnes=new ArrayList<Ciutada>();
            m_nomEscola= nomEscola;
            m_director= director;
        }

        public Ciutada ensenyar(EsserHuma esserhuma){
            EsserHuma alumne= Humanitat.m_arlHumanitat.remove(esserhuma);
            Ciutada alumneEnsenyat=new Ciutada(alumne.m_data, alumne.m_papa,
                                            alumne.m_mama, alumne.m_nom, this)
            Humanitat.m_arlHumanitat.add(alumneEnsenyat);
            m_arlExAlumnes.add(alumneEnsenyat);
            return alumneEnsenyat;
        }
    }

    ////////////////////AL Paradís//////////////////////////////////
    public Main(String genesi){
        new Humanitat();
        EsserHuma adam=new EsserHuma(); ////buit
        EsserHuma eva=new EsserHuma();  ////buit
        adam.m_dataNaixement=new Date();
        eva.m_dataNaixement=new Date();
        adam.m_nom="Adam";
        eva.m_nom="Eva";
        Humanitat.nouMembreHumanitat(adam);
        Humanitat.nouMembreHumanitat(eva);
        Humanitat.ferEscola("EscolaDelParadís", adam);
        EsserHuma caim= new EsserHuma(new Date(),adam, eva, "Caim");
        EsserHuma abel= new EsserHuma(new Date(),adam, eva, "Abel");
        Humanitat.nouMembreHumanitat(caim);       
        Humanitat.nouMembreHumanitat(abel);
        Ciutada caimEnsenyat= Humanitat.ensenyar(caim, Humanitat.m_arlEscoles.get(0);
        Ciutada abelEnsenyat= Humanitat.ensenyar(abel, Humanitat.m_arlEscoles.get(0);
        Humanitat.nomenarPoli(caimEnsenyat);
        ////I aquí comencen els problemes de la humanitat
    }


////////////////////////////MÓN REAL/////////////////////////////////
///////Primera referència al Twitter sobre aquest arxiu:
///////https://twitter.com/macajo/status/1168522925554753536
/////////////////////////////////////////////////////////////////////
 https://twitter.com/macajo/status/1168522925554753536?s=20 https://twitter.com/macajo/status/1168522925554753536?s=20
thttps://twitter.com/macajo/status/1168522925554753536?s=20tps://twitter.com/macajo/status/1168522925554753536?s=20
https://twitter.com/macajo/status/1168522925554753536?s=20

Monday, February 20, 2017

Math Garden

Spring Math: Math Garden

In this app, the Natural Numbers are represented as Vegetables (plants): 

Fundamental Theorem of Arithmetic:
(From Wikipedia)
In number theory, the fundamental theorem of arithmetic, also called the unique factorization theorem or the unique-prime-factorization theorem, states that every integer greater than 1 either is prime itself or is the product of prime numbers, and that this product is unique, up to the order of the factors.

Therefore, if each decomposition of a number into its prime factors is unique, each number will have a unique form when it is shown as a plant.
But it is not exactly like that. Depends on the order in which the factors are multiplied.

This is shown in the following app videos:

There are two versions of Math Garden (Android) 

Kids Math Garden:
Video: 
 

Math Garden:
Video:

Details:
The general operation is similar to that of plants:
Seeds fall from the sky
They should be planted. And then grow the plant corresponding to the seed (and the number chosen).
When the time comes to harvest dandelions, the plant is plucked from the ground.
Then the seeds that it has generated are released.
And the seeds return to heaven.

The particular operation is similar to that of the numbers:
If two unseeded seeds overlap, they add up.
If two seeds are planted, the plants multiply.

The plants are structured in branches, forking in function of the prime numbers that compose the factorization of the number.

Plants multiplied underground, often have a structure different from plants planted in a single blow.
(Multiplied plants do not have the usual order of a well-made factorization)
Each plant generates as many little dandelions as the number that indicates its seed, Having any of the structures that may have.

The program has 30 furrows one behind the other to be able to plant.

I hope it will be useful to teach maths. 

Math Garden:
Pythagorean Garden:
3²+4²=5²
5²+12²=13²
8²+15²=17²
7²+24²=25²
Pythagorean Garden


105 Plant In the Math Garden
Variants: The 6 subspecies:
105=3*5*7
105=3*7*5
105=5*3*7
105=5*7*3
105=7*3*5
105=7*5*3
(In invented mathematical plants, of course!!!)
Order of multiplication  vs. Factorization



UPDATE:  (August 2017)
Fractions: 

 


Origin of Math Garden:
Jessica's Drawing of 96
(From Simon Gregg' work)



And Nummolt's:
"Touch Natural Numbers"  
And
"Touch Integers Z"

Saturday, June 11, 2016

Exploring Mersenne primes 2^p -1

Just a note:
My app "Touch Integers ℤ (+ - × ÷)" is useful to explore the Mersenne primes:
Here there's a tiny exploration from 2^2 -1 to 2^23 -1.
We found all numbers prime, except when p==11 and p==23
Like everybody knows:

The search is made with:  "Touch Integers ℤ (+ - × ÷)" Android app:
http://www.nummolt.com

///////     UPDATE:  (August 2016)    ////////
Same exploration on Wagstaff Prime Numbers:  
 

 Woodall Primes:
 
     

Euler's Lucky numbers:

 
   

And Goldbach's Conjecture:
 
 


The exploration has been made with:  "Touch Integers ℤ (+ - × ÷)" Android app:
http://www.nummolt.com


Sunday, March 22, 2015

Education and proper teaching is the best antidote to ward off the madness in our lives.

From the Prinzhorn Collection
Someone might say that insanity is the lack of tools to understand the real world.
Madness, in the discipline of physics for example, could be exemplified by the ignorance of the basic principle of conservation of energy.
A person who does not understand or unknown this principle, it seems a crazy person to the other people with basic skills.
While, the patient without the most basic knowledge, could spend a lifetime to solve an impossible problem to solve, further worsening their own state.
And besides, could eventually add more and more vicious circles of those who already we have normally in the head

Education and proper teaching is the best antidote to ward off a little the madness in our lives.

I will illustrate this with a drawing of the Prinzhorn Collection.
Part of the therapy practiced in the mental institution run by Hans Prinzhorn, 
( http://en.wikipedia.org/wiki/Hans_Prinzhorn ) was to propose to internal patients to conduct drawings and diagrams in which patients express their concerns, concerns or ideas in general.


The drawing represents one of many attempts of a patient to figure out how to build a bicycle propelled by perpetual motion: I mean that as the bicycle moves, the bicycle exploits a supposed energy power, and the bicycle moves forward and accelerates itself, without help of the bicycle rider.




Some months later: More info about education may cut dementia:
http://www.nytimes.com/2016/02/11/health/education-may-cut-dementia-risk-study-finds.html