untitled

Size: px
Start display at page:

Download "untitled"

Transcription

1 (3 r, a (3 a/2 E[Z] = a a 0 tdt = a a 3a 0 tdt a 4 a 0 tdt E[z] = 3 4 = 5 8 a E[z] = r ra = 2 a(2r2 2r + E[z] =a ra tdt + r ( ra 0 ( ra tdt ( (2 (3 (4 (5 0

2 0 E[z] = T 0 t T dt = 2 T =5 T =

3 ans.tex lec2

4 95907 (7+3/2=0 (

5 JR JR JR

6 Ω Ω F Ω F φ Ω φ F A i F i =, 2,, A i φ A i [ ] P A n = P [A n ] n= n= P [φ] P [φ] = P [φ] n= = P [φ]+p[φ]+ P [φ] =0 P [φ] =0 φ F P [φ] P F P [φ] =P [φ]+p[φ]+ P [φ] = A n A A n = 2 n 3 n ( n 2 = 3 P [A] = lim P [A n] n ( n 2 = lim n 3 = 0

7 (V [X] =E[X 2 ] E[X] 2 V [X] = E[(X E[X] 2 ] = E[X 2 2XE[X]+E[X] 2 ] = E[X 2 ] 2E[XE[X]] + E[E[X] 2 ] = E[X 2 ] 2E[X]E[X]+E[X] 2 E[] = E[X 2 ] E[X] 2 (2a V [ax] =a 2 V [X] V [ax] = E[a 2 X 2 ] E[aX] 2 = a 2 E[X 2 ] (ae[x] 2 = a 2 (E[X 2 ] E[X] 2 = a 2 V [X] (3X Y V [X + Y ]=V [X]+V [Y ] V [X + Y ] = V [X]+V [Y ]+2E[(X E[X](Y E[Y ]] X Y (X E[X] (Y E[Y ] V [X + Y ] = V [X]+V[Y]+2E[X E[X]]E[Y E[Y ]] = V [X]+V[Y]+2(E[X] E[E[X]](E[Y ] E[E[Y ]] = V [X]+V[Y] (3 X Y (X E[X] (Y E[Y ] (4.6 n =2,f (x = x E[X], f 2 (x =x E[Y ], X = X, X 2 = Y, (4.6

8 n =2,f (x =f 2 (x =x, X = X, X 2 = Y, E[ XY ]=E[X ]E[Y ] E[(X E[Y ](Y E[Y ]] = E[XY E[X]Y E[Y ]X + E[X]E[Y ]] = E[XY ] E[X]E[Y ] E[Y ]E[X]+E[X]E[Y] (E[X],E[Y ] = E[XY ] E[X]E[Y ] = E[X]E[Y ] E[X]E[Y ] = 0 (2 ( (3 V [X + Y ] = V [X]+V[Y]+2E[(X E[X](Y E[Y ]] ( 2

9 X n (ω =X n (ω+ω n, n =, 2, 3,, ω =(ω,ω 2, Ω ω,. (i.n =. E[ X ] = E[ X 0 ]+E[ω ] = ( = 0 (ii.n = k,e[ X k ]=0, E[ X k ] = E[ X k ]+E[ω k ] = 0 (iii.n = k +, E[ X k+ ] = E[ X k ]+E[ω k+ ] = E[ X k ]+0 ( E[ ω k+ ]=0 = 0,E[ X n ]=0. n,. X n = n X n = n n E[X n ] = 2 n + 2 ( n = 0

10 E[X n ] E[X n ] 0 E[X n ]=E[x n ] X n = X n Mathematica source program : Suiho[time_]:= 2: Module[{d0,e0,time0,list,listxy,g, 3: d0=0; 4: e0=0; 5 time0=time; 6: SeedRandom[]; 7: list=table[random[integer]*2-,{t,,time0]; 8: listx=table[d0+=list[[i]],{i,,time0]; 9: listxy=table[{i,e0+=list[[i]],{i,,time0]; 0: fp="list.dat"; : OpenWrite[fp,FormatType->TextForm]; 2: Write[fp,listxy ]; 3: Close[fp]; 4: g=listplot[listx,axeslabel->{"time","value",plotjoined->true]; 5: Return[listx]; 6: ]; (Suiho,, 7 list=, ±, 8 list=, 9 3,, list.dat 4 g=, 0,,, n, X n /n 0 2

11 (5.5 (5.7 (4.3 n ω n Ω ω n E[X n F n ] E[X n X,X 2,,X n ] X, X 2,, X n X n n X n X, X 2,, X n E[X n X, X 2,, X n ]=X n n n n X n /2 X n X n {X n X n = X n E[X n F n ] X, X 2,, X n X n source program Mathematica RW[n_Integer] := ListPlot[FoldList[Plus,0,Table[Sign[Random[ ] - /2],{n]],PlotJoined -> True] C C++ C Mathematica ( 0,,

12 n, x n n 0 n X n X n /n 0 n X n /n a 0 <a< 0 a =/2 a = a =0 source program 4

13 Poisson (I (6.2 Poisson (6. i=0 µ i i! (II n=0 Q[{n] = Poisson (6. n=0 µ n n! nq[{n] = n=0 = = = exp(µ n=0 = µ n=0 n= n= n µn n! exp( µ µ n (n! exp( µ µ µ n (n! exp( µ i=0 µ i i! exp( µ nq[{n] =µ exp(µ exp( µ =µ. n=0 Q[{n] = exp( µ n! µn = exp( µ n=0 = exp(µ Q[{n] = exp( µ exp(µ =. n=0 (III 0 ρ λ (tdt = /λ (6.4 0 ρ λ (tdt = = λ = λ 0 λ exp( λtdt 0 exp( λtdt [ λ exp( λt ] 0 n=0 µ n n!

14 = λ { (0 λ = λ λ = 0 t ρ λ (tdt = = λ 0 0 t λ exp( λtdt t exp( λtdt ( λ t exp( λtdt = λ t 0 0 λ exp( λt ([ = λ t exp( λt ] λ 0 0 = [ t exp( λt] 0 + = 0+ (0 λ = λ 0 (IV /λ T P [T a] dt exp( λt dt λ exp( λtdt P [T a] = a ρ λ (tdt = λ exp( λtdt a [ = λ λ exp( λt = λ = exp( λa ] ( (0 exp( λa λ a Poisson X t sample path X t X s Event T Event T /* */ /* Poisson sample path by 944 */ /* */ #include <stdio.h> 2

15 #include <stdlib.h> #include <math.h> #define P 0.5 #define DN #define RAND( ((doublerand(/( void data_save(double *, double *, long int, char *; int main( { long int n,n,sd; double u; double *Num, *Xdata; char sname[30]; N=60; Num = (double *calloc(dn,sizeof(double; if( Num == NULL { printf(" Num error!!!\n"; exit(; Xdata = (double *calloc(dn,sizeof(double; if( Xdata == NULL { printf(" Xdata error!!!\n"; exit(; printf(" SEED =" ; scanf("%ld",&sd ; /* */ sprintf(sname,"%dq2.dat",sd; srand(sd; for(n=;n<n+;n++ { u = -log(rand(; Num[n]=Num[n-]+u; Xdata[n]=Xdata[n-]+.0; data_save(num, Xdata, n-, sname; return 0; void data_save(double *x, double *x2, long int nn, char *sname { long int ii; FILE *fd; fd = fopen(sname,"w"; for(ii = 0; ii <= nn-; ii++{ fprintf(fd,"%3.2lf %9.6lf\n",*(x+ii,*(x2+ii; fclose(fd; /* */ /* by 944 */ /* */ #include <stdio.h> #include <stdlib.h> #include <math.h> #define P 0.5 #define DN #define RAND( ((doublerand(/(

16 void data_save(double *, double *, long int, char *; int main( { long int s,n,n,sd,g,f,t; double u,t; double *Num, *Xdata, *Mdata; char sname[30]; N=200; Num = (double *calloc(dn,sizeof(double; if( Num == NULL { printf(" Num error!!!\n"; exit(; Xdata = (double *calloc(dn,sizeof(double; if( Xdata == NULL { printf(" Xdata error!!!\n"; exit(; Mdata = (double *calloc(dn,sizeof(double; if( Mdata == NULL { printf(" Mdata error!!!\n"; exit(; printf(" SEED =" ; scanf("%ld",&sd ; /* */ printf(" s =" ; scanf("%ld",&s ; printf(" t =" ; scanf("%ld",&t ; sprintf(sname,"%ld%ldq22.dat",s/0,t/0; srand(sd; for(g=; g<50; g++{ T = 0.0; for(n=;n<n+;n++ { u = -log(rand(; T = T + u; if( T >= s && T < t { Xdata[g]=Xdata[g]+.0; for(g=;g<50;g++{ f = (long intxdata[g]; Num[f] = f; Mdata[f] = Mdata[f]+.0; data_save(num, Mdata, N, sname; return 0; void data_save(double *x, double *x2, long int nn, char *sname { long int ii; FILE *fd; fd = fopen(sname,"w"; for(ii = 0; ii <= nn-; ii++{ fprintf(fd,"%3.2lf %9.6lf\n",*(x+ii,*(x2+ii; fclose(fd; Poisson X t sample path Event X t 4

17 (s, t] X t X s T 200 Event (80,00] (50,50] (s,t] /* --- (report6.c * Copyright (C Hideki Nakamura */ #include <stdio.h> #include <stdlib.h> #include <math.h> #define frand( ((double rand(/(pow(2,3+ /* */ /* */ void usage(char *name { fprintf(stderr,"usage: %s[-n<number>][-f<number>][-t<number>]\n",name; fprintf(stderr," -n< > <default:20>\n"; fprintf(stderr," -f< > <default:>\n"; fprintf(stderr," -t< > <default:00>\n"; exit(; /* */ void random(int N, int first,int T { int i,j,k,x; double X2,V; srand(first; /* */ for(k=;k<=n;k++{ X2=0; V=0; for(j=;j<=t;j++{ X=0; for(i=;i<=k;i++{ /* X(n */ if(frand(<0.5 X+=; else X-=; X2=X2+pow(X,2; /* X(n^2 */ V=X2/T; /* Vn ( */ printf("%d %f\n",k,v; /* */ void main(int argc, char *argv[] 5

18 { int N=20; int T=00; int first=; /* default */ char *name; static char option[]="n:n:f:f:t:t"; name=argv[0]; if(argc > 4 usage(name; while((argc > &&(argv[][0] == - { switch(argv[][]{ case n : case N : N=atoi(&argv[][2]; break; case f : case F : first=atoi(&argv[][2]; break; case t : case T : T=atoi(&argv[][2]; break; default: usage(name; exit(; argc--; argv++; random(n,first,t; T=0000, N=000, n=0 T=00, N=00, n=0 T Vn= n sample X sample n = 50, 3, T =0, 30, 50, 00, 300, 500, 000, 3000, , 4 6 2, 7 9 3, 0 T = V n X n V n, n T V n = n 6

19 Poisson sample path Wiener sample path smaple path X t X s Poisson Poisson s, t Poisson (help T T 0000 V n T = 0000 / T =% V n = n V n = an a (V n {X i, i =, 2, 3,,n A S=0 do 0 i=,n S=S+X_i 0 continue A=S/n n A=X_ do 0 i=2,n A=A+(X_i-A/i 0 continue 7

20 8

21 Wiener ( (2 (3, (, Wiener = 2π v v 2 2πv 2πv2 exp ( exp 2 ( (x z m 2 + (z y m v v 2 = (( + z v v 2 ( (x z m 2 exp 2v ( (x z m 2 + (z y m 2 2 v v 2 dz ( x m v + y + m 2 v 2 ( (z y m 2 2 dz 2v 2 dz ( ( (x m 2 z + + (y + m 2 2 v v 2 (2 2 ( a(z b2 + c = 2 ( az2 +2abz ab 2 + c (3 (2 (3 a, b, c a ( a = + v v 2 b v + v 2 v v 2 b = = (2 = v + v 2 v v 2. (4 ( x m + y + m 2. v v 2 ( (x m v 2 +(y + m 2 v v v 2 b = (x m v 2 +(y + m 2 v v + v 2

22 c c = v + v 2 v v 2 ( (x m v 2 +(y + m 2 v v + v 2 2 (x m 2 v (y + m 2 2 v 2 = (x m 2 v v 2 2(x m (y + m 2 v v 2 +(y + m 2 2 v v 2 v v 2 (v + v 2 = ((x m (y + m 2 2. v + v 2 ( 2π exp ( ((x m +(y + m 2 2 v v 2 2(v + v 2 exp ( a(z b 2 2 dz (5 (4 ( 2π exp 2 ( a(z b2 dz = a ( v v 2 2πv v 2 2π = v + v 2 v + v 2 (5 ( 2π 2πv v 2 exp ( ((x y (m + m 2 2 v v 2 v + v 2 2(v + v 2 ( = 2π(v + v 2 exp ((x y (m + m 2 2 2(v + v 2 M = m + m 2 V = v + v 2 m = m 2 =0,v = t u, v 2 = u s, ρ 0,t s (x y abc PUT 40 IN r PUT r/2 IN rr PUT 8/r IN rrr PUT 00 IN c PUT 000 IN n PUT 40/n IN nn PUT c**(-/2 IN cc PUT { IN z FOR i IN {0..r: PUT 0 IN z[i] FOR i IN {..n: PUT 0 IN x 2

23 FOR j IN {..c: PUT floor(random*2 IN p PUT p*2-+x IN x PUT x*cc IN x PUT floor(x/rrr+rr IN x IF x>=0 AND x<=r: PUT z[x]+ IN z[x] FOR i IN {0..r: WRITE "(", (i-rr*rrr, ",", z[i]*nn, "%" / QUIT C C Mathematica <<Statistics NormalDistribution ; Yk = Table[Random[NormalDistribution[0,]],{i,,000]; Xnt = Sum[(Sin[n*t]/n*Yk[[n]],{n,,000]; Xt = Sqrt[2/Pi]*Xnt; Plot[Xnt,{t,0,Pi, Frame -> True, AxesLabel -> {"t","xt", PlotLabel -> "N = 000"]; NormalDistribution[0,] X N,t a Wiener s y Wiener t y ρ 0,t s (x y u s y Wiener u z t y z u 3

24 abc > N N N =0 Y 0 Y 0 Y n lec7 Y Y 00 N = 00 N t= X N t= Y 0 Y 0 X(0 = X(π =0 0 0 Brownian bridge Y 0 Brownian bridge Wiener 4

25 Simple random walk self-avoiding walk Self-avoiding walk #include <stdio.h> void now(; void next(; void back(; int i,j; /* */ int k; /* */ int c; /* */ char **z; /* */ int *walk; /* */ int n; /* */ char root= 0 ; /* (off:0,on: */ /* */ /* */ /* */ void shift(int s,int *si,int *sj { switch (s { case : *si = *si-; break; case 2: *sj = *sj-; break; case 3: *si = *si+; break; case 4: *sj = *sj+;

26 /* */ /* */ /* */ void open( { int s,t; t=2*n-; if (NULL==(z=(char **malloc((sizeof (char **t printf("not open z."; for (s=0;s<t;s++ if (NULL==(z[s]=(char *malloc(t printf("not open z."; if (NULL==(walk=(int *malloc((sizeof (int*n printf("not open walk."; /* */ /* */ /* */ void init( { int s,t,u; u=2*n-; for (s=0;s<u;s++ for (t=0;t<u;t++ z[s][t]= 0 ; for (s=0;s<=u;s++ walk[s]=; i=n-; j=n-; z[i][j]= ; /* */ if (n> z[i+][j]= ; /* */ k=0; c=0; /* */ /* */ /* */ void now( { int m; if ((k==n- (5==walk[k]{ if (k==n- { c++; if (root== { for (m=0;m<n-;m++ printf("%d.",walk[m]; printf("\n"; z[i][j]= 0 ; walk[k]=; k--; if (k>=0 { back(; walk[k]++; 2

27 else next(; /* */ /* */ /* */ void back( { int t; switch (walk[k] { case : shift(3,&i,&j; break; case 2: shift(4,&i,&j; break; case 3: shift(,&i,&j; break; case 4: shift(2,&i,&j; break; /* */ /* */ /* */ void next( { int ni,nj; while (walk[k]<5 { ni=i; nj=j; shift(walk[k],&ni,&nj; if ( 0 ==z[ni][nj] { i=ni; j=nj; z[i][j]= ; k++; now(; else walk[k]++; /* */ /* */ /* */ main( { printf(" \n"; scanf("%d",&n; open(; init(; while (k>=0 now(; c*=4; printf(" C(%i = %i\n",n,c; 3

28 /* by norichi */ /* H */ #define D 00 /* D > 5 */ #include <stdio.h> void walk(int, int, int; int count=0; int array[d][d]; int Num=0; void main(void { int box; box = (D-/2; printf("input number N (<=%d >> ",box; scanf("%d",&num; if (Num<=2{ if (Num== printf("c_ = 4!! \n"; else printf("c_2 = 2!! \n"; else{ array[box][box]=2; array[(box-][box]=2; array[(box-2][box]=; walk(box,(box-2,2; array[(box-2][box]=0; array[(box-][(box+]=; walk((box+,(box-,2; array[(box-][(box+]=0; array[(box-][(box-]=; walk((box-,(box-,2; printf(" C_%d = %d!! \n ",Num,(count*4; printf("all Over!!\n"; exit(99; void walk(int x,int y,int n { int box; if (n == Num{ count=count+; else{ box = array[y-][x]; if (box==0{ array[y-][x]=; walk(x,(y-,(n+; array[y-][x]=0; 4

29 box = array[y][x+]; if (box==0{ array[y][x+]=; walk((x+,y,(n+; array[y][x+]=0; box = array[y+][x]; if (box==0{ array[y+][x]=; walk(x,(y+,(n+; array[y+][x]=0; box = array[y][x-]; if (box==0{ array[y][x-]=; walk((x-,y,(n+; array[y][x-]=0; return; MAP(0: : 2: C N ( = exp ( (x y2 t 2π(t s 2(t s = ( 2π 2 (t s 3 (x y2 2 exp ( 2(t s ( (x y2 = exp ( 2π(t s 2(t s 2(t s ( = ρ(s, y, t, x ρ(s, y, t, x x = = = = (x y2 2(t s 2(t s 2 exp ( 2π(t s (x y 2π(t s 3 2 2π(t s 3 2 2π(t s exp (x y2 2(t s (x y2 exp ( exp ( 2(t s + exp ( 2π(t s (x y2 2(t s 2 ( x y t s (x y2 + 2(t s ( (x y2 ( 2(t s (t s ( (x y2 = ρ(s, y, t, x (t s (t s 2 (x y 2π(t s 3 2 (x y2 (t s 2 exp ( (x y2 2(t s (x y2 2(t s ( (x y 2 2(t s 2 ( x y t s 5

30 A = 2 d ρ(s, y, t, x = d exp d ( (x i y i 2 2π (t s 2(t s i= ( ρ(s, y, t, x = d t 2 {2π(t d s( 2 d (2π exp (x i y i 2 2(t s i= ( + d exp d ( (x i y i 2 d 2π (t s 2(t s 2(t s 2 (x i y i 2 i= i= ( = d d ρ(s, y, t, x+ 2(t s 2(t s 2 (x i y i 2 ρ(s, y, t, x i= ( = d 2 (t s 2 (x i y i 2 d ρ(s, y, t, x t s i= d ( 2 (xi y i 2 ρ(s, y, t, x = (t s 2 ρ(s, y, t, x t s = i= ( (t s 2 d i= (x i y i 2 d t s ρ(s, y, t, x t ρ(s, y, t, x = 2 2 ρ(s, y, t, x self-avoiding walk N N =20 C =4,C 2 = 2, C 3 = 36, C 4 = 00, C 5 = 284, C 6 = 780, C 7 = 272, C 8 = 596, C 9 = 6268, C 0 = 4400, C = 20292, C 2 = , C 3 = 88500, C 4 = , C 5 = , C 6 = , C 7 = , C 8 = , C 9 = , C 20 = Neal Madras, Gordon Slade, The Self-Avoiding Walk, (Birkhauser, Boston, 993 N =34 C N C 25 = , C 34 = N =5 C C =4 C 2 C C 2 = C 3=4 3=2 C 3 = C 2 3=2 3=36 C 4 C 3 8 C 4 =(C = = = 00 6

31 C 5 C 4 6 C 5 =(C = = = 284 N 6 C N N N d V n, V n = n, V n n 50 ( = n V n, V n n V n n 0,, V n n χ 2 n sample w (n 0 (n, X n (w (n n WS (law of iterated logarithm wiener c /2 Z [ct] t (t = c /2 Z [ct] n= 7

( )/2 hara/lectures/lectures-j.html 2, {H} {T } S = {H, T } {(H, H), (H, T )} {(H, T ), (T, T )} {(H, H), (T, T )} {1

( )/2   hara/lectures/lectures-j.html 2, {H} {T } S = {H, T } {(H, H), (H, T )} {(H, T ), (T, T )} {(H, H), (T, T )} {1 ( )/2 http://www2.math.kyushu-u.ac.jp/ hara/lectures/lectures-j.html 1 2011 ( )/2 2 2011 4 1 2 1.1 1 2 1 2 3 4 5 1.1.1 sample space S S = {H, T } H T T H S = {(H, H), (H, T ), (T, H), (T, T )} (T, H) S

More information

Part () () Γ Part ,

Part () () Γ Part , Contents a 6 6 6 6 6 6 6 7 7. 8.. 8.. 8.3. 8 Part. 9. 9.. 9.. 3. 3.. 3.. 3 4. 5 4.. 5 4.. 9 4.3. 3 Part. 6 5. () 6 5.. () 7 5.. 9 5.3. Γ 3 6. 3 6.. 3 6.. 3 6.3. 33 Part 3. 34 7. 34 7.. 34 7.. 34 8. 35

More information

A B P (A B) = P (A)P (B) (3) A B A B P (B A) A B A B P (A B) = P (B A)P (A) (4) P (B A) = P (A B) P (A) (5) P (A B) P (B A) P (A B) A B P

A B P (A B) = P (A)P (B) (3) A B A B P (B A) A B A B P (A B) = P (B A)P (A) (4) P (B A) = P (A B) P (A) (5) P (A B) P (B A) P (A B) A B P 1 1.1 (population) (sample) (event) (trial) Ω () 1 1 Ω 1.2 P 1. A A P (A) 0 1 0 P (A) 1 (1) 2. P 1 P 0 1 6 1 1 6 0 3. A B P (A B) = P (A) + P (B) (2) A B A B A 1 B 2 A B 1 2 1 2 1 1 2 2 3 1.3 A B P (A

More information

‚æ4›ñ

‚æ4›ñ ( ) ( ) ( ) A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 (OUS) 9 26 1 / 28 ( ) ( ) ( ) A B C D Z a b c d z 0 1 2 9 (OUS) 9

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裵²ó ¨¡ À©¸æ¹½Â¤¡§¾ò·ïʬ´ô ¨¡

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裵²ó  ¨¡ À©¸æ¹½Â¤¡§¾ò·ïʬ´ô ¨¡ (2018) 2018 5 17 0 0 if switch if if ( ) if ( 0) if ( ) if ( 0) if ( ) (0) if ( 0) if ( ) (0) ( ) ; if else if ( ) 1 else 2 if else ( 0) 1 if ( ) 1 else 2 if else ( 0) 1 if ( ) 1 else 2 (0) 2 if else

More information

6.1 (P (P (P (P (P (P (, P (, P.

6.1 (P (P (P (P (P (P (, P (, P. (011 30 7 0 ( ( 3 ( 010 1 (P.3 1 1.1 (P.4.................. 1 1. (P.4............... 1 (P.15.1 (P.16................. (P.0............3 (P.18 3.4 (P.3............... 4 3 (P.9 4 3.1 (P.30........... 4 3.

More information

6.1 (P (P (P (P (P (P (, P (, P.101

6.1 (P (P (P (P (P (P (, P (, P.101 (008 0 3 7 ( ( ( 00 1 (P.3 1 1.1 (P.3.................. 1 1. (P.4............... 1 (P.15.1 (P.15................. (P.18............3 (P.17......... 3.4 (P................ 4 3 (P.7 4 3.1 ( P.7...........

More information

II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C main main 1 NULL NULL for 2 (a) Yacc 2 (b) 2 3 y

II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C main main 1 NULL NULL for 2 (a) Yacc 2 (b) 2 3 y II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C 1 6 9 1 main main 1 NULL NULL 1 15 23 25 48 26 30 32 36 38 43 45 47 50 52 for 2 (a) 2 2 1 Yacc 2 (b) 2 3 yytext tmp2 ("") tmp2->next->word tmp2 yytext tmp2->next->word

More information

1 4 2 EP) (EP) (EP)

1 4 2 EP) (EP) (EP) 2003 2004 2 27 1 1 4 2 EP) 5 3 6 3.1.............................. 6 3.2.............................. 6 3.3 (EP)............... 7 4 8 4.1 (EP).................... 8 4.1.1.................... 18 5 (EP)

More information

PowerPoint Presentation

PowerPoint Presentation p.130 p.198 p.208 2 double weight[num]; double min, max; min = max = weight[0]; for( i= 1; i i < NUM; i++ ) ) if if ( weight[i] > max ) max = weight[i]: if if ( weight[i] < min ) min = weight[i]: weight

More information

新版明解C言語 実践編

新版明解C言語 実践編 2 List - "max.h" a, b max List - max "max.h" #define max(a, b) ((a) > (b)? (a) : (b)) max List -2 List -2 max #include "max.h" int x, y; printf("x"); printf("y"); scanf("%d", &x); scanf("%d", &y); printf("max(x,

More information

comment.dvi

comment.dvi ( ) (sample1.c) (sample1.c) 2 2 Nearest Neighbor 1 (2D-class1.dat) 2 (2D-class2.dat) (2D-test.dat) 3 Nearest Neighbor Nearest Neighbor ( 1) 2 1: NN 1 (sample1.c) /* -----------------------------------------------------------------

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2018 2018 08 02 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF N N y N x N xy yx : yxxyxy N N x, y N (parse tree) (1) yxyyx (2) xyxyxy (3) yxxyxyy (4) yxxxyxxy N y N x N yx

More information

untitled

untitled II yacc 005 : 1, 1 1 1 %{ int lineno=0; 3 int wordno=0; 4 int charno=0; 5 6 %} 7 8 %% 9 [ \t]+ { charno+=strlen(yytext); } 10 "\n" { lineno++; charno++; } 11 [^ \t\n]+ { wordno++; charno+=strlen(yytext);}

More information

2008 ( 13 ) C LAPACK 2008 ( 13 )C LAPACK p. 1

2008 ( 13 ) C LAPACK 2008 ( 13 )C LAPACK p. 1 2008 ( 13 ) C LAPACK LAPACK p. 1 Q & A Euler http://phase.hpcc.jp/phase/mppack/long.pdf KNOPPIX MT (Mersenne Twister) SFMT., ( ) ( ) ( ) ( ). LAPACK p. 2 C C, main Asir ( Asir ) ( ) (,,...), LAPACK p.

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裶²ó ¨¡ À©¸æ¹½Â¤¡§·«¤êÊÖ¤· ¨¡

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裶²ó  ¨¡ À©¸æ¹½Â¤¡§·«¤êÊÖ¤· ¨¡ (2018) 2018 5 24 ( ) while ( ) do while ( ); for ( ; ; ) while int i = 0; while (i < 100) { printf("i = %3d\n", i); i++; while int i = 0; i while (i < 100) { printf("i = %3d\n", i); i++; while int i =

More information

‚æ2›ñ C„¾„ê‡Ìš|

‚æ2›ñ C„¾„ê‡Ìš| I 8 10 10 I ( 6 ) 10 10 1 / 23 1 C ( ) getchar(), gets(), scanf() ( ) putchar(), puts(), printf() 1 getchar(), putchar() 1 I ( 6 ) 10 10 2 / 23 1 (getchar 1 1) 1 #include 2 void main(void){ 3 int

More information

新・明解C言語 ポインタ完全攻略

新・明解C言語 ポインタ完全攻略 2 1-1 1-1 /* 1-1 */ 1 int n = 100; int *p = &n; printf(" n %d\n", n); /* n int */ printf("*&n %d\n", *&n); /* *&n int */ printf(" p %p\n", p); /* p int * */ printf("&*p %p\n", &*p); /* &*p int * */ printf("sizeof(n)

More information

C¥×¥í¥°¥é¥ß¥ó¥° ÆþÌç

C¥×¥í¥°¥é¥ß¥ó¥° ÆþÌç C (3) if else switch AND && OR (NOT)! 1 BMI BMI BMI = 10 4 [kg]) ( [cm]) 2 bmi1.c Input your height[cm]: 173.2 Enter Input your weight[kg]: 60.3 Enter Your BMI is 20.1. 10 4 = 10000.0 1 BMI BMI BMI = 10

More information

tuat1.dvi

tuat1.dvi ( 1 ) http://ist.ksc.kwansei.ac.jp/ tutimura/ 2012 6 23 ( 1 ) 1 / 58 C ( 1 ) 2 / 58 2008 9 2002 2005 T E X ptetex3, ptexlive pt E X UTF-8 xdvi-jp 3 ( 1 ) 3 / 58 ( 1 ) 4 / 58 C,... ( 1 ) 5 / 58 6/23( )

More information

renshumondai-kaito.dvi

renshumondai-kaito.dvi 3 1 13 14 1.1 1 44.5 39.5 49.5 2 0.10 2 0.10 54.5 49.5 59.5 5 0.25 7 0.35 64.5 59.5 69.5 8 0.40 15 0.75 74.5 69.5 79.5 3 0.15 18 0.90 84.5 79.5 89.5 2 0.10 20 1.00 20 1.00 2 1.2 1 16.5 20.5 12.5 2 0.10

More information

XMPによる並列化実装2

XMPによる並列化実装2 2 3 C Fortran Exercise 1 Exercise 2 Serial init.c init.f90 XMP xmp_init.c xmp_init.f90 Serial laplace.c laplace.f90 XMP xmp_laplace.c xmp_laplace.f90 #include int a[10]; program init integer

More information

..3. Ω, Ω F, P Ω, F, P ). ) F a) A, A,..., A i,... F A i F. b) A F A c F c) Ω F. ) A F A P A),. a) 0 P A) b) P Ω) c) [ ] A, A,..., A i,... F i j A i A

..3. Ω, Ω F, P Ω, F, P ). ) F a) A, A,..., A i,... F A i F. b) A F A c F c) Ω F. ) A F A P A),. a) 0 P A) b) P Ω) c) [ ] A, A,..., A i,... F i j A i A .. Laplace ). A... i),. ω i i ). {ω,..., ω } Ω,. ii) Ω. Ω. A ) r, A P A) P A) r... ).. Ω {,, 3, 4, 5, 6}. i i 6). A {, 4, 6} P A) P A) 3 6. ).. i, j i, j) ) Ω {i, j) i 6, j 6}., 36. A. A {i, j) i j }.

More information

r07.dvi

r07.dvi 19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1

More information

ohp07.dvi

ohp07.dvi 19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5

More information

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 新装版 1 刷発行時のものです.

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます.  このサンプルページの内容は, 新装版 1 刷発行時のものです. C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. http://www.morikita.co.jp/books/mid/009383 このサンプルページの内容は, 新装版 1 刷発行時のものです. i 2 22 2 13 ( ) 2 (1) ANSI (2) 2 (3) Web http://www.morikita.co.jp/books/mid/009383

More information

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 1. 1.1. 1.2. 1 PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU 2. 2.1. 2 1 2 C a b N: PC BC c 3C ac b 3 4 a F7 b Y c 6 5 a ctrl+f5) 4 2.2. main 2.3. main 2.4. 3 4 5 6 7 printf printf

More information

実際の株価データを用いたオプション料の計算

実際の株価データを用いたオプション料の計算 2002 2 20 1 1 3 2 3 2.1 : : : : : : : : : : : : : : : : : : : : : : : : : : : : 5 2.1.1 : : : : : : : : : : : : : : : : : : : : 5 2.1.2 : : : : : : : : : : : : : : : : : : : : 6 2.2 : : : : : : : : : :

More information

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* (

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* ( 2016 2016 07 28 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF : 11011 N N 0 N N 11 1001 N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) 1100100 (2) 1111011 (3) 1110010 (4) 1001011

More information

Microsoft Word - C.....u.K...doc

Microsoft Word - C.....u.K...doc C uwêííôöðöõ Ð C ÔÖÐÖÕ ÐÊÉÌÊ C ÔÖÐÖÕÊ C ÔÖÐÖÕÊ Ç Ê Æ ~ if eíè ~ for ÒÑÒ ÌÆÊÉÉÊ ~ switch ÉeÍÈ ~ while ÒÑÒ ÊÍÍÔÖÐÖÕÊ ~ 1 C ÔÖÐÖÕ ÐÊÉÌÊ uê~ ÏÒÏÑ Ð ÓÏÖ CUI Ô ÑÊ ÏÒÏÑ ÔÖÐÖÕÎ d ÈÍÉÇÊ ÆÒ Ö ÒÐÑÒ ÊÔÎÏÖÎ d ÉÇÍÊ

More information

[1] #include<stdio.h> main() { printf("hello, world."); return 0; } (G1) int long int float ± ±

[1] #include<stdio.h> main() { printf(hello, world.); return 0; } (G1) int long int float ± ± [1] #include printf("hello, world."); (G1) int -32768 32767 long int -2147483648 2147483647 float ±3.4 10 38 ±3.4 10 38 double ±1.7 10 308 ±1.7 10 308 char [2] #include int a, b, c, d,

More information

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * *

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * * 2015 2015 07 30 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) +

More information

C言語によるアルゴリズムとデータ構造

C言語によるアルゴリズムとデータ構造 Algorithms and Data Structures in C 4 algorithm List - /* */ #include List - int main(void) { int a, b, c; int max; /* */ Ÿ 3Ÿ 2Ÿ 3 printf(""); printf(""); printf(""); scanf("%d", &a); scanf("%d",

More information

.3. (x, x = (, u = = 4 (, x x = 4 x, x 0 x = 0 x = 4 x.4. ( z + z = 8 z, z 0 (z, z = (0, 8, (,, (8, 0 3 (0, 8, (,, (8, 0 z = z 4 z (g f(x = g(

.3. (x, x = (, u = = 4 (, x x = 4 x, x 0 x = 0 x = 4 x.4. ( z + z = 8 z, z 0 (z, z = (0, 8, (,, (8, 0 3 (0, 8, (,, (8, 0 z = z 4 z (g f(x = g( 06 5.. ( y = x x y 5 y 5 = (x y = x + ( y = x + y = x y.. ( Y = C + I = 50 + 0.5Y + 50 r r = 00 0.5Y ( L = M Y r = 00 r = 0.5Y 50 (3 00 0.5Y = 0.5Y 50 Y = 50, r = 5 .3. (x, x = (, u = = 4 (, x x = 4 x,

More information

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D

II ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 D II 8 2003 11 12 1 6 ( ) prog8-1.c s1542h017%./prog8-1 1 => 35 Hiroshi 2 => 23 Koji 3 => 67 Satoshi 4 => 87 Junko 5 => 64 Ichiro 6 => 89 Mari 7 => 73 Daisuke 8 =>. 73 Daisuke 35 Hiroshi 64 Ichiro 87 Junko

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) double

More information

新・明解C言語 実践編

新・明解C言語 実践編 第 1 章 見 21 1-1 見えないエラー 見 List 1-1 "max2x1.h" a, b max2 List 1-1 chap01/max2x1.h max2 "max2x1.h" #define max2(a, b) ((a) > (b)? (a) : (b)) max2 List 1-2 List 1-2 chap01/max2x1test.c max2 #include

More information

ii 3.,. 4. F. ( ), ,,. 8.,. 1. (75% ) (25% ) =7 24, =7 25, =7 26 (. ). 1.,, ( ). 3.,...,.,.,.,.,. ( ) (1 2 )., ( ), 0., 1., 0,.

ii 3.,. 4. F. ( ), ,,. 8.,. 1. (75% ) (25% ) =7 24, =7 25, =7 26 (. ). 1.,, ( ). 3.,...,.,.,.,.,. ( ) (1 2 )., ( ), 0., 1., 0,. (1 C205) 4 10 (2 C206) 4 11 (2 B202) 4 12 25(2013) http://www.math.is.tohoku.ac.jp/~obata,.,,,..,,. 1. 2. 3. 4. 5. 6. 7. 8. 1., 2007 ( ).,. 2. P. G., 1995. 3. J. C., 1988. 1... 2.,,. ii 3.,. 4. F. ( ),..

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°(2018) - Âè11²ó – ½ÉÂꣲ¤Î²òÀ⡤±é½¬£² –

£Ã¥×¥í¥°¥é¥ß¥ó¥°(2018) - Âè11²ó – ½ÉÂꣲ¤Î²òÀ⡤±é½¬£² – (2018) 11 2018 12 13 2 g v dv x dt = bv x, dv y dt = g bv y (1) b v 0 θ x(t) = v 0 cos θ ( 1 e bt) (2) b y(t) = 1 ( v 0 sin θ + g ) ( 1 e bt) g b b b t (3) 11 ( ) p14 2 1 y 4 t m y > 0 y < 0 t m1 h = 0001

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2017 2017 08 03 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF X [ S ] a S S ; X X X, S [, a, ], ; BNF X (parse tree) (1) [a;a] (2) [[a]] (3) [a;[a]] (4) [[a];a] : [a] X 2 222222

More information

ex12.dvi

ex12.dvi 1 0. C, char., char, 0,. C, ("),., char str[]="abc" ; str abc.,, str 4. str 3. char str[10]="abc" ;, str 10, str 3., char s[]="abc", t[10] ;, t = s. ASCII, 0x00 0x7F, char., "abc" 3, 1. 1 8 256, 2., 2

More information

Prog1_6th

Prog1_6th 2012 年 5 月 24 日 ( 木 ) 実施 多分岐のプログラム 前回は多段階の 2 分岐を組み合わせて 3 種類以上の場合分けを実現したが, 式の値の評価によって, 一度に多種類の場合分けを行う多分岐の利用によって見通しのよいプログラムを作成できる場合がある ( 流れ図は右図 ) 式の評価 : 値 1 : 値 2 : 値 n : 該当値無し 処理 1 処理 2 処理 n 既定の処理 switch

More information

統計学のポイント整理

統計学のポイント整理 .. September 17, 2012 1 / 55 n! = n (n 1) (n 2) 1 0! = 1 10! = 10 9 8 1 = 3628800 n k np k np k = n! (n k)! (1) 5 3 5 P 3 = 5! = 5 4 3 = 60 (5 3)! n k n C k nc k = npk k! = n! k!(n k)! (2) 5 3 5C 3 = 5!

More information

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v 1 http://www7.bpe.es.osaka-u.ac.jp/~kota/classes/jse.html kota@fbs.osaka-u.ac.jp /* do-while */ #include #include int main(void) double val1, val2, arith_mean, geo_mean; printf( \n );

More information

,. Black-Scholes u t t, x c u 0 t, x x u t t, x c u t, x x u t t, x + σ x u t, x + rx ut, x rux, t 0 x x,,.,. Step 3, 7,,, Step 6., Step 4,. Step 5,,.

,. Black-Scholes u t t, x c u 0 t, x x u t t, x c u t, x x u t t, x + σ x u t, x + rx ut, x rux, t 0 x x,,.,. Step 3, 7,,, Step 6., Step 4,. Step 5,,. 9 α ν β Ξ ξ Γ γ o δ Π π ε ρ ζ Σ σ η τ Θ θ Υ υ ι Φ φ κ χ Λ λ Ψ ψ µ Ω ω Def, Prop, Th, Lem, Note, Remark, Ex,, Proof, R, N, Q, C [a, b {x R : a x b} : a, b {x R : a < x < b} : [a, b {x R : a x < b} : a,

More information

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B

A/B (2018/10/19) Ver kurino/2018/soft/soft.html A/B A/B (2018/10/19) Ver. 1.0 kurino@math.cst.nihon-u.ac.jp http://edu-gw2.math.cst.nihon-u.ac.jp/ kurino/2018/soft/soft.html 2018 10 19 A/B 1 2018 10 19 2 1 1 1.1 OHP.................................... 1

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) { double

More information

Taro-スタック(公開版).jtd

Taro-スタック(公開版).jtd 0. 目次 1. 1. 1 配列によるの実現 1. 2 再帰的なデータ構造によるの実現 1. 3 地図情報処理 1. 4 問題 問題 1 グラフ探索問題 - 1 - 1. は データの出し入れが一カ所で行われ 操作は追加と削除ができるデータ構造をいう 出入口 追加 削除 操作 最初 111 追加 111 222 追加 111 222 333 追加 111 222 333 444 追加 111 222

More information

c-all.dvi

c-all.dvi III(994) (994) from PSL (9947) & (9922) c (99,992,994,996) () () 2 3 4 (2) 2 Euler 22 23 Euler 24 (3) 3 32 33 34 35 Poisson (4) 4 (5) 5 52 ( ) 2 Turbo 2 d 2 y=dx 2 = y y = a sin x + b cos x x = y = Fortran

More information

1 28 6 12 7 1 7.1...................................... 2 7.1.1............................... 2 7.1.2........................... 2 7.2...................................... 3 7.3...................................

More information

untitled

untitled II 4 Yacc Lex 2005 : 0 1 Yacc 20 Lex 1 20 traverse 1 %% 2 [0-9]+ { yylval.val = atoi((char*)yytext); return NUM; 3 "+" { return + ; 4 "*" { return * ; 5 "-" { return - ; 6 "/" { return / ; 7 [ \t] { /*

More information

kiso2-09.key

kiso2-09.key 座席指定はありません 計算機基礎実習II 2018 のウェブページか 第9回 ら 以下の課題に自力で取り組んで下さい 計算機基礎実習II 第7回の復習課題(rev07) 第9回の基本課題(base09) 第8回試験の結果 中間試験に関するコメント コンパイルできない不完全なプログラムなど プログラミングに慣れていない あるいは複雑な問題は 要件 をバラして段階的にプログラムを作成する exam08-2.c

More information

P03.ppt

P03.ppt (2) Switch case 5 1 1 2 1 list0317.c if /*/ intnum; printf(""); scanf("%d", &num); 2 if (num % 3 == 0) puts( 0"); else if (num % 3 == 1) puts(" 1"); else puts( 32"); 3 if list0318.c /*/ intnum; printf("");

More information

Original : Hello World! (0x0xbfab85e0) Copy : Hello World! (0x0x804a050) fgets mstrcpy malloc mstrcpy (main ) mstrcpy malloc free fgets stream 1 ( \n

Original : Hello World! (0x0xbfab85e0) Copy : Hello World! (0x0x804a050) fgets mstrcpy malloc mstrcpy (main ) mstrcpy malloc free fgets stream 1 ( \n 2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test

More information

I L01( Wed) : Time-stamp: Wed 07:38 JST hig e, ( ) L01 I(2017) 1 / 19

I L01( Wed) : Time-stamp: Wed 07:38 JST hig e,   ( ) L01 I(2017) 1 / 19 I L01(2017-09-20 Wed) : Time-stamp: 2017-09-20 Wed 07:38 JST hig e, http://hig3.net ( ) L01 I(2017) 1 / 19 ? 1? 2? ( ) L01 I(2017) 2 / 19 ?,,.,., 1..,. 1,2,.,.,. ( ) L01 I(2017) 3 / 19 ? I. M (3 ) II,

More information

j x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E

j x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E 8 9 7 6 4 2 3 5 1 j x j j j + 1 l j l j = x j+1 x j, n x n x 1 = n 1 l j j=1 H j j + 1 l j l j E a n 1 H = ae l j, j=1 l j = x j+1 x j, x n x 1 = n 1 j=1 l j, l j = ±l l > 0) n 1 H = ϵ l j, j=1 ϵ e x x

More information

超初心者用

超初心者用 3 1999 10 13 1. 2. hello.c printf( Hello, world! n ); cc hello.c a.out./a.out Hello, world printf( Hello, world! n ); 2 Hello, world printf n printf 3. ( ) int num; num = 100; num 100 100 num int num num

More information

x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x i ) A(x i ) = h 2 {f(x i) + f(x i+1 ) = h {f(a + i h) + f(a + (i + 1) h), (2) 2 a b n A(x i )

x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x i ) A(x i ) = h 2 {f(x i) + f(x i+1 ) = h {f(a + i h) + f(a + (i + 1) h), (2) 2 a b n A(x i ) 1 f(x) a b f(x)dx = n A(x i ) (1) ix [a, b] n i A(x i ) x i 1 f(x) [a, b] n h = (b a)/n y h = (b-a)/n y = f (x) h h a a+h a+2h a+(n-1)h b x 1: 1 x h = (b a)/n [x i, x i+1 ] = [a+i h, a+ (i + 1) h] A(x

More information

BW BW

BW BW Induced Sorting BW 11T2042B 2015 3 23 1 1 1.1................................ 1 1.2................................... 1 2 BW 1 2.1..................................... 2 2.2 BW.................................

More information

Taro-プログラミングの基礎Ⅱ(公

Taro-プログラミングの基礎Ⅱ(公 0. 目次 2. プログラムの作成 2. 1 コラッツ問題 自然数 n から出発して n が偶数ならば 2 で割り n が奇数ならば 3 倍して 1 を足す操作を行う この操作を繰り返すと最後に 1 になると予想されている 問題 1 自然数 aの操作回数を求めよ 問題 2 自然数 aから bまでのなかで 最大操作回数となる自然数を求めよ 2. 2 耐久数 正整数の各桁の数字を掛け 得られた結果についても同様の操作を繰り返す

More information

1.ppt

1.ppt /* * Program name: hello.c */ #include int main() { printf( hello, world\n ); return 0; /* * Program name: Hello.java */ import java.io.*; class Hello { public static void main(string[] arg)

More information

slide5.pptx

slide5.pptx ソフトウェア工学入門 第 5 回コマンド作成 1 head コマンド作成 1 早速ですが 次のプログラムを head.c という名前で作成してください #include #include static void do_head(file *f, long nlines); int main(int argc, char *argv[]) { if (argc!=

More information

r08.dvi

r08.dvi 19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev

More information

tokei01.dvi

tokei01.dvi 2. :,,,. :.... Apr. - Jul., 26FY Dept. of Mechanical Engineering, Saga Univ., JAPAN 4 3. (probability),, 1. : : n, α A, A a/n. :, p, p Apr. - Jul., 26FY Dept. of Mechanical Engineering, Saga Univ., JAPAN

More information

II 2 II

II 2 II II 2 II 2005 yugami@cc.utsunomiya-u.ac.jp 2005 4 1 1 2 5 2.1.................................... 5 2.2................................. 6 2.3............................. 6 2.4.................................

More information

double float

double float 2015 3 13 1 2 2 3 2.1.......................... 3 2.2............................. 3 3 4 3.1............................... 4 3.2 double float......................... 5 3.3 main.......................

More information

ohp08.dvi

ohp08.dvi 19 8 ( ) 2019.4.20 1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: 2 (2) NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( 2) 3 (3) head cur tail head cur prev data

More information

Taro-最大値探索法の開発(公開版

Taro-最大値探索法の開発(公開版 最大値探索法の開発 0. 目次 1. 開発過程 1 目標 1 : 4 個のデータの最大値を求める 目標 2 : 4 個のデータの最大値を求める 改良 : 多数のデータに対応するため 配列を使う 目標 3 : n 個のデータの最大値を求める 改良 : コードを簡潔に記述するため for 文を使う 目標 4 : n 個のデータの最大値を求める 改良 : プログラムをわかりやすくするため 関数を使う 目標

More information

A

A A 2563 15 4 21 1 3 1.1................................................ 3 1.2............................................. 3 2 3 2.1......................................... 3 2.2............................................

More information

i 18 2H 2 + O 2 2H 2 + ( ) 3K

i 18 2H 2 + O 2 2H 2 + ( ) 3K i 18 2H 2 + O 2 2H 2 + ( ) 3K ii 1 1 1.1.................................. 1 1.2........................................ 3 1.3......................................... 3 1.4....................................

More information

2004 2005 2 2 1G01P038-0 1 2 1.1.............................. 2 1.2......................... 2 1.3......................... 3 2 4 2.1............................ 4 2.2....................... 4 2.3.......................

More information

Taro-再帰関数Ⅱ(公開版).jtd

Taro-再帰関数Ⅱ(公開版).jtd 0. 目次 6. 2 項係数 7. 二分探索 8. 最大値探索 9. 集合 {1,2,,n} 上の部分集合生成 - 1 - 6. 2 項係数 再帰的定義 2 項係数 c(n,r) は つぎのように 定義される c(n,r) = c(n-1,r) + c(n-1,r-1) (n 2,1 r n-1) = 1 (n 0, r=0 ) = 1 (n 1, r=n ) c(n,r) 0 1 2 3 4 5

More information

2014 3 10 5 1 5 1.1..................................... 5 2 6 2.1.................................... 6 2.2 Z........................................ 6 2.3.................................. 6 2.3.1..................

More information

P06.ppt

P06.ppt p.130 p.198 p.208 2 1 double weight[num]; double min, max; min = max = weight[0]; for( i= 1; i < NUM; i++ ) if ( weight[i] > max ) max = weight[i]: if ( weight[i] < min ) min = weight[i]: weight 3 maxof(a,

More information

(search: ) [1] ( ) 2 (linear search) (sequential search) 1

(search: ) [1] ( ) 2 (linear search) (sequential search) 1 2005 11 14 1 1.1 2 1.2 (search:) [1] () 2 (linear search) (sequential search) 1 2.1 2.1.1 List 2-1(p.37) 1 1 13 n

More information

Informatics 2010.key

Informatics 2010.key http://math.sci.hiroshima-u.ac.jp/ ~ryo/lectures/informatics2010/ 1 2 C ATM etc. etc. (Personal Computer) 3 4 Input Output Device Central Processing Unit I/O CPU Memory 5 6 (CPU),,... etc. C, Java, Fortran...

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション プログラミング応用 第 15 回 知的情報システム学科張 暁華 プログラミング応用 1 授業のマナー ------ 人の話を聞くときの社会常識 1. 欠席者のかわりに登録を行わない 倫理に反することをやらない あなたの信を問われている蟻の穴から堤防が決壊 2. 私語しないこと : 質問 意見は手を挙げて大きな声ではっきりと意思表示 3. 授業以外のことをしない : 携帯をカバンにいれ イヤホンを使って音楽等を聞かない授業中ゲームを遊ばない

More information

C

C C 1 2 1.1........................... 2 1.2........................ 2 1.3 make................................................ 3 1.4....................................... 5 1.4.1 strip................................................

More information

Taro-リストⅢ(公開版).jtd

Taro-リストⅢ(公開版).jtd リスト Ⅲ 0. 目次 2. 基本的な操作 2. 1 リストから要素の削除 2. 2 リストの複写 2. 3 リストの連結 2. 4 問題 問題 1 問題 2-1 - 2. 基本的な操作 2. 1 リストから要素の削除 まず 一般的な処理を書き つぎに 特別な処理を書く 一般的な処理は 処理 1 : リスト中に 削除するデータを見つけ 削除する場合への対応 特別な処理は 処理 2 : 先頭のデータを削除する場合への対応

More information

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2 " 2 B R b

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2  2 B R b I 4 003 4 30 1 ASCII ( ) 0 17 0 NUL 16 DLE SP 0 @ P 3 48 64 80 96 11 p 1 SOH 17 DC1! 1 A Q a 33 49 65 81 97 113 q STX 18 DC " B R b 34 50 66 8 98 114 r 3 ETX 19 DC3 # 3 C S c 35 51 67 83 99 115 s 4 EOT

More information

スライド 1

スライド 1 数値解析 平成 24 年度前期第 13 週 [7 月 11 日 ] 静岡大学創造科学技術大学院情報科学専攻工学部機械工学科計測情報講座 三浦憲二郎 講義アウトライン [7 月 11 日 ] 関数近似と補間 最小 2 乗近似による関数近似 ラグランジュ補間 形状処理工学の基礎 点列からの曲線の生成 T.Kanai, U.Tokyo 関数近似 p.116 複雑な関数を簡単な関数で近似する関数近似 閉区間

More information

K227 Java 2

K227 Java 2 1 K227 Java 2 3 4 5 6 Java 7 class Sample1 { public static void main (String args[]) { System.out.println( Java! ); } } 8 > javac Sample1.java 9 10 > java Sample1 Java 11 12 13 http://java.sun.com/j2se/1.5.0/ja/download.html

More information

C 2 / 21 1 y = x 1.1 lagrange.c 1 / Laglange / 2 #include <stdio.h> 3 #include <math.h> 4 int main() 5 { 6 float x[10], y[10]; 7 float xx, pn, p; 8 in

C 2 / 21 1 y = x 1.1 lagrange.c 1 / Laglange / 2 #include <stdio.h> 3 #include <math.h> 4 int main() 5 { 6 float x[10], y[10]; 7 float xx, pn, p; 8 in C 1 / 21 C 2005 A * 1 2 1.1......................................... 2 1.2 *.......................................... 3 2 4 2.1.............................................. 4 2.2..............................................

More information

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

1. A0 A B A0 A : A1,...,A5 B : B1,...,B 1. A0 A B A0 A : A1,...,A5 B : B1,...,B12 2. 3. 4. 5. A0 A B f : A B 4 (i) f (ii) f (iii) C 2 g, h: C A f g = f h g = h (iv) C 2 g, h: B C g f = h f g = h 4 (1) (i) (iii) (2) (iii) (i) (3) (ii) (iv) (4)

More information

( ) 1 1: 1 #include <s t d i o. h> 2 #include <GL/ g l u t. h> 3 #include <math. h> 4 #include <s t d l i b. h> 5 #include <time. h>

( ) 1 1: 1 #include <s t d i o. h> 2 #include <GL/ g l u t. h> 3 #include <math. h> 4 #include <s t d l i b. h> 5 #include <time. h> 2007 12 5 1 2 2.1 ( ) 1 1: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 #define H WIN 400 // 8 #define W WIN 300 // 9

More information

50 2 I SI MKSA r q r q F F = 1 qq 4πε 0 r r 2 r r r r (2.2 ε 0 = 1 c 2 µ 0 c = m/s q 2.1 r q' F r = 0 µ 0 = 4π 10 7 N/A 2 k = 1/(4πε 0 qq

50 2 I SI MKSA r q r q F F = 1 qq 4πε 0 r r 2 r r r r (2.2 ε 0 = 1 c 2 µ 0 c = m/s q 2.1 r q' F r = 0 µ 0 = 4π 10 7 N/A 2 k = 1/(4πε 0 qq 49 2 I II 2.1 3 e e = 1.602 10 19 A s (2.1 50 2 I SI MKSA 2.1.1 r q r q F F = 1 qq 4πε 0 r r 2 r r r r (2.2 ε 0 = 1 c 2 µ 0 c = 3 10 8 m/s q 2.1 r q' F r = 0 µ 0 = 4π 10 7 N/A 2 k = 1/(4πε 0 qq F = k r

More information

2 P.S.P.T. P.S.P.T. wiki 26

2 P.S.P.T. P.S.P.T. wiki  26 P.S.P.T. C 2011 4 10 2 P.S.P.T. P.S.P.T. wiki p.s.p.t.since1982@gmail.com http://www23.atwiki.jp/pspt 26 3 2 1 C 8 1.1 C................................................ 8 1.1.1...........................................

More information

スライド 1

スライド 1 数値解析 2019 年度前期第 13 週 [7 月 11 日 ] 静岡大学創造科学技術大学院情報科学専攻工学部機械工学科計測情報講座 三浦憲二郎 講義アウトライン [7 月 11 日 ] 関数近似と補間 最小 2 乗近似による関数近似 ラグランジュ補間 T.Kanai, U.Tokyo 関数近似 p.116 複雑な関数を簡単な関数で近似する 関数近似 閉区間 [a,b] で定義された関数 f(x)

More information

Taro-リストⅠ(公開版).jtd

Taro-リストⅠ(公開版).jtd 0. 目次 1. 再帰的なデータ構造によるリストの表現 1. 1 リストの作成と表示 1. 1. 1 リストの先頭に追加する方法 1. 1. 2 リストの末尾に追加する方法 1. 1. 3 昇順を保存してリストに追加する方法 1. 2 問題 問題 1 問題 2-1 - 1. 再帰的なデータ構造によるリストの表現 リストは データの一部に次のデータの記憶場所を示す情報 ( ポインタという ) を持つ構造をいう

More information

CM-3G 周辺モジュール拡張技術文書 MS5607センサ(温度、気圧)

CM-3G 周辺モジュール拡張技術文書 MS5607センサ(温度、気圧) CM-3G 周辺モジュール拡張技術文書 MS5607 センサ ( 温度 気圧 ) ( 第 1 版 ) Copyright (C)2016 株式会社コンピューテックス 目次 1. はじめに... 1 2. MS5607 について... 1 3. 接続図... 1 4. アプリケーション ソース... 2 5. アプリケーションのコンパイル方法... 7 6. アプリケーションの実行... 8 1. はじめに

More information

ex14.dvi

ex14.dvi 1,, 0, b (b b 2 b ) n k n = n j b j, (0 n j b 1), n =(n k n k 1...n 1 n 0 ) b, n j j j +1, 0,...,b 1 (digit). b b, n b 1 ñ, ñ = k (b 1 n j )b j b N, n b n, n = b N n, n =ñ+1 b N, n m n + m (mod b N ),

More information

1 5 13 4 1 41 1 411 1 412 2 413 3 414 3 415 4 42 6 43 LU 7 431 LU 10 432 11 433 LU 11 44 12 441 13 442 13 443 SOR ( ) 14 444 14 445 15 446 16 447 SOR 16 448 16 45 17 4 41 n x 1,, x n a 11 x 1 + a 1n x

More information

n ξ n,i, i = 1,, n S n ξ n,i n 0 R 1,.. σ 1 σ i .10.14.15 0 1 0 1 1 3.14 3.18 3.19 3.14 3.14,. ii 1 1 1.1..................................... 1 1............................... 3 1.3.........................

More information

lexex.dvi

lexex.dvi (2018, c ) http://istksckwanseiacjp/ ishiura/cpl/ 4 41 1 mini-c lexc,, 2 testlexc, lexc mini-c 1 ( ) mini-c ( ) (int, char, if, else, while, return 6 ) ( ) (+, -, *, /, %, &, =, ==,!=, >, >=,

More information

x(t) + t f(t, x) = x(t) + x (t) t x t Tayler x(t + t) = x(t) + x (t) t + 1 2! x (t) t ! x (t) t 3 + (15) Eular x t Teyler 1 Eular 2 Runge-Kutta

x(t) + t f(t, x) = x(t) + x (t) t x t Tayler x(t + t) = x(t) + x (t) t + 1 2! x (t) t ! x (t) t 3 + (15) Eular x t Teyler 1 Eular 2 Runge-Kutta 6 Runge-KuttaEular Runge-Kutta Runge-Kutta A( ) f(t, x) dx dt = lim x(t + t) x(t) t 0 t = f(t, x) (14) t x x(t) t + dt x x(t + dt) Euler 7 t 1 f(t, x(t)) x(t) + f(t + dt, x(t + dt))dt t + dt x(t + dt)

More information

programmingII2019-v01

programmingII2019-v01 II 2019 2Q A 6/11 6/18 6/25 7/2 7/9 7/16 7/23 B 6/12 6/19 6/24 7/3 7/10 7/17 7/24 x = 0 dv(t) dt = g Z t2 t 1 dv(t) dt dt = Z t2 t 1 gdt g v(t 2 ) = v(t 1 ) + g(t 2 t 1 ) v v(t) x g(t 2 t 1 ) t 1 t 2

More information

211 kotaro@math.titech.ac.jp 1 R *1 n n R n *2 R n = {(x 1,..., x n ) x 1,..., x n R}. R R 2 R 3 R n R n R n D D R n *3 ) (x 1,..., x n ) f(x 1,..., x n ) f D *4 n 2 n = 1 ( ) 1 f D R n f : D R 1.1. (x,

More information

8 / 0 1 i++ i 1 i-- i C !!! C 2

8 / 0 1 i++ i 1 i-- i C !!! C 2 C 2006 5 2 printf() 1 [1] 5 8 C 5 ( ) 6 (auto) (static) 7 (=) 1 8 / 0 1 i++ i 1 i-- i 1 2 2.1 C 4 5 3 13!!! C 2 2.2 C ( ) 4 1 HTML はじめ mkdir work 作業用ディレクトリーの作成 emacs hoge.c& エディターによりソースプログラム作成 gcc -o fuga

More information

スライド 1

スライド 1 数値解析 平成 29 年度前期第 14 週 [7 月 10 日 ] 静岡大学工学研究科機械工学専攻ロボット 計測情報分野創造科学技術大学院情報科学専攻 三浦憲二郎 期末試験 7 月 31 日 ( 月 ) 9 10 時限 A : 佐鳴会議室 B : 佐鳴ホール 講義アウトライン [7 月 10 日 ] 関数近似と補間 最小 2 乗近似による関数近似 ( 復習 ) ラグランジュ補間 形状処理工学の基礎

More information

Gauss

Gauss 15 1 LU LDL T 6 : 1g00p013-5 1 6 1.1....................................... 7 1.2.................................. 8 1.3.................................. 8 2 Gauss 9 2.1.....................................

More information