viernes, 28 de diciembre de 2018

Cosets and Lagrange's Theorem



Lagrange’s Theorem

Introduction

Lagrange’s theorem is about finite groups. A finite group G is a special kind of a set with a natural number n of elements, n > 0.
In general, a group G is a set in which there is defined an operation like addition, multiplication or any other. Let´s call * a generic operation. The following conditions define a group G, with respect to the operation *: (G, *).
1.       If a, b are elements of G, then a*b is an element of G
2.       (a * b) * c = a * (b * c), for all a, b, c elements of G
3.       There is a unique element e in G such that x * e = x = x * e, for all x in G
4.       For each x in G there is exactly one x’ in G such that x *x’ = e = x´ *x
If a * b = b * a for all a, b in G then the group is commutative (or abelian)
The element e is called neutral or identical. For each element a in G; a’ is called the inverse of a with respect to the operation *.
One of the more known groups is Z, the set of integers, an infinite group. For this group, the operation is addition (* is +), the identical element is 0 (e is 0) and a’, the inverse of integer a with respect to addition, is -a (a’ is -a).
The set {[0], [1], [2], [3], [4]} of integers, mod 5 is a finite group with respect to addition mod 5. In this case, [0] is the identical, [3]’ = [2], [4]’ = [1].

Subgroups of a group

If H is a subset of a group G and H itself is a group, with respect to the operation defined in G, then H is a subgroup of G. For each group G there are two trivial subgroups: G and {e}. Any other subgroups of a group are called proper subgroups of it.
Example: the set of even integers is a proper subgroup of the group (Z, +).

Cosets

The concept of coset for a given subgroup will be useful in the development of Lagrange’s  Theorem.
Let H be a subgroup of the group (G, *). If g is an element of G, then the set
g*H = {g*x| x is an element of H}
Is called a left coset for H.
Analogously, H*g is defined as a right coset for H. If G is an abelian group, there is no difference between right and left cosets.
Example. Let G = {[1], [2], [3], [4], [5], [6]}. This is the set of integers mod 7, without [0]. It may be verified that G is a group under multiplication. Also, it may be seen that H = {[1], [2], [4]} is a subgroup of G. The following are the left cosets for H:
[1].H = {[1], [2], [4]}
[2].H = {[2], [4], [1]}
[3].H = {[3], [6], [5]}
[4].H = {[4], [1], [2]}
[5].H = {[5], [3], [6]}
[6].H = {[6], [5], [3]}
It can be seen that [1].H = [2].H = [4].H; also [3].H = [5].H = [6].H; but [2].H and [3].H are disjoint sets.
From above description it can be obtained a partition of G:
{{[1], [2], [4]}, {[3], [6], [5]}}
It can be verified also that the set J = {[1], [6]} is another subgroup of G. The following are the left cosets for J:
[1].J = {[1], [6]}
[2].J = {[2], [5]}
[3].J = {[3], [4]}
[4].J = {[4], [3]}
[5].J = {[5], [2]}
[6].J = {[6], [1]}
In this case, [1].J = [6]. J, [2].J = [5].J, [3].J = [4].J; but the cosets  [6].J ,  [5].J and [3].J have not elements in common. It can be obtained the following partition of G: {{[1], [6]}, {[2], [5]}, {[3], [4]}}.
The described partitions can be obtained in a different way: starting with the subgroup H = {[1], [2], [4]}, take an element of G, not in H. If [3] is chosen, construct the left coset [3].H = {[3], [6], [5]}. There are not any elements of G that are not included in H or [3].H. So, the process has ended and a partition of G has been obtained: {{[1], [2], [4]}, {[3], [6], [5]}}.
Similarly, for the subgroup J = {[1], [6]}, an element of G not in J is [2]; the corresponding left coset is [2]. J = {[2], [5]}. Now, take another element of G, not in J or [2]. J; if [4] is chosen, [4]. J = {[4], [3]}. There are not any elements of G that are not included in J or [2]. J or [4]. J. So, the process has ended and a partition of G has been obtained: {{[1], [6]}, {[2], [5]}, {[3], [4]}}.
The last process described for above example can be generalized to obtain directly a partition of a given group G. If G is a group and H is a subgroup of it, take an element g1 of G, not in H and construct the left coset g1*H. Claim: H and g1*H are disjoint sets. To prove this (by contradiction), suppose that a belongs to H and g1*H. Then a = g1*h, for some h in H. As H is a group, h’, the inverse of h, is in H. Then a*h´ is in H. That is, g1 is in H. But this contradicts that the element g1 has been chosen out of H. The following note shows details.
Note: As a = g1*h, then a*h’ = (g1*h)*h’ = g1*(h*h’) = g1*e = g1. That is, a*h’ = g1.
Take an element g2 in G which is not in H or g1*H, and construct g2*H. It can be shown, as before, that H and g2*H are disjoint sets. Claim: g1*H an g2*H are disjoint sets too. This will be shown by contradiction.
Suppose that b is an element of G which belongs to g1*H and g2*h. Then b = g1*h1, for some h1 in H, and b = g2*h2, for some h2 in H.
From g1*h1 = g2*h2 it follows that (g1*h1)*h2’ = g2 and g1*(h1*h2’) = g2. As h1 and h2 are elements of subgroup H, h2’ is in H and h1*h2’ = h3, for some h3 in H.
It follows that g*h3 = g2 is in H. But this contradicts what has been supposed before: g2 is not in H.
With the same restrictions for g1, g2 there can be constructed the left cosets g3*H, …, gk*H, where g1, g2, … gk are elements of G and k is not greater than n.
In this process all the elements of G are used in the list of cosets without repetition as it occurred in the first construction of left cosets in above example.
If gr*H = gs*H for gr, gs in G, but not in H, or gr*H, or gs*H then gr*h1 = gs*h2 for some h1 and h2 in H. In this case, (gr*h1)*h2’ = gs, that is gr*(h1*h2’) = gs that is gr*ht = gs, for some ht in H. But then, gs is in gr*H, a contradiction with previous statement.
 As g1, g2, …, gk are chosen with the conditions above described, any two of the left cosets g1*H, g2*H, …, gk*H are disjoint sets.
The union of all the left cosets of H, is G, since each element of G have been used. In this process it has been obtained a partition of G.
If H has m elements, the left coset g*H has m elements too. This means that all the left cosets of H have the same number m of elements. The total number of left cosets (without repetitions) is k.
As G has n elements, and all of them have been used in the construction of the left cosets of H, it follows that m.k = n.
This result is known as Lagrange’s Theorem: If a finite group G has n elements, and H is a subgroup of it with m elements, then m is a factor of n.
In above discussion the concept of left coset of a subgroup has been used. It can be repeated using the concept of right coset. This is necessary, from a strict point of view, since this theorem is valid for a finite group G, abelian or not.






lunes, 22 de octubre de 2018

Series made from Fibonacci's


Variations on a Fibonacci's Theme

Starting with a Python program like the following, there can be obtained several other series.

Original series


Variation (1)



Variation (2)


Variation (3)


Variation (4)


Variation (5)


Variation (6)


Variation (7)


Variation(8)


miércoles, 15 de agosto de 2018

Some Polygonal Spirals

Polygonal Spirals

According with Oxford Advanced Genie Dictionary, a spiral is a shape or design, consisting of a continuous curved line that winds around a central point, with each curve further away from the centre.

In what follows there is a sample of spirals made of regular polygonal lines. Each one is associated with a regular polygon. As the number of sides increases it can be seen that the shape  tends to be a spiral in the sense of above definition.

In what follows some polygonal spirals are drawn using logo programs in Python 3.7 language. This program must be previously installed.


Triangular Spiral


# triang-spiral

from turtle import*
mode('logo')

for i in range(0, 30):     
    fd(10+4*i),lt(120)
Terminator


Square Spiral

# sqr-spiral
from turtle import*
mode('logo')

for i in range(0, 30):     
    fd(10+4*i),lt(90)
Terminator


Pentagon Spiral

#pent-spiral
from turtle import*
mode('logo')

for i in range(0, 30):     
    fd(10+4*i),lt(72)
Terminator






Hexagon Spiral

# hex-spiral
from turtle import*
mode('logo')

for i in range(0, 30):     
    fd(10+4*i),lt(60)
Terminator






Octagon Spiral

# octo-spiral
from turtle import*
mode('logo')

for i in range(0, 30):     
    fd(10+4*i),lt(45)
Terminator







Decagon Spiral

# deca-spiral
from turtle import*
mode('logo')

for i in range(0, 30):     
    fd(10+4*i),lt(36)
Terminator







20 Spiral

(From a regular 20 sides polygon)

# 20-spiral
from turtle import*
mode('logo')

for i in range(0, 30):     
    fd(10+i),lt(18)
Terminator




30 Spiral 

(From a regular 30 sides polygon)

# 30-spiral
from turtle import*
mode('logo')

for i in range(0, 50):     
    fd(5+.5*i),lt(12)
Terminator






The following program can be used to resume the above programs, giving particular values for 'n'

As it can be seen, the numbers 'k' in 'range(0, k)'  can be changed to obtain different sizes.

# poly-siyral
from turtle import*
mode('logo')
#n={3,4,5,8,9,10,12,20}

def polyspiral(n):
    for i in range(0, 30):   
        fd(10+4*i)
        lt(360//n)
#Replace 'n' in the following for a particular value
polyspiral(n)
             
Terminator

martes, 26 de junio de 2018

Some Regular Star Polygons

Regular Polygons and Star Polygons 

A  regular star polygon is a polygonal line whose vertices are vertices of a regular polygon. Their sides are line segments joining vertices of a regular polygon, skipping one or more of them, clockwise or counterclockwise.

The following are samples of star polygons made with logo programs in Python language.
The 3.7 Python program must be previously installed .

# 5-reg-star
from turtle import*
mode('logo')
for i in range(5):
    fd(100),lt(216)
Terminator

# 7-reg-star(1)
from turtle import*
mode('logo')
for i in range(7):
    fd(100),rt(102.9)
Terminator




# 7-reg-star(2)
from turtle import*
mode('logo')
for i in range(7):
    fd(100),rt(154.3)
Terminator

# 8-reg-star
from turtle import*
mode('logo')
for i in range(8):
    fd(100),rt(135)
Terminator

# 9-reg-star(1)
from turtle import*
mode('logo')
for i in range(9):
    fd(70),rt(80)
Terminator


# 9-reg-star(2)
from turtle import*
mode('logo')
for i in range(9):
    fd(70),rt(160)
Terminator


# 10-reg-star
from turtle import*
mode('logo')
for i in range(10):
    fd(100),rt(108)
Terminator




# 12-reg-star
from turtle import*
mode('logo')
for i in range(12):
    fd(100),rt(150)
Terminator






lunes, 25 de junio de 2018

Some Regular Polygons

Drawing Regular Polygons

In what follows some regular polygons are drawn using logo programs in Python 3.7 language. This program must be previously installed.

#Equilateral triangle
import cmd,sys
from turtle import*
color('black')
mode('logo')
for i in range(3):
    fd(100),lt(120)


 Terminator





#Square
import cmd,sys
from turtle import*
color('black')
mode('logo')
for i in range(4):
    fd(100), lt(90)
Terminator






# Regular Pentagon
import cmd,sys
from turtle import*
color('black')
mode('logo')
for i in range(5):
    fd(100), lt(72)
Terminator


#Regular Hexagon.
import cmd,sys
from turtle import*
color('black')
mode('logo')
for i in range(6):
    fd(50),lt(60)
Terminator


#Regular Octagon
import cmd,sys
from turtle import*
color('black')
mode('logo')
for i in range(8):
    fd(50),lt(45)
Terminator

#Regular Nonagon
import cmd,sys
from turtle import*
color('black')
mode('logo')
for i in range(10):
    fd(50),lt(40)
Terminator



#Regular Decagon
import cmd,sys
from turtle import*
color('black')
mode('logo')
for i in range(10):
    fd(50),lt(36)
Terminator


#Regular Dodecagon
import cmd,sys
from turtle import*
color('black')
mode('logo')
for i in range(12):
    fd(50),lt(30)
Terminator

miércoles, 6 de junio de 2018

Integer Pythagorean Triples


Pythagorean Triples

With positive integers

The following is a Python 3.7 program. It must be previously installed.

print('Type a positive integer')
integer=input()
integer=int(integer)
for a in range(1,integer):
    for b in range(1, integer):
        for c in range(1, integer):
            if a**2+b**2==c**2:
                if a <b<c                   
                    print([a,b,c])


Example (1): For numbers not greater than 8

Type a positive integer
8
[3, 4, 5]

Example (2): For numbers not grater than 30

Type a positive integer
30
[3, 4, 5]
[5, 12, 13]
[6, 8, 10]
[7, 24, 25]
[8, 15, 17]
[9, 12, 15]
[10, 24, 26]
[12, 16, 20]
[15, 20, 25]
[20, 21, 29]

Divisors of a positive integer

All the divisors...

of a positive integer

The following is a 3.7 Python program. It has to be previously installed

#Divisors of a positive integer
x=int(input('Type a positive integer  '))
for j in range(1,x+1):
    if x//j==x/j:
        print(j,end=',')
        j=j+1

Example (1): For 3780

Type a positive integer  3780
1,2,3,4,5,6,7,9,10,12,14,15,18,20,21,27,28,30,35,36,42,45,54,60,63,70,84,90,105,108,126,135,140,180,189,210,252,270,315,378,420,540,630,756,945,1260,1890,3780,

Example (2): For 3781

Type a positive integer  3781
1,19,199,3781,

Example 3: For 3701

Type a positive integer  3701
1,3701,