-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path2-Propiedades-de-campo-en-R.Rmd
122 lines (89 loc) · 2.51 KB
/
2-Propiedades-de-campo-en-R.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
title: "2. Conjuntos en R, propiedades de campo"
subtitle: "Facultad de Economía, UNAM"
author: "[Profesor: Cesar Gerardo Hernández Vargas](https://cghv94.github.io)"
date: "14/10/2020"
output: html_document
---
## 1. Propiedades de campo
### Creando los conjuntos `a`, `b`, `c`
```{r}
a<-1:10
a
```
```{r}
b<-5:15
b
```
```{r}
c<-10:20
c
```
## Comprobando las propiedades de campo
### I. Conmutatividad
### `aUb=bUa`
```{r}
aUb<-union(a,b)
aUb
```
```{r}
bUa<-union(b,a)
bUa
```
Comprobando la propiedad de conmutatividad con la función `setequal`:
```{r}
Conmutatividad1<-setequal(aUb,bUa)
Conmutatividad1
```
### `aIb=bIa`
```{r}
aIb<-intersect(a,b)
aIb
```
```{r}
bIa<-intersect(b,a)
bIa
```
Comprobando la propiedad de conmutatividad con la función `setequal`:
```{r}
Conmutatividad2<-setequal(aIb,bIa)
Conmutatividad2
```
### II. Asociatividad
### `aU(bUc)=bU(aUc)`
```{r}
bUc<-union(b,c)
aUbUc<-union(bUc,a)
aUbUc
```
```{r}
aUc<-union(a,c)
bUaUc<-union(aUc,b)
bUaUc
```
Comprobando la propiedad de asociatividad con la función `setequal`:
```{r}
Asociatividad<-setequal(aUbUc,bUaUc)
Asociatividad
```
### III. Distributividad
### `aI(bUc)=(aIb)U(aIc)`
```{r}
aIbUc<-intersect(a,bUc)
aIbUc
```
```{r}
aIb<-intersect(a,b)
aIc<-intersect(a,c)
aIbUaIc<-union(aIb,aIc)
aIbUaIc
```
Comprobando la propiedad de distributividad con la función `setequal`:
```{r}
Distributividad<-setequal(aIbUc,aIbUaIc)
Distributividad
```
## 2. Actividad de repaso:
¿Sabías que puedes programar R en la nube sin gastar tus horas de RStudio Cloud? Ingresa a [`https://rnotebook.io/`](https://rnotebook.io/), crea un R Notebook y comprueba las propiedades de campo con todos los conjuntos.
__________________________________________________________________________
<p style="font-size: 50%">Esta obra fue generada mediante R en `r format(Sys.Date(), format = "%B %d, %Y")` y forma parte de las actividades realizadas en las materias de [Matemáticas I y Taller III](https://mateytaller.github.io/), [Facultad de Economía, UNAM](http://economia.unam.mx/). </br>Esta obra está bajo una <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">licencia de Creative Commons Reconocimiento-NoComercial-CompartirIgual 4.0 Internacional. </a>[Creative Commons (CC)](http://creativecommons.org/licenses/by-nc-sa/4.0/).<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Licencia de Creative Commons" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/80x15.png" /></a></p>