Slides based on "Introduction to Machine Learning with Python" by Andreas Muller and Sarah Guido for Hongdae Machine Learning Study(https://www.meetup.com/Hongdae-Machine-Learning-Study/) (epoch #2)
홍대 머신 러닝 스터디(https://www.meetup.com/Hongdae-Machine-Learning-Study/) (epoch #2)의 "파이썬 라이브러리를 활용한 머신러닝"(옮긴이 박해선) 슬라이드 자료.
Slides based on "Introduction to Machine Learning with Python" by Andreas Muller and Sarah Guido for Hongdae Machine Learning Study(https://www.meetup.com/Hongdae-Machine-Learning-Study/) (epoch #2)
홍대 머신 러닝 스터디(https://www.meetup.com/Hongdae-Machine-Learning-Study/) (epoch #2)의 "파이썬 라이브러리를 활용한 머신러닝"(옮긴이 박해선) 슬라이드 자료.
Slides based on "Introduction to Machine Learning with Python" by Andreas Muller and Sarah Guido for Hongdae Machine Learning Study(https://www.meetup.com/Hongdae-Machine-Learning-Study/) (epoch #2)
홍대 머신 러닝 스터디(https://www.meetup.com/Hongdae-Machine-Learning-Study/) (epoch #2)의 "파이썬 라이브러리를 활용한 머신러닝"(옮긴이 박해선) 슬라이드 자료.
Slides based on "Introduction to Machine Learning with Python" by Andreas Muller and Sarah Guido for Hongdae Machine Learning Study(https://www.meetup.com/Hongdae-Machine-Learning-Study/) (epoch #2)
홍대 머신 러닝 스터디(https://www.meetup.com/Hongdae-Machine-Learning-Study/) (epoch #2)의 "파이썬 라이브러리를 활용한 머신러닝"(옮긴이 박해선) 슬라이드 자료.
Slides based on "Introduction to Machine Learning with Python" by Andreas Muller and Sarah Guido for Hongdae Machine Learning Study(https://www.meetup.com/Hongdae-Machine-Learning-Study/) (epoch #2)
홍대 머신 러닝 스터디(https://www.meetup.com/Hongdae-Machine-Learning-Study/) (epoch #2)의 "파이썬 라이브러리를 활용한 머신러닝"(옮긴이 박해선) 슬라이드 자료.
Slides based on "Introduction to Machine Learning with Python" by Andreas Muller and Sarah Guido for Hongdae Machine Learning Study(https://www.meetup.com/Hongdae-Machine-Learning-Study/) (epoch #2)
홍대 머신 러닝 스터디(https://www.meetup.com/Hongdae-Machine-Learning-Study/) (epoch #2)의 "파이썬 라이브러리를 활용한 머신러닝"(옮긴이 박해선) 슬라이드 자료.
This document discusses parallel binary search. It divides a problem space from minimum to maximum into multiple sub-ranges that can be searched in parallel. The sub-ranges are (min, h), (h, h2), and (h2, max) where h and h2 are splitting points. Each processor then performs binary search on one sub-range independently. This allows the queries to be handled more quickly by searching multiple parts of the problem space in parallel rather than sequentially.
This document discusses algorithms and geometry. It covers the Postech Computer Algorithm Team and convex hulls. The Postech team works on algorithms and geometry problems. Convex hull concepts are explained, including finding the farthest point and defining a convex polygon. Formulas for computing areas and determining if a point is inside a convex shape are provided.
The document discusses the Fast Fourier Transform (FFT) algorithm and its use for multiplying two polynomials. It explains that FFT uses the Fourier transform to break down the polynomial multiplication problem into smaller subproblems by mapping the polynomials to the frequency domain using the Discrete Fourier Transform (DFT). It then describes the Cooley-Tukey algorithm, which is an efficient method for computing the DFT and allows FFT to multiply two polynomials in O(n log n) time rather than O(n^2) time for the standard multiplication approach.
The document discusses segment tree data structures for storing interval data. It describes persistent and dynamic segment trees, which allow maintaining interval data over time as the data is updated. The segment trees support operations like querying the total value in an interval or updating the value of an interval efficiently in logarithmic time.
The document describes a network flow algorithm. It involves modeling the network as a flow graph with nodes and edges having capacities and costs. The algorithm finds the maximum flow from a source to a sink in the graph while minimizing the total cost of the flow. It works by scaling all edge costs and finding augmenting paths with negative reduced costs to increment the flow over each path.
This document discusses concepts in number theory and combinatorics from the POSTECH Computer Algorithm Team. It covers topics like prime numbers, factorization, and counting principles. Example problems and their solutions are provided to illustrate concepts in number theory like finding the greatest common divisor and factoring numbers.
3. POSTECH Computer Algorithm Team
- 이번 시간에는 이진탐색에 대해 알아보겠습니다.
- 말 그대로 탐색의 한 종류로, 특정한 조건하에 어떤 값을 찾는 알고리즘입니다.
개요
개요
4. POSTECH Computer Algorithm Team
- 우선 아래와 상황을 생각해봅시다.
Q) N개의 정수 배열 arr에서 특정한 값 M을 찾는 방법과 그 시간 복잡도(Big O)는?
A) M을 찾을 때까지 배열의 처음부터 끝까지 찾아본다. 즉, O(N)의 시간이 소요된다!
- 그럼, 배열이 정렬되어 있다면?
이진탐색
이진탐색의 개념
5. POSTECH Computer Algorithm Team
이진탐색
이진탐색의 개념
- 배열의 값을 y축, Index를 x축으로 두면 정렬된
배열을 그림과 같이 표현할 수 있습니다.
- 이 상황에서 우리가 찾는 값 M이 5번보다 크다면
당연히 1~4번의 값을 찾아볼 필요가 없습니다.
- 이런 성질들을 이용해봅시다!
1 2 3 4 5 6 7
6. POSTECH Computer Algorithm Team
- 정렬된 배열 arr의 i번째 값을 봤을 때 내가 찾는 값 M과 비교하는 경우는,
If(배열의 i번째 값 arr[i] > M) -> i~N번째 값을 찾아볼 필요가 없음(= 1~i번째에 원하는 값이 있음).
If(배열의 i번째 값 arr[i] < M) -> 1~i번째 값을 찾아볼 필요가 없음(= i~N번째에 원하는 값이 있음).
If(배열의 i번째 값 arr[i] == M) -> 원하는 값을 찾음.
- 위와 같이 정리할 수 있습니다.
이진탐색
이진탐색의 개념
7. POSTECH Computer Algorithm Team
- 지금까지 정리한 걸 보면, 내가 본 값(arr[i])을 찾는 값(M)과 비교해서 답의 범위를 줄여 나갈 수 있다!
- 첫 시간에 우리는 최악의 경우를 고려하는 시간 복잡도 표기법인 Big O notation을 배웠다!
Q) 그렇다면 Big O notation을 사용했을 때 최대한 시간 복잡도를 낮게 하려면 어떻게 비교해야 할까요?
-> Q) 즉, 최악의 경우일 때 답의 범위를 최대한 좁히려면 어떻게 비교해야 할까요?
이진탐색
이진탐색의 개념
8. POSTECH Computer Algorithm Team
A) 답이 있을 수 있는 범위의 중간과 비교하면 된다!
- 중간의 값과 비교하면 최악의 경우라도 범위가 절반으로 줄어든다!
이진탐색
이진탐색의 개념
10. POSTECH Computer Algorithm Team
- 그렇다면 이진탐색을 사용하면 뭐가 좋을지 아래의 질문을 보면서 알아봅시다.
Q) 8개의 정수가 정렬되어 있다. 이때 원하는 값을 찾는 데에 필요한 최악의 연산횟수는?
A-1) 1~8개의 변수를 모두 돌아본다. -> 8번.
A-2) 이진탐색을 활용한다. (8->4->2->1)의 순서로 답으로 가능한 범위가 좁혀지므로 4번.
- 정수가 1000개, 10000개, 1000000개 라면?
필요성
이진탐색의 필요성
11. POSTECH Computer Algorithm Team
- 결국 이진탐색을 사용하는 이유는 빠르기 때문이다!
Q) 이진탐색을 활용하였을 때 N개의 원소에서 M을 찾는 시간 복잡도는?
A) 한 번 연산할 때마다 범위가 절반이 되므로 O(logN)이 된다. 이진탐색은 N이 커지면 커질수록 빛을 발한다!
필요성
이진탐색의 필요성
12. POSTECH Computer Algorithm Team
- 정렬되어 있지 않다면 이진탐색을 활용할 수 없습니다.
Q) N개의 정렬되지 않은 정수 배열이 있다. 이때 특정한 값을 찾는데 걸리는 시간은?
(Hint – N개의 값을 정렬하는데 필요한 시간 복잡도는 O(NlogN)이다)
A-1) N개의 변수를 모두 돌아본다. -> N
A-2) 이진탐색을 활용한다. 정렬을 한 후, 이진탐색을 한다. -> NlogN(정렬) + logN(이진탐색)
Q) 그렇다면, 특정한 값을 M번 찾아야 한다면?
필요성
이진탐색의 필요성
13. POSTECH Computer Algorithm Team
A-1) N개의 변수를 M번 돌아본다. -> NM
A-2) 정렬을 한 후, M번 이진탐색을 한다. -> NlogN(정렬) + MlogN(이진탐색)
- 이와 같이 경우에 따라 정렬되어 있지 않은 배열이 주어져도, 직접 정렬을 한 후 이진탐색을 하는 것이 더 효율
적일 수 있습니다.
필요성
이진탐색의 필요성
14. POSTECH Computer Algorithm Team
https://www.acmicpc.net/problem/1920
https://www.acmicpc.net/problem/3090
https://www.acmicpc.net/problem/1114
- 2,3번은 비슷한 방식으로 풀 수 있습니다!
문제
이진탐색 문제들