# let rec sigma (f, n) = # if n = 0 then 0 else f n + sigma (f, n-1);; val sigma : (int -> int) * int -> int = <fun> sigma f n ( : * -> * ) sqsum cbsu

Size: px
Start display at page:

Download "# let rec sigma (f, n) = # if n = 0 then 0 else f n + sigma (f, n-1);; val sigma : (int -> int) * int -> int = <fun> sigma f n ( : * -> * ) sqsum cbsu"

Transcription

1 II 4 : keywords: 1 OCaml OCaml (first-class value) (higher-order function) n 2 sqsum n 3 cbsum # let rec sqsum n = # if n = 0 then 0 else n * n + sqsum (n - 1) # let rec cbsum n = # if n = 0 then 0 else n * n * n + cbsum (n - 1);; val sqsum : int -> int = <fun> val cbsum : int -> int = <fun> n 0 0 n n 1

2 # let rec sigma (f, n) = # if n = 0 then 0 else f n + sigma (f, n-1);; val sigma : (int -> int) * int -> int = <fun> sigma f n ( : * -> * ) sqsum cbsum # let square x = x * x # let sqsum n = sigma (square, n) # let cbsum n = # let cube x = x * x * x in sigma (cube, n);; val square : int -> int = <fun> val sqsum : int -> int = <fun> val cbsum : int -> int = <fun> cbsum let- # sqsum 5;; - : int = 55 # cbsum 5;; - : int = n sigma f(i) f i=0 let f (anonymous function) OCaml OCaml fun -> e e fun # let cbsum n = sigma ((fun x -> x * x * x), n);; val cbsum : int -> int = <fun> # let sq5 = ((fun x -> x * x), 5) in # sigma sq5;; - : int = 55 # (fun x -> x * x) 7;; - : int = 49 2

3 ( ) fun () (, n x * x * x n fun () ) let let f x = e let f = fun x -> e (fun) 1.3 OCaml 1 Haskell Curry (curried function) x y e x y e s 1, s 2 s 1 s 2 # let concat (s1, s2) = s1 ^ s2 ;; val concat : string * string -> string = <fun> ( ) concat ("abc", "def") # let concat_curry s1 = fun s2 -> s1 ^ s2;; val concat_curry : string -> string -> string = <fun> concat_curry fun s2 ( ) s1 concat_curry string -> (string -> string) 2 # (concat_curry "abc") "def";; - : string = "abcdef" 3

4 (...) abc (...) "def" (partial application) Mr. ( ) # let add_title = concat_curry "Mr. ";; val add_title : string -> string = <fun> # add_title "Igarashi";; - : string = "Mr. Igarashi" add_title fun s2 -> "Mr. " ^ s2 fun OCaml fun let fun # let concat_curry s1 s2 = s1 ^ s2;; val concat_curry : string -> string -> string = <fun> # let concat_curry = fun s1 s2 -> s1 ^ s2;; val concat_curry : string -> string -> string = <fun> fun 1 -> fun 2 ->... fun n -> e fun n -> e (let ) (((f x) y) z) f x y z ( ) t1 -> t2 -> t3 -> t4 t1 -> (t2 -> (t3 -> t4)) 4

5 / +, ^ (infix operator) (int->int->int ) OCaml ( ) + ( ) ( ) # (+);; - : int -> int -> int = <fun> # ( * ) 2 3;; - : int = 6 * / mod, *, =, or, & 1 =, <, ^,, &, +, -, *, /, $, % 2!, $, %, *, +, -,., /, :, <, =, ^, ~ ( ) # let (^-^) x y = x * 2 + y * 3;; val ( ^-^ ) : int -> int -> int = <fun> # 9 ^-^ 6;; - : int = 36 () # let (!! ) x = x + 1;; val (!! ) : int -> int = <fun> #!!;; Characters 2-4: Syntax error # (!!);; - : int -> int = <fun> #!! 3;; - : int = 4 -, -. 1!,?, ~ 2!, $, %, *, +, -,., /, :, <, =, ^, ~ 1 5

6 1: -, -. ** *, /, %, mod +, - ^ = <, not &, && or,, <-, := if ; let, match, fun, function, try 6

7 1.4 Case Study: Newton-Raphson Newton-Raphson Newton-Raphson f f(x) = 0 g(x) = x f(x) f (x) (g(a) = a a) ( x n = x n 1 f(x n 1 )/f (x n 1 ) ) dx g (x) = g(x + dx) g(x) dx # let deriv f = # let dx = 0.1e-10 in # fun x -> (f(x +. dx) -. f(x)) /. dx;; val deriv : (float -> float) -> float -> float = <fun> f(x) = x 3 3 # deriv (fun x -> x *. x *. x) 3.0;; - : float = f x f(x), f(f(x)),... f n (x) = f n 1 (x) f n (x) f n 1 (x) f n (x) # let fixpoint f init = # (* computes a fixed-point of f, i.e., r such that f(r)=r *) # let threshold = 0.1e-10 in # let rec loop x = # let next = f x in # if abs_float (x -. next) < threshold then x # else loop next # in loop init;; val fixpoint : (float -> float) -> float -> float = <fun> Newton-Raphson # let newton_transform f = fun x -> x -. f(x) /. (deriv f x);; val newton_transform : (float -> float) -> float -> float = <fun> 7

8 Newton-Raphson f(x) = 0 f guess # let newton_method f guess = fixpoint (newton_transform f) guess;; val newton_method : (float -> float) -> float -> float = <fun> # let square_root x = newton_method (fun y -> y *. y -. x) 1.0;; val square_root : float -> float = <fun> # square_root 5.0;; - : float = b Exercise 4.1 f f(x)dx integral f a b π sin xdx 0 a b a n δ i (f (a + (i 1) δ) + f (a + iδ)) δ 2 Exercise pow (pow n x) 3 cube (pow x n) cube pow? Exercise 4.3 fun? Exercise int -> int -> int -> int (int -> int) -> int -> int (int -> int -> int) -> int 8

9 2 int * int # let fstint ((x, y) : int * int) = x;; val fstint : int * int -> int = <fun> (int * float) * string # let fst_ifs ((x, y) : (int * float) * string) = x;; val fst_ifs : (int * float) * string -> int * float = <fun>??? (int int * float string) # let fst ((x, y) : a * b) = x;; val fst : a * b -> a = <fun> a b (type variable) (polymorphic function) fst a * b -> a T1, T2 T1 * T2 -> T1 ( a. b.( a * b -> a) ) OCaml # let fst (x, y) = x;; val fst : a * b -> a = <fun> ( (principal type) ) fst a * b -> a ( ) 9

10 # fst (2, 3);; - : int = 2 # fst ((4, 5.2), "foo");; - : int * float = 4, 5.2 a, b int a int * float b string fst int * int -> int (int * float) * string -> int * float (polymorphism) (parametric polymorphism) ( ) id (identity function) apply # let id x = x;; val id : a -> a = <fun> # let apply f x = f x;; val apply : ( a -> b) -> a -> b = <fun> apply ( a -> b) f a x a f x f x # apply abs (-5);; - : int = 5 # apply abs "baz";; Characters 6-9: This expression has type int -> int but is here used with type string -> a? fst (x, y) x, y apply f x ( ) a * b -> a + (adhoc polymorphism) 10

11 (subtyping polymorphism) 2.1 let OCaml let( ) x (id ) # (fun x -> (x 1, x 2.0)) id;; Characters 19-22: This expression has type float but is here used with type int x 1 x int float let f x double # let double f x = f (f x);; val double : ( a -> a) -> a -> a = <fun> # double (fun x -> x + 1) 3;; - : int = 5 # double (fun s -> "<" ^ s ^ ">") "abc";; - : string = "<<abc>>" 4 # double double (fun x -> x + 1) 3;; - : int = 7 # double double (fun s -> "<" ^ s ^ ">") "abc";; - : string = "<<<<abc>>>>" let # let fourtimes = double double;; val fourtimes : ( _a -> _a) -> _a -> _a = <fun> _a 11

12 # fourtimes (fun x -> x + 1) 3;; - : int = 7 # fourtimes;; - : (int -> int) -> int -> int = <fun> # fourtimes (fun s -> "<" ^ s ^ ">") "abc";; Characters 35-40: This expression has type string but is here used with type int fourtimes int (value polymorphism) ( ) fourtimes # let fourtimes f = double double f # (* equivalent to "let fourtimes = fun f -> double double f" *) ;; val fourtimes : ( a -> a) -> a -> a = <fun> ( fun ) # fourtimes (fun x -> x + 1) 3;; - : int = 7 # fourtimes (fun s -> "<" ^ s ^ ">") "abc";; - : string = "<<<<abc>>>>" 2.2 OCaml fun x -> x + 1 int -> int + int -> int -> int int x + x int 1 int OK x int x + 1 int x + 1 int x int -> int OCaml 1 12

13 if ( x a int ) fun x -> if x then 1 else x if if bool then else x a int = a = bool let ( ) apply f, x a, b f x f x c a = b -> c fun f x -> f x a -> b -> c ( b -> c) -> b -> c / / Newton-Raphson let square_root x = newton_method (fun y -> y *. y -. x) 1.0;; newton_method newton_method y float fun (y : float) ->... fst # let fst ((x, y) : a * a) = x;; val fst : a * a -> a = <fun> # fst (true, 3.2);; Characters 6-15: This expression has type bool * float but is here used with type bool * bool 2.3 Case Study: CPU 13

14 λ- λ- (OCaml fun ) λ- o OCaml # let o f g x = f (g x);; val o : ( a -> b) -> ( c -> a) -> c -> b = <fun> fun x -> -. (sqrt x) # o ( -. ) sqrt;; - : float -> float -> float = <fun> id ( I ) id f f I # o id (sqrt) 3.0;; - : float = K # let k x y = x;; val k : a -> b -> a = <fun> k x x # let const17 = k 17 in const17 4.0;; - : int = 17 S # let s x y z = x z (y z);; val s : ( a -> b -> c) -> ( a -> b) -> a -> c = <fun> OCaml fun (id, double λ- ) S K I S K K # s k k 5;; - : int = 5 λ- 14

15 2.4 Exercise 4.5 curry curry (2 ) uncurry # let curry f x y = f (x, y);; val curry : ( a * b -> c) -> a -> b -> c = <fun> Exercise 4.6 repeat double, fourtimes f n x # let rec repeat f n x = # if n > 0 then repeat f (n - 1) (f x) else x;; val repeat : ( a -> a) -> int -> a -> a = <fun> fib... let fib n = let (fibn, _) =... in fibn;; Exercise 4.7 funny # (* f <@> g denotes the composition of f and g *) # let ( <@> ) f g x = (f (g x)) ;; val ( <@> ) : ( a -> b) -> ( c -> a) -> c -> b = <fun> # let rec funny f n = # if n = 0 then id # else if n mod 2 = 0 then funny (f <@> f) (n / 2) # else funny (f <@> f) (n / 2) <@> f;; val funny : ( a -> a) -> int -> a -> a = <fun> Exercise 4.8 S K K S K K 1 Exercise 4.9 double double f x f (f (f (f x))) 15

Parametric Polymorphism

Parametric Polymorphism ML 2 2011/04/19 Parametric Polymorphism Type Polymorphism ? : val hd_int : int list - > int val hd_bool : bool list - > bool val hd_i_x_b : (int * bool) list - > int * bool etc. let hd_int = function (x

More information

# let st1 = {name = "Taro Yamada"; id = };; val st1 : student = {name="taro Yamada"; id=123456} { 1 = 1 ;...; n = n } # let string_of_student {n

# let st1 = {name = Taro Yamada; id = };; val st1 : student = {name=taro Yamada; id=123456} { 1 = 1 ;...; n = n } # let string_of_student {n II 6 / : 2001 11 21 (OCaml ) 1 (field) name id type # type student = {name : string; id : int};; type student = { name : string; id : int; } student {} type = { 1 : 1 ;...; n : n } { 1 = 1 ;...; n = n

More information

ML λ λ 1 λ 1.1 λ λ λ e (λ ) ::= x ( ) λx.e (λ ) e 1 e 2 ( ) ML λx.e Objective Caml fun x -> e x e let 1

ML λ λ 1 λ 1.1 λ λ λ e (λ ) ::= x ( ) λx.e (λ ) e 1 e 2 ( ) ML λx.e Objective Caml fun x -> e x e let 1 2005 sumii@ecei.tohoku.ac.jp 2005 6 24 ML λ λ 1 λ 1.1 λ λ λ e (λ ) ::= x ( ) λx.e (λ ) e 1 e 2 ( ) ML λx.e Objective Caml fun x -> e x e let 1 let λ 1 let x = e1 in e2 (λx.e 2 )e 1 e 1 x e 2 λ 3 λx.(λy.e)

More information

Jacques Garrigue

Jacques Garrigue Jacques Garrigue Garrigue 1 Garrigue 2 $ print_lines () > for i in $1; do > echo $i > done $ print_lines "a b c" a b c Garrigue 3 Emacs Lisp (defun print-lines (lines) (dolist (str lines) (insert str)

More information

Copyright c 2006 Zhenjiang Hu, All Right Reserved.

Copyright c 2006 Zhenjiang Hu, All Right Reserved. 1 2006 Copyright c 2006 Zhenjiang Hu, All Right Reserved. 2 ( ) 3 (T 1, T 2 ) T 1 T 2 (17.3, 3) :: (Float, Int) (3, 6) :: (Int, Int) (True, (+)) :: (Bool, Int Int Int) 4 (, ) (, ) :: a b (a, b) (,) x y

More information

「計算と論理」 Software Foundations その4

「計算と論理」  Software Foundations   その4 Software Foundations 4 cal17@fos.kuis.kyoto-u.ac.jp http://www.fos.kuis.kyoto-u.ac.jp/~igarashi/class/cal/ November 7, 2017 ( ) ( 4) November 7, 2017 1 / 51 Poly.v ( ) ( 4) November 7, 2017 2 / 51 : (

More information

ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1

ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1 More Logic More Types ML/OCaml GADT Jacques Garrigue ( ) Jacques Le Normand (Google) Didier Rémy (INRIA) @garriguejej ocamlgadt ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1 ( ) ML type nebou and

More information

Copyright c 2008 Zhenjiang Hu, All Right Reserved.

Copyright c 2008 Zhenjiang Hu, All Right Reserved. 2008 10 27 Copyright c 2008 Zhenjiang Hu, All Right Reserved. (Bool) True False data Bool = False True Remark: not :: Bool Bool not False = True not True = False (Pattern matching) (Rewriting rules) not

More information

koba/class/soft-kiso/ 1 λ if λx.λy.y false 0 λ typed λ-calculus λ λ 1.1 λ λ, syntax τ (types) ::= b τ 1 τ 2 τ 1

koba/class/soft-kiso/ 1 λ if λx.λy.y false 0 λ typed λ-calculus λ λ 1.1 λ λ, syntax τ (types) ::= b τ 1 τ 2 τ 1 http://www.kb.ecei.tohoku.ac.jp/ koba/class/soft-kiso/ 1 λ if λx.λy.y false 0 λ typed λ-calculus λ λ 1.1 λ 1.1.1 λ, syntax τ (types) ::= b τ 1 τ 2 τ 1 τ 2 M (terms) ::= c τ x M 1 M 2 λx : τ.m (M 1,M 2

More information

: gettoken(1) module P = Printf exception End_of_system (* *) let _ISTREAM = ref stdin let ch = ref ( ) let read () = (let c =!ch in ch := inp

: gettoken(1) module P = Printf exception End_of_system (* *) let _ISTREAM = ref stdin let ch = ref ( ) let read () = (let c =!ch in ch := inp 7 OCaml () 1. 2. () (compiler) (interpreter) 2 OCaml (syntax) (BNF,backus normal form ) 1 + 2; let x be 2-1 in x; ::= ; let be in ; ::= + - ::= * / ::= 7.1 ( (printable characters) (tokens) 1 (lexical

More information

Objective Caml 3.12 Jacques Garrigue ( ) with Alain Frisch (Lexifi), OCaml developper team (INRIA)

Objective Caml 3.12 Jacques Garrigue ( )   with Alain Frisch (Lexifi), OCaml developper team (INRIA) Objective Caml 3.12 Jacques Garrigue ( ) http://www.math.nagoya-u.ac.jp/~garrigue/ with Alain Frisch (Lexifi), OCaml developper team (INRIA) Jacques Garrigue Modules in Objective Caml 3.12 1 Objective

More information

org/ghc/ Windows Linux RPM 3.2 GHCi GHC gcc javac ghc GHCi(ghci) GHCi Prelude> GHCi :load file :l file :also file :a file :reload :r :type expr :t exp

org/ghc/ Windows Linux RPM 3.2 GHCi GHC gcc javac ghc GHCi(ghci) GHCi Prelude> GHCi :load file :l file :also file :a file :reload :r :type expr :t exp 3 Haskell Haskell Haskell 1. 2. 3. 4. 5. 1. 2. 3. 4. 5. 6. C Java 3.1 Haskell Haskell GHC (Glasgow Haskell Compiler 1 ) GHC Haskell GHC http://www.haskell. 1 Guarded Horn Clauses III - 1 org/ghc/ Windows

More information

jssst-ocaml.mgp

jssst-ocaml.mgp Objective Caml Jacques Garrigue Kyoto University garrigue@kurims.kyoto-u.ac.jp Objective Caml? 2 Objective Caml GC() Standard MLHaskell 3 OCaml () OCaml 5 let let x = 1 + 2 ;; val x : int = 3 ;; val-:

More information

y = x 4 y = x 8 3 y = x 4 y = x 3. 4 f(x) = x y = f(x) 4 x =,, 3, 4, 5 5 f(x) f() = f() = 3 f(3) = 3 4 f(4) = 4 *3 S S = f() + f() + f(3) + f(4) () *4

y = x 4 y = x 8 3 y = x 4 y = x 3. 4 f(x) = x y = f(x) 4 x =,, 3, 4, 5 5 f(x) f() = f() = 3 f(3) = 3 4 f(4) = 4 *3 S S = f() + f() + f(3) + f(4) () *4 Simpson H4 BioS. Simpson 3 3 0 x. β α (β α)3 (x α)(x β)dx = () * * x * * ɛ δ y = x 4 y = x 8 3 y = x 4 y = x 3. 4 f(x) = x y = f(x) 4 x =,, 3, 4, 5 5 f(x) f() = f() = 3 f(3) = 3 4 f(4) = 4 *3 S S = f()

More information

コンピュータ概論

コンピュータ概論 4.1 For Check Point 1. For 2. 4.1.1 For (For) For = To Step (Next) 4.1.1 Next 4.1.1 4.1.2 1 i 10 For Next Cells(i,1) Cells(1, 1) Cells(2, 1) Cells(10, 1) 4.1.2 50 1. 2 1 10 3. 0 360 10 sin() 4.1.2 For

More information

, 1 ( f n (x))dx d dx ( f n (x)) 1 f n (x)dx d dx f n(x) lim f n (x) = [, 1] x f n (x) = n x x 1 f n (x) = x f n (x) = x 1 x n n f n(x) = [, 1] f n (x

, 1 ( f n (x))dx d dx ( f n (x)) 1 f n (x)dx d dx f n(x) lim f n (x) = [, 1] x f n (x) = n x x 1 f n (x) = x f n (x) = x 1 x n n f n(x) = [, 1] f n (x 1 1.1 4n 2 x, x 1 2n f n (x) = 4n 2 ( 1 x), 1 x 1 n 2n n, 1 x n n 1 1 f n (x)dx = 1, n = 1, 2,.. 1 lim 1 lim 1 f n (x)dx = 1 lim f n(x) = ( lim f n (x))dx = f n (x)dx 1 ( lim f n (x))dx d dx ( lim f d

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 Z Z m, n Z m n m, n A m, n B m=n (1) A, B (2) A B = A B = Z/ π : Z Z/ (3) A B Z/ (4) Z/ A, B (5) f : Z Z f(n) = n f = g π g : Z/ Z A, B (6)

More information

「計算と論理」 Software Foundations その3

「計算と論理」  Software Foundations   その3 Software Foundations 3 cal17@fos.kuis.kyoto-u.ac.jp October 24, 2017 ( ) ( 3) October 24, 2017 1 / 47 Lists.v ( ) ( ) ( ) ( 3) October 24, 2017 2 / 47 ( ) Inductive natprod : Type := pair : nat nat natprod.

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

- II

- II - II- - -.................................................................................................... 3.3.............................................. 4 6...........................................

More information

Java演習(4) -- 変数と型 --

Java演習(4)   -- 変数と型 -- 50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends

More information

Microsoft PowerPoint - IntroAlgDs-05-5.ppt

Microsoft PowerPoint - IntroAlgDs-05-5.ppt アルゴリズムとデータ構造入門 25 年 月 日 アルゴリズムとデータ構造入門. 手続きによる抽象の構築.3 Formulating Astractions with Higher-Order Procedures ( 高階手続きによる抽象化 ) 奥乃 博. 3,5,7で割った時の余りが各々,2,3という数は何か? 月 日 本日のメニュー.2.6 Example: Testing for Primality.3.

More information

コンパイラ演習 第 7 回

コンパイラ演習 第 7 回 コンパイラ演習 第 7 回 (2010/11/18) 秋山茂樹池尻拓朗前田俊行鈴木友博渡邊裕貴潮田資秀小酒井隆広山下諒蔵佐藤春旗大山恵弘佐藤秀明住井英二郎 今日の内容 Type Polymorphism ( 型多相性 ) の実現について Polymorphism 大きく分けて 3 種類ある Parametric polymorphism Subtyping polymorphism Ad-hoc polymorphism

More information

1 ( : Documents/kadai4), (ex.py ),. print 12345679 * 63, cd Documents/kadai4, python ex.py., python: can t open file ex.py : [Errno 2] No such file or

1 ( : Documents/kadai4), (ex.py ),. print 12345679 * 63, cd Documents/kadai4, python ex.py., python: can t open file ex.py : [Errno 2] No such file or Python 2010.6 1 Python 1.1 ( ). mi.,.py. 1.2, python.. 1. python, python. ( ). 2.., python. Python (>>>). Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 Type help, copyright,

More information

syspro-0405.ppt

syspro-0405.ppt 3 4, 5 1 UNIX csh 2.1 bash X Window 2 grep l POSIX * more POSIX 3 UNIX. 4 first.sh #!bin/sh #first.sh #This file looks through all the files in the current #directory for the string yamada, and then prints

More information

Int Int 29 print Int fmt tostring 2 2 [19] ML ML [19] ML Emacs Standard ML M M ::= x c λx.m M M let x = M in M end (M) x c λx.

Int Int 29 print Int fmt tostring 2 2 [19] ML ML [19] ML Emacs Standard ML M M ::= x c λx.m M M let x = M in M end (M) x c λx. 1, 2 1 m110057@shibaura-it.ac.jp 2 sasano@sic.shibaura-it.ac.jp Eclipse Visual Studio ML Standard ML Emacs 1 ( IDE ) IDE C C++ Java IDE IDE IDE IDE Eclipse Java IDE Java Standard ML 1 print (Int. 1 Int

More information

ML 演習 第 4 回

ML 演習 第 4 回 ML 演習第 4 回 おおいわ Mar 6, 2003 今回の内容 補足 Ocaml のモジュールシステム structure signature functor Ocaml コンパイラの利用 2 識別子について 利用可能文字 先頭文字 : A~Z, a~z, _ ( 小文字扱い ) 2 文字目以降 : A~Z, a~z, 0~9, _, 先頭の文字の case で 2 つに区別 小文字 : 変数,

More information

プログラミングD - Java

プログラミングD - Java プログラミング D 講義資料 中田明夫 nakata@ist.osaka-u.ac.jp ML 教科書 プログラミング言語 Standard ML 入門 :1,2 章 講義のねらい 関数型プログラムを知る 関数型プログラムを知る利点 プログラムを統一的, 抽象的に捕らえる リスト処理, 高階関数, 再帰関数定義 リストやツリーなどのデータ構造は再帰的に定義 再帰関数で扱うとプログラミングが容易 数学的な裏付け

More information

joho09.ppt

joho09.ppt s M B e E s: (+ or -) M: B: (=2) e: E: ax 2 + bx + c = 0 y = ax 2 + bx + c x a, b y +/- [a, b] a, b y (a+b) / 2 1-2 1-3 x 1 A a, b y 1. 2. a, b 3. for Loop (b-a)/ 4. y=a*x*x + b*x + c 5. y==0.0 y (y2)

More information

() Remrk I = [0, ] [x i, x i ]. (x : ) f(x) = 0 (x : ) ξ i, (f) = f(ξ i )(x i x i ) = (x i x i ) = ξ i, (f) = f(ξ i )(x i x i ) = 0 (f) 0.

() Remrk I = [0, ] [x i, x i ]. (x : ) f(x) = 0 (x : ) ξ i, (f) = f(ξ i )(x i x i ) = (x i x i ) = ξ i, (f) = f(ξ i )(x i x i ) = 0 (f) 0. () 6 f(x) [, b] 6. Riemnn [, b] f(x) S f(x) [, b] (Riemnn) = x 0 < x < x < < x n = b. I = [, b] = {x,, x n } mx(x i x i ) =. i [x i, x i ] ξ i n (f) = f(ξ i )(x i x i ) i=. (ξ i ) (f) 0( ), ξ i, S, ε >

More information

x A Aω ẋ ẋ 2 + ω 2 x 2 = ω 2 A 2. (ẋ, ωx) ζ ẋ + iωx ζ ζ dζ = ẍ + iωẋ = ẍ + iω(ζ iωx) dt dζ dt iωζ = ẍ + ω2 x (2.1) ζ ζ = Aωe iωt = Aω cos ωt + iaω sin

x A Aω ẋ ẋ 2 + ω 2 x 2 = ω 2 A 2. (ẋ, ωx) ζ ẋ + iωx ζ ζ dζ = ẍ + iωẋ = ẍ + iω(ζ iωx) dt dζ dt iωζ = ẍ + ω2 x (2.1) ζ ζ = Aωe iωt = Aω cos ωt + iaω sin 2 2.1 F (t) 2.1.1 mẍ + kx = F (t). m ẍ + ω 2 x = F (t)/m ω = k/m. 1 : (ẋ, x) x = A sin ωt, ẋ = Aω cos ωt 1 2-1 x A Aω ẋ ẋ 2 + ω 2 x 2 = ω 2 A 2. (ẋ, ωx) ζ ẋ + iωx ζ ζ dζ = ẍ + iωẋ = ẍ + iω(ζ iωx) dt dζ

More information

bc0710_010_015.indd

bc0710_010_015.indd Case Study.01 Case Study.02 30 Case Study.05 Case Study.03 Case Study.04 Case Study.06 Case Study.07 Case Study.08 Case Study.21 Case Study.22 Case Study.24 Case Study.23 Case Study.25 Case Study.26

More information

all.dvi

all.dvi fortran 1996 4 18 2007 6 11 2012 11 12 1 3 1.1..................................... 3 1.2.............................. 3 2 fortran I 5 2.1 write................................ 5 2.2.................................

More information

3 3.1 algebraic datatype data k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] B

3 3.1 algebraic datatype data k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] B 3 3.1 algebraic datatype data 1 2... k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] Bob String y Charlie Foo Double Integer Alice 3.14 [1,2],

More information

For_Beginners_CAPL.indd

For_Beginners_CAPL.indd CAPL Vector Japan Co., Ltd. 目次 1 CAPL 03 2 CAPL 03 3 CAPL 03 4 CAPL 04 4.1 CAPL 4.2 CAPL 4.3 07 5 CAPL 08 5.1 CANoe 5.2 CANalyzer 6 CAPL 10 7 CAPL 11 7.1 CAPL 7.2 CAPL 7.3 CAPL 7.4 CAPL 16 7.5 18 8 CAPL

More information

°ÌÁê¿ô³ØII

°ÌÁê¿ô³ØII July 14, 2007 Brouwer f f(x) = x x f(z) = 0 2 f : S 2 R 2 f(x) = f( x) x S 2 3 3 2 - - - 1. X x X U(x) U(x) x U = {U(x) x X} X 1. U(x) A U(x) x 2. A U(x), A B B U(x) 3. A, B U(x) A B U(x) 4. A U(x),

More information

shift/reset [13] 2 shift / reset shift reset k call/cc reset shift k shift (...) k 1 + shift(fun k -> 2 * (k 3)) k 2 * (1 + 3) 8 reset shift reset (..

shift/reset [13] 2 shift / reset shift reset k call/cc reset shift k shift (...) k 1 + shift(fun k -> 2 * (k 3)) k 2 * (1 + 3) 8 reset shift reset (.. arisa@pllab.is.ocha.ac.jp asai@is.ocha.ac.jp shift / reset CPS shift / reset CPS CPS 1 [3, 5] goto try/catch raise call/cc [17] control/prompt [8], shift/reset [5] control/prompt, shift/reset call/cc (continuationpassing

More information

listings-ext

listings-ext (6) Python (2) ( ) ohsaki@kwansei.ac.jp 5 Python (2) 1 5.1 (statement)........................... 1 5.2 (scope)......................... 11 5.3 (subroutine).................... 14 5 Python (2) Python 5.1

More information

1 I 1.1 ± e = = - = C C MKSA [m], [Kg] [s] [A] 1C 1A 1 MKSA 1C 1C +q q +q q 1

1 I 1.1 ± e = = - = C C MKSA [m], [Kg] [s] [A] 1C 1A 1 MKSA 1C 1C +q q +q q 1 1 I 1.1 ± e = = - =1.602 10 19 C C MKA [m], [Kg] [s] [A] 1C 1A 1 MKA 1C 1C +q q +q q 1 1.1 r 1,2 q 1, q 2 r 12 2 q 1, q 2 2 F 12 = k q 1q 2 r 12 2 (1.1) k 2 k 2 ( r 1 r 2 ) ( r 2 r 1 ) q 1 q 2 (q 1 q 2

More information

x () g(x) = f(t) dt f(x), F (x) 3x () g(x) g (x) f(x), F (x) (3) h(x) = x 3x tf(t) dt.9 = {(x, y) ; x, y, x + y } f(x, y) = xy( x y). h (x) f(x), F (x

x () g(x) = f(t) dt f(x), F (x) 3x () g(x) g (x) f(x), F (x) (3) h(x) = x 3x tf(t) dt.9 = {(x, y) ; x, y, x + y } f(x, y) = xy( x y). h (x) f(x), F (x [ ] IC. f(x) = e x () f(x) f (x) () lim f(x) lim f(x) x + x (3) lim f(x) lim f(x) x + x (4) y = f(x) ( ) ( s46). < a < () a () lim a log xdx a log xdx ( ) n (3) lim log k log n n n k=.3 z = log(x + y ),

More information

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool VDM-SL VDM++ 23 6 28 VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web 2 1 3 1.1............................................... 3 1.1.1 bool......................................... 3 1.1.2 real rat int

More information

( ) kadai4, kadai4.zip.,. 3 cos x [ π, π] Python. ( 100 ), x cos x ( ). (, ). def print cos(): print cos()

( ) kadai4, kadai4.zip.,. 3 cos x [ π, π] Python. ( 100 ), x cos x ( ). (, ). def print cos(): print cos() 4 2010.6 1 :, HP.. HP 4 (, PGM/PPM )., python,,, 2, kadai4,.,,, ( )., ( ) N, exn.py ( 3 ex3.py ). N 3.., ( )., ( ) N, (exn.txt).. 1 ( ) kadai4, kadai4.zip.,. 3 cos x [ π, π] Python. ( 100 ), x cos x (

More information

fp.gby

fp.gby 1 1 2 2 3 2 4 5 6 7 8 9 10 11 Haskell 12 13 Haskell 14 15 ( ) 16 ) 30 17 static 18 (IORef) 19 20 OK NG 21 Haskell (+) :: Num a => a -> a -> a sort :: Ord a => [a] -> [a] delete :: Eq a => a -> [a] -> [a]

More information

25 II :30 16:00 (1),. Do not open this problem booklet until the start of the examination is announced. (2) 3.. Answer the following 3 proble

25 II :30 16:00 (1),. Do not open this problem booklet until the start of the examination is announced. (2) 3.. Answer the following 3 proble 25 II 25 2 6 13:30 16:00 (1),. Do not open this problem boolet until the start of the examination is announced. (2) 3.. Answer the following 3 problems. Use the designated answer sheet for each problem.

More information

My関数の作成演習問題集

My関数の作成演習問題集 Excel Sum,Average,Max 330 BMI Excel My Excel VBA Visual BASIC Editor AltF11 Visual BASIC Editor My Function Function -1- Function ( As Single, As Single) As Double Function Funciton Funciton As Single

More information

1 c Koichi Suga, ISBN

1 c Koichi Suga, ISBN c Koichi Suga, 4 4 6 5 ISBN 978-4-64-6445- 4 ( ) x(t) t u(t) t {u(t)} {x(t)} () T, (), (3), (4) max J = {u(t)} V (x, u)dt ẋ = f(x, u) x() = x x(t ) = x T (), x, u, t ẋ x t u u ẋ = f(x, u) x(t ) = x T x(t

More information

2

2 Haskell ( ) kazu@iij.ad.jp 1 2 Blub Paul Graham http://practical-scheme.net/trans/beating-the-averages-j.html Blub Blub Blub Blub 3 Haskell Sebastian Sylvan http://www.haskell.org/haskellwiki/why_haskell_matters...

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

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

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

Emacs ML let start ::= exp (1) exp ::= (2) fn id exp (3) ::= (4) (5) ::= id (6) const (7) (exp) (8) let val id = exp in

Emacs ML let start ::= exp (1) exp ::= (2) fn id exp (3) ::= (4) (5) ::= id (6) const (7) (exp) (8) let val id = exp in Emacs, {l06050,sasano}@sic.shibaura-it.ac.jp Eclipse Visual Studio Standard ML Haskell Emacs 1 Eclipse Visual Studio variable not found LR(1) let Emacs Emacs Emacs Java Emacs JDEE [3] JDEE Emacs Java 2

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

Collatzの問題 (数学/数理科学セレクト1)

Collatzの問題 (数学/数理科学セレクト1) / AICHI UNIVERSITY OF EDUCATION A { z = x + iy 0.100

More information

Microsoft PowerPoint - PC2007.ppt

Microsoft PowerPoint - PC2007.ppt 1 講 義 予 定 2 前 半 :OCaml 入 門 後 半 : 高 性 能 プログラミング 2007 年 度 プログラミングC(CS 学 科 2 年 ) コンピュータ ネットワーク 工 学 科 上 田 和 紀 最 近 脚 光 を 浴 びている 関 数 型 言 語 OCaml を 用 い て, 関 数 型 プログラミン グの 基 本 ( 記 号 の 概 念, リスト 処 理, 高 階 関 数 な ど)および

More information

2.2 h h l L h L = l cot h (1) (1) L l L l l = L tan h (2) (2) L l 2 l 3 h 2.3 a h a h (a, h)

2.2 h h l L h L = l cot h (1) (1) L l L l l = L tan h (2) (2) L l 2 l 3 h 2.3 a h a h (a, h) 1 16 10 5 1 2 2.1 a a a 1 1 1 2.2 h h l L h L = l cot h (1) (1) L l L l l = L tan h (2) (2) L l 2 l 3 h 2.3 a h a h (a, h) 4 2 3 4 2 5 2.4 x y (x,y) l a x = l cot h cos a, (3) y = l cot h sin a (4) h a

More information

つくって学ぶプログラミング言語 RubyによるScheme処理系の実装

つくって学ぶプログラミング言語 RubyによるScheme処理系の実装 Ruby Scheme 2013-04-16 ( )! SICP *1 ;-) SchemeR SICP MIT * 1 Structure and Interpretaion of Computer Programs 2nd ed.: 2 i SchemeR Ruby Ruby Ruby Ruby & 3.0 Ruby ii https://github.com/ichusrlocalbin/scheme_in_ruby

More information

プログラミング言語 8 字句解析器(lexer)と構文解析器(parser)

プログラミング言語 8   字句解析器(lexer)と構文解析器(parser) 8 (lexer) (parser) 1 / 73 (lexer, tokenizer) (parser) Web Page (HTML XML) CSV, SVG,...... config file... ( )! 2 / 73 1 1 OCaml : ocamllex ocamlyacc 2 Python : ply 2! 3 / 73 ( ) 字句解析器 構文解析器 ご注文はうさぎさんですか?

More information

haskell.gby

haskell.gby Haskell 1 2 3 Haskell ( ) 4 Haskell Lisper 5 Haskell = Haskell 6 Haskell Haskell... 7 qsort [8,2,5,1] [1,2,5,8] "Hello, " ++ "world!" "Hello, world!" 1 + 2 div 8 2 (+) 1 2 8 div 2 3 4 map even [1,2,3,4]

More information

平成 19 年度 ( 第 29 回 ) 数学入門公開講座テキスト ( 京都大学数理解析研究所, 平成 19 ~8 年月 72 月日開催 30 日 ) 1 PCF (Programming language for Computable Functions) PCF adequacy adequacy

平成 19 年度 ( 第 29 回 ) 数学入門公開講座テキスト ( 京都大学数理解析研究所, 平成 19 ~8 年月 72 月日開催 30 日 ) 1 PCF (Programming language for Computable Functions) PCF adequacy adequacy 1 PCF (Programming language for Computable Functions) PCF adequacy adequacy 2 N X Y X Y f (x) f x f x y z (( f x) y) z = (( f (x))(y))(z) X Y x e X Y λx. e x x 2 + x + 1 λx. x 2 + x + 1 3 PCF 3.1 PCF PCF

More information

body.dvi

body.dvi ..1 f(x) n = 1 b n = 1 f f(x) cos nx dx, n =, 1,,... f(x) sin nx dx, n =1,, 3,... f(x) = + ( n cos nx + b n sin nx) n=1 1 1 5 1.1........................... 5 1.......................... 14 1.3...........................

More information

応用数学特論.dvi

応用数学特論.dvi 1 1 1.1.1 ( ). P,Q,R,.... 2+3=5 2 1.1.2 ( ). P T (true) F (false) T F P P T P. T 2 F 1.1.3 ( ). 2 P Q P Q P Q P Q P or Q P Q P Q P Q T T T T F T F T T F F F. P = 5 4 Q = 3 2 P Q = 5 4 3 2 P F Q T P Q T

More information

2012 IA 8 I p.3, 2 p.19, 3 p.19, 4 p.22, 5 p.27, 6 p.27, 7 p

2012 IA 8 I p.3, 2 p.19, 3 p.19, 4 p.22, 5 p.27, 6 p.27, 7 p 2012 IA 8 I 1 10 10 29 1. [0, 1] n x = 1 (n = 1, 2, 3,...) 2 f(x) = n 0 [0, 1] 2. 1 x = 1 (n = 1, 2, 3,...) 2 f(x) = n 0 [0, 1] 1 0 f(x)dx 3. < b < c [, c] b [, c] 4. [, b] f(x) 1 f(x) 1 f(x) [, b] 5.

More information

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裱£²²ó ¡Ý½ÉÂꣲ¤Î²òÀ⡤±é½¬£²¡Ý

£Ã¥×¥í¥°¥é¥ß¥ó¥°ÆþÌç (2018) - Â裱£²²ó  ¡Ý½ÉÂꣲ¤Î²òÀ⡤±é½¬£²¡Ý (2018) 2018 7 5 f(x) [ 1, 1] 3 3 1 3 f(x) dx c i f(x i ) 1 0 i=1 = 5 ) ( ) 3 ( 9 f + 8 5 9 f(0) + 5 3 9 f 5 1 1 + sin(x) θ ( 1 θ dx = tan 1 + sin x 2 π ) + 1 4 1 3 [a, b] f a, b double G3(double (*f)(),

More information

Microsoft Word - 03-数値計算の基礎.docx

Microsoft Word - 03-数値計算の基礎.docx δx f x 0 + δ x n=0 a n = f ( n) ( x 0 ) n δx n f x x=0 sin x = x x3 3 + x5 5 x7 7 +... x ( ) = a n δ x n ( ) = sin x ak = (-mod(k,2))**(k/2) / fact_k 10 11 I = f x dx a ΔS = f ( x)h I = f a h I = h b (

More information

基礎数学I

基礎数学I I & II ii ii........... 22................. 25 12............... 28.................. 28.................... 31............. 32.................. 34 3 1 9.................... 1....................... 1............

More information

[ ] x f(x) F = f(x) F(x) f(x) f(x) f(x)dx A p.2/29

[ ] x f(x) F = f(x) F(x) f(x) f(x) f(x)dx A p.2/29 A p./29 [ ] x f(x) F = f(x) F(x) f(x) f(x) f(x)dx A p.2/29 [ ] x f(x) F = f(x) F(x) f(x) f(x) f(x)dx [ ] F(x) f(x) C F(x) + C f(x) A p.2/29 [ ] x f(x) F = f(x) F(x) f(x) f(x) f(x)dx [ ] F(x) f(x) C F(x)

More information

aisatu.pdf

aisatu.pdf 1 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

More information

( ) ( ) 1729 (, 2016:17) = = (1) 1 1

( ) ( ) 1729 (, 2016:17) = = (1) 1 1 1729 1 2016 10 28 1 1729 1111 1111 1729 (1887 1920) (1877 1947) 1729 (, 2016:17) 12 3 1728 9 3 729 1729 = 12 3 + 1 3 = 10 3 + 9 3 (1) 1 1 2 1729 1729 19 13 7 = 1729 = 12 3 + 1 3 = 10 3 + 9 3 13 7 = 91

More information

ML 演習 第 4 回

ML 演習 第 4 回 ML 演習第 4 回 佐藤春旗, 山下諒蔵, 前田俊行 2006/06/20 ICFP Programming Contest 過去の O'Caml プログラムの実績 1998: 2 位 (ENS Camlist, France) 1999: 1 位 (Camls R Us, O'Caml 作者グループ ) 2000: 1 位 (PLClub, U-Penn, 米澤研住井, 細谷参加 ) 2 位 (Camls

More information

プログラミングD - Java

プログラミングD - Java プログラミング D ML 大阪大学基礎工学部情報科学科中田明夫 nakata@ist.osaka-u.ac.jp 教科書 プログラミング言語 Standard ML 入門 1,2 章 講義のねらい 関数型プログラムを知る 関数型プログラムの特徴 利点 : 数学的な裏づけ プログラムの正しさの証明が容易 リスト処理, 高階関数, 再帰関数定義 リストやツリーなどのデータ構造は再帰的に定義 再帰関数で扱うとプログラミングが容易

More information

2.2 Sage I 11 factor Sage Sage exit quit 1 sage : exit 2 Exiting Sage ( CPU time 0m0.06s, Wall time 2m8.71 s). 2.2 Sage Python Sage 1. Sage.sage 2. sa

2.2 Sage I 11 factor Sage Sage exit quit 1 sage : exit 2 Exiting Sage ( CPU time 0m0.06s, Wall time 2m8.71 s). 2.2 Sage Python Sage 1. Sage.sage 2. sa I 2017 11 1 SageMath SageMath( Sage ) Sage Python Sage Python Sage Maxima Maxima Sage Sage Sage Linux, Mac, Windows *1 2 Sage Sage 4 1. ( sage CUI) 2. Sage ( sage.sage ) 3. Sage ( notebook() ) 4. Sage

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

( 28 ) ( ) ( ) 0 This note is c 2016, 2017 by Setsuo Taniguchi. It may be used for personal or classroom purposes, but not for commercial purp

( 28 ) ( ) ( ) 0 This note is c 2016, 2017 by Setsuo Taniguchi. It may be used for personal or classroom purposes, but not for commercial purp ( 28) ( ) ( 28 9 22 ) 0 This ote is c 2016, 2017 by Setsuo Taiguchi. It may be used for persoal or classroom purposes, but ot for commercial purposes. i (http://www.stat.go.jp/teacher/c2epi1.htm ) = statistics

More information

Microsoft PowerPoint - IntroAlgDs-07-6.ppt [互換モード]

Microsoft PowerPoint - IntroAlgDs-07-6.ppt [互換モード] アルゴリズムとデータ構造入門 2007 年 11 月 6 日 アルゴリズムとデータ構造入門 1. 手続きによる抽象の構築 1.3 高階手続きによる抽象化 奥乃 博 大学院情報学研究科知能情報学専攻知能メディア講座音声メディア分野工学部情報学科計算機科学コース http://winnie.kuis.kyoto-u.ac.jp/~okuno/lecture/07/introalgds/ okuno@nue.org

More information

Excel ではじめる数値解析 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 初版 1 刷発行時のものです.

Excel ではじめる数値解析 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます.   このサンプルページの内容は, 初版 1 刷発行時のものです. Excel ではじめる数値解析 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. http://www.morikita.co.jp/books/mid/009631 このサンプルページの内容は, 初版 1 刷発行時のものです. Excel URL http://www.morikita.co.jp/books/mid/009631 i Microsoft Windows

More information

94 expression True False expression FalseMSDN IsNumber WorksheetFunctionIsNumberexpression expression True Office support.office.com/ja-jp/ S

94 expression True False expression FalseMSDN IsNumber WorksheetFunctionIsNumberexpression expression True Office   support.office.com/ja-jp/ S Excel VBA a Excel VBA VBA IsNumeric IsNumber SpecialCells SpecialCells MSDNMicrosoft Developer NetworkIsNumeric IsNumber SpecialCells IsNumeric VBA IsNumericexpression SpecialCells 94 expression True False

More information

80 X 1, X 2,, X n ( λ ) λ P(X = x) = f (x; λ) = λx e λ, x = 0, 1, 2, x! l(λ) = n f (x i ; λ) = i=1 i=1 n λ x i e λ i=1 x i! = λ n i=1 x i e nλ n i=1 x

80 X 1, X 2,, X n ( λ ) λ P(X = x) = f (x; λ) = λx e λ, x = 0, 1, 2, x! l(λ) = n f (x i ; λ) = i=1 i=1 n λ x i e λ i=1 x i! = λ n i=1 x i e nλ n i=1 x 80 X 1, X 2,, X n ( λ ) λ P(X = x) = f (x; λ) = λx e λ, x = 0, 1, 2, x! l(λ) = n f (x i ; λ) = n λ x i e λ x i! = λ n x i e nλ n x i! n n log l(λ) = log(λ) x i nλ log( x i!) log l(λ) λ = 1 λ n x i n =

More information

解きながら学ぶJava入門編

解きながら学ぶJava入門編 44 // class Negative { System.out.print(""); int n = stdin.nextint(); if (n < 0) System.out.println(""); -10 Ÿ 35 Ÿ 0 n if statement if ( ) if i f ( ) if n < 0 < true false true false boolean literalboolean

More information

³ÎΨÏÀ

³ÎΨÏÀ 2017 12 12 Makoto Nakashima 2017 12 12 1 / 22 2.1. C, D π- C, D. A 1, A 2 C A 1 A 2 C A 3, A 4 D A 1 A 2 D Makoto Nakashima 2017 12 12 2 / 22 . (,, L p - ). Makoto Nakashima 2017 12 12 3 / 22 . (,, L p

More information

ohp03.dvi

ohp03.dvi 19 3 ( ) 2019.4.20 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void int main(int argc, char *argv[]) {... 2 (2) argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0

More information

f(x) x S (optimal solution) f(x ) (optimal value) f(x) (1) 3 GLPK glpsol -m -d -m glpsol -h -m -d -o -y --simplex ( ) --interior --min --max --check -

f(x) x S (optimal solution) f(x ) (optimal value) f(x) (1) 3 GLPK glpsol -m -d -m glpsol -h -m -d -o -y --simplex ( ) --interior --min --max --check - GLPK by GLPK http://mukun mmg.at.infoseek.co.jp/mmg/glpk/ 17 7 5 : update 1 GLPK GNU Linear Programming Kit GNU LP/MIP ILOG AMPL(A Mathematical Programming Language) 1. 2. 3. 2 (optimization problem) X

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

Chap11.dvi

Chap11.dvi . () x 3 + dx () (x )(x ) dx + sin x sin x( + cos x) dx () x 3 3 x + + 3 x + 3 x x + x 3 + dx 3 x + dx 6 x x x + dx + 3 log x + 6 log x x + + 3 rctn ( ) dx x + 3 4 ( x 3 ) + C x () t x t tn x dx x. t x

More information

18 ( ) I II III A B C(100 ) 1, 2, 3, 5 I II A B (100 ) 1, 2, 3 I II A B (80 ) 6 8 I II III A B C(80 ) 1 n (1 + x) n (1) n C 1 + n C

18 ( ) I II III A B C(100 ) 1, 2, 3, 5 I II A B (100 ) 1, 2, 3 I II A B (80 ) 6 8 I II III A B C(80 ) 1 n (1 + x) n (1) n C 1 + n C 8 ( ) 8 5 4 I II III A B C( ),,, 5 I II A B ( ),, I II A B (8 ) 6 8 I II III A B C(8 ) n ( + x) n () n C + n C + + n C n = 7 n () 7 9 C : y = x x A(, 6) () A C () C P AP Q () () () 4 A(,, ) B(,, ) C(,,

More information

平成 28 年度 ( 第 38 回 ) 数学入門公開講座テキスト ( 京都大学数理解析研究所, 平成 ~8 28 月年 48 日開催月 1 日 semantics FB 1 x, y, z,... FB 1. FB (Boolean) Functional

平成 28 年度 ( 第 38 回 ) 数学入門公開講座テキスト ( 京都大学数理解析研究所, 平成 ~8 28 月年 48 日開催月 1 日 semantics FB 1 x, y, z,... FB 1. FB (Boolean) Functional 1 1.1 semantics F 1 x, y, z,... F 1. F 38 2016 9 1 (oolean) Functional 2. T F F 3. P F (not P ) F 4. P 1 P 2 F (P 1 and P 2 ) F 5. x P 1 P 2 F (let x be P 1 in P 2 ) F 6. F syntax F (let x be (T and y)

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

2

2 p1 i 2 = 1 i 2 x, y x + iy 2 (x + iy) + (γ + iδ) = (x + γ) + i(y + δ) (x + iy)(γ + iδ) = (xγ yδ) + i(xδ + yγ) i 2 = 1 γ + iδ 0 x + iy γ + iδ xγ + yδ xδ = γ 2 + iyγ + δ2 γ 2 + δ 2 p7 = x 2 +y 2 z z p13

More information

こんにちは由美子です

こんにちは由美子です Sample size power calculation Sample Size Estimation AZTPIAIDS AIDSAZT AIDSPI AIDSRNA AZTPr (S A ) = π A, PIPr (S B ) = π B AIDS (sampling)(inference) π A, π B π A - π B = 0.20 PI 20 20AZT, PI 10 6 8 HIV-RNA

More information

1 1.1 ( ). z = a + bi, a, b R 0 a, b 0 a 2 + b 2 0 z = a + bi = ( ) a 2 + b 2 a a 2 + b + b 2 a 2 + b i 2 r = a 2 + b 2 θ cos θ = a a 2 + b 2, sin θ =

1 1.1 ( ). z = a + bi, a, b R 0 a, b 0 a 2 + b 2 0 z = a + bi = ( ) a 2 + b 2 a a 2 + b + b 2 a 2 + b i 2 r = a 2 + b 2 θ cos θ = a a 2 + b 2, sin θ = 1 1.1 ( ). z = + bi,, b R 0, b 0 2 + b 2 0 z = + bi = ( ) 2 + b 2 2 + b + b 2 2 + b i 2 r = 2 + b 2 θ cos θ = 2 + b 2, sin θ = b 2 + b 2 2π z = r(cos θ + i sin θ) 1.2 (, ). 1. < 2. > 3. ±,, 1.3 ( ). A

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

() x + y + y + x dy dx = 0 () dy + xy = x dx y + x y ( 5) ( s55906) 0.7. (). 5 (). ( 6) ( s6590) 0.8 m n. 0.9 n n A. ( 6) ( s6590) f A (λ) = det(a λi)

() x + y + y + x dy dx = 0 () dy + xy = x dx y + x y ( 5) ( s55906) 0.7. (). 5 (). ( 6) ( s6590) 0.8 m n. 0.9 n n A. ( 6) ( s6590) f A (λ) = det(a λi) 0. A A = 4 IC () det A () A () x + y + z = x y z X Y Z = A x y z ( 5) ( s5590) 0. a + b + c b c () a a + b + c c a b a + b + c 0 a b c () a 0 c b b c 0 a c b a 0 0. A A = 7 5 4 5 0 ( 5) ( s5590) () A ()

More information

r03.dvi

r03.dvi 19 ( ) 019.4.0 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void... argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0 a a \0 b b b \0 c c c \0 1: // argdemo1.c ---

More information

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I  Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~alse I Exercise on Programming I http://bit.ly/oitprog1 1, 2 of 14 ( RD S ) I 1, 2 of 14 1 / 44 Ruby Ruby ( RD S ) I 1, 2 of 14 2 / 44 7 5 9 2 9 3 3 2 6 5 1 3 2 5 6 4 7 8 4 5 2 7 9 6 4 7 1 3 ( RD S ) I 1, 2

More information

橡00扉.PDF

橡00扉.PDF SQ2.1 SQ2.2 ( ) 19971998 1981-97

More information

Dive into Algebraic Effects

Dive into Algebraic Effects Dive into Algebraic Effects びしょ じょ ML Days #2 September 16, 2018 やること Algebraic Effects を伝道 Algebraic Effects is 何 Algebraic Effects が使える言語 Algebraic Effects の活用事例 研究のご紹介先日 JSSST でポスター発表した内容を紹介シマス 目次 自己紹介

More information

4 R f(x)dx = f(z) f(z) R f(z) = lim R f(x) p(x) q(x) f(x) = p(x) q(x) = [ q(x) [ p(x) + p(x) [ q(x) dx =πi Res(z ) + Res(z )+ + Res(z n ) Res(z k ) k

4 R f(x)dx = f(z) f(z) R f(z) = lim R f(x) p(x) q(x) f(x) = p(x) q(x) = [ q(x) [ p(x) + p(x) [ q(x) dx =πi Res(z ) + Res(z )+ + Res(z n ) Res(z k ) k f(x) f(z) z = x + i f(z). x f(x) + R f(x)dx = lim f(x)dx. R + f(x)dx = = lim R f(x)dx + f(x)dx f(x)dx + lim R R f(x)dx Im z R Re z.: +R. R f(z) = R f(x)dx + f(z) 3 4 R f(x)dx = f(z) f(z) R f(z) = lim R

More information