Created
March 29, 2018 12:38
-
-
Save renexdev/5ad9ee11067a3df754e4eef6d2c46a98 to your computer and use it in GitHub Desktop.
Math sucessions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Dr. René Cejas Bolecek, 2018\n", | |
"Matemática 1 del Profesorado y Licenciatura en Cs. Biológicas de la Universidad de Comahue Regional Bariloche, Argentina" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Sucesiones teórico" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Suceción: i\n", | |
"valores de n: [2, 4, 6, 8, 10, 1, 3, 5, 7, 9]\n", | |
"valores de i (n): [20, 20, 20, 20, 20, 1, 9, 25, 49, 81]\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG7dJREFUeJzt3X+U1fV95/Hna36IZDAJ4MiCiuiGJceYRHCCpjqpiLbY\n5ARsTqm0NLSrcM6SGsm2qTRns6Y93ay7yckx24acgLHFkpVQFWRTl8RS3JDGYgawRiUcUnREBGZC\nYqJTM8yP9/5xv3gHHOZ7vzN37vde5vU4Z879fr/3++PN58C8+Xy+nx+KCMzMzIZSl3cAZmZW/Zws\nzMwslZOFmZmlcrIwM7NUThZmZpbKycLMzFI5WZiZWSonCzMzS+VkYWZmqRryDmAkzj///JgxY0be\nYZiZ1ZTdu3f/JCKas1xT08lixowZtLW15R2GmVlNkdSe9Ro3Q5mZWSonCzMzS+VkYWZmqZwszMws\nlZOFmZmlcrIwM7NUThZ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I+C7w09MOLwTWJ9vrgUWl3KsW\nk0XVTwuSB0kzgNnArnwjydW9wJ8AQ88jf/a7FOgE/jppkrtP0phcwjEiDgNfBF4CjgA/j4jv5BtV\n7qZExJFk+ygwpZSLajFZ2GkkTQAeBlZFxC/yjicPkj4CdETE7rxjqQINwBzgqxExG+iixKaGs03S\nHr+QQgKdBjRJWppvVNUjCt1hS+oSW4vJoqRpQcYKSY0UEsU3IuKRvOPJ0bXARyW9SKFp8gZJG/IN\nKTcvAy9HxMla5kMUksdYdCPwQkR0RkQP8AjwKznHlLdjkqYCJJ8dpVxUi8nC04IkJIlCu/S+iPhS\n3vHkKSL+NCIuiogZFP5O/GNEjMn/QUbEUeCQpJOTxc0Hns8xpDy9BFwj6W3Jv5f5jNGX/QNsBZYl\n28uAR0u5qKpGcJfC04Kc4lrg94AfSno6OfaZZCS8jW13AN9I/kN1EPiDnOPJRUTskvQQsIdC78G9\njKGR3JIeBK4Hzpf0MnA3cA+wSdJtQDuwuKR7eQS3mZmlqcVmKDMzqzAnCzMzS+VkYWZmqZwszMws\nlZOFmZmlcrIwM7NUThZmZpbKycKsjCTNSNaPWJesofAdSePzjstspJwszMpvJvCViHgP8CrwsZzj\nMRsxJwuz8nshIk5Ov7IbmJFjLGZl4WRhVn7dA7b7qME52MxO52RhZmapnCzMzCyVZ501M7NUrlmY\nmVkqJwszM0vlZGFmZqmcLMzMLJWThZmZpXKyMDOzVE4WZmaWysnCzMxS/X84Xx6hhJ4TLQAAAABJ\nRU5ErkJggg==\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7f6ada6f8748>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"import numpy as np\n", | |
"import matplotlib.pyplot as plt\n", | |
"from math import *\n", | |
"%matplotlib inline\n", | |
"\n", | |
"#Nmax de la sucesion\n", | |
"NMax = 10\n", | |
"#Change the label of the serie: a, b, etc\n", | |
"label = 'i'\n", | |
"\n", | |
"#Sucesiones\n", | |
"x = list(range(1,NMax+1))\n", | |
"y = np.zeros(NMax)\n", | |
"\n", | |
"if(label == 'a'):\n", | |
" y = list(x[i]**2 for i in range(len(x))) \n", | |
"if(label == 'b'):\n", | |
" y = list((-1)**i*x[i]**2 for i in range(len(x)))\n", | |
"if(label == 'c'):\n", | |
" y = list((2*x[i]-2)/(x[i]+1) for i in range(len(x)))\n", | |
"if(label == 'd'):\n", | |
" y = list(-2*x[i]+6 for i in range(len(x)))\n", | |
"if(label == 'e'):\n", | |
" y = list((-1)**x[i] for i in range(1,len(x)))\n", | |
"if(label == 'f'):\n", | |
" y = list((-0.5)**x[i] for i in range(len(x)))\n", | |
"if(label == 'g'):\n", | |
" y = list(sin(x[i]*pi/4.) for i in range(len(x)))\n", | |
"if(label == 'h'):\n", | |
" y = list(4+1/x[i] for i in range(len(x)))\n", | |
"if(label == 'i'):\n", | |
" xa = list( x[i] for i in range(len(x)) if(i%2==1))\n", | |
" xb = list( x[i] for i in range(len(x)) if(i%2==0))\n", | |
" yi_a = list( 20 for i in range(len(x)) if(i%2==1))\n", | |
" yi_b = list( x[i]**2 for i in range(len(x)) if(i%2==0))\n", | |
" x = xa+xb\n", | |
" y = yi_a+yi_b\n", | |
"\n", | |
"tags=['$n^2$','$(-1)^n\\,n^2$','$(2n-2)/(n+1)$','$-2n+6$','$(-1)^n$','$(-0.5)^n$','$\\sin(n*\\pi/4)$','$4+1/n$','20 si n par y $n^2 si n impar$']\n", | |
"print('Suceción:',label)\n", | |
"print('valores de n:',x)\n", | |
"print('valores de ',label,'(n): ',y)\n", | |
"\n", | |
"labelDic = {'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7,'i':8}\n", | |
"labelId = labelDic[label]\n", | |
"\n", | |
"plt.ylabel(tags[labelId])\n", | |
"plt.plot(x, y, 'o', markersize = 10)\n", | |
"plt.plot([0,NMax], [0,0], '-',color='k', lw =0.5)\n", | |
"\n", | |
"plt.ylim([0, max(y)+0.1*max(y)])\n", | |
"\n", | |
"plt.xlim(0, NMax)\n", | |
"\n", | |
"plt.xlabel('n')\n", | |
"plt.savefig(label+'_n.jpg')\n", | |
"\n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"celltoolbar": "Raw Cell Format", | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.6.1" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment