본문 바로가기

전체 글

Day 3: Bayes' Theorem HackerRank Day 3: Bayes' Theorem(베이지안 정리): P( A | B ) denotes the probability of the occurrence of A given that B has occurred ( B가 발생하면, A가 발생 할 확률 )P( B | A ) denotes the probability of the occurrence of B given that A has occurred ( A가 발생하면, B가 발생 할 확률 ) Let A and B be two events such that P( A | B ) and P( B | A ),A와 B가 P( A | B ) 그리고 P( B | A ) 라면, 더보기
Day 3: Conditional Probability, Bayes' Theorem HackerRank Day 3: Conditional Probability(조건부 확률):This is defined as the probability of an event occurring, assuming that one or more other events have already occurred.조건부 확률은 하나 이상의 사건이 이미 일어난 후에 어떠한 사건이 발생할 확률이다. Two events, A and B are considered to be independent if event A has no effect on the probability of event B.사건 A가 사건 B에 영향을 미치지 않는다면, 두사건 A와 B는 독립적이다. If events A and B are not indep.. 더보기
Day 2: Basic Probability HacckerRank Day2 Basic probability Event(사건)A set of outcomes of an experiment.어떠한 한 시행에서 일어날 수 있는 결과. Sample Space(표본 공간)An experiment is any procedure that can be infinitely repeated and has a well-defined set of possible outcomes, known as the sample space, S. 한 번의 시행에서 일어날 수 있는 모든 결과의 집합. Probability(확률) The probability of the occurrence of an event, A is: = 원하는 경우의 수 / 모든 경우의 수 Two fundamen.. 더보기
Day 1: Standard Deviation (표준편차) HackerRank 10 days of staticsDay 1 note taking: Standard Deviation Standard Deviation (표준편차): The average distance to the mean. (Square root of variance) 모든 원소 x의 평균 m에 대한 평균거리. (분산의 제곱근) Variance (분산) = The average magnitude of fluctuations of from its expected value. (Standard Deviation)^2 확률변수x들과 기댓값(평균값) m간의 평균 변동 크기. (표준편차)^2#python 3 import math def StandardDeviation(n, arr): mu = sum(arr).. 더보기
특정 하위폴더만 git clone하기 리눅스 명령어를 다수 사용.윈도우에도 cmd창을 git Bash로 사용하면, 리눅스 명령어들을 사용할 수 있습니다. 1. 작업 폴더 생성mkdir testcd test 2. git 명령어를 쓸 수 있도록 초기화git init 3. Sparse Checkout 기능을 활성화git config core.sparseCheckout true 3. clone하기 원하는 remote 저장소의 주소 선언git remote add -f origin 위치에 해당 저장소 주소 입력 (는 빼야함) 4. clone 또는 pull하기 원하는 특정 하위 폴더 또는 파일의 Path 선언echo >> .git/info/sparse-checkout위치에 체크아웃하기 원하는 서브폴더나 파일 을 ""안에 입력 (는 뺴야함) 5. Pull.. 더보기
Algorithm week 1: Union-Find Algorithms, Part 1: week1 Lecture note: I implemented codes in python3. Steps to developing a usable algorithm.􀉾 Model the problem. ( try to understand the main elements of the problem that needs to be solved. )해결해야하는 요소를 이해하고 문제를 모델링한다.􀉾 Find an algorithm to solve it.문제를 해결할 수 있는 알고리즘을 알아낸다.􀉾 Fast enough? Fits in memory?충분히 빠른지, 메모리 사용량은 적당한지 고려한다.􀉾 If not, figure out why.아니라면, 왜 그런지 알아낸다.􀉾 Fin.. 더보기
알고리즘의 성능 알고리즘의 성능을 가리는 5가지 기준 정확성알고리즘이 입력 값에 대해 필요한 절차를 정확히 수행하여, 결과적으로 정확한 값을 제공하는가? 작업량요구되는 기능을 수행하기 위해서, 얼마나 적은 연산을 수행하는가?ex) 특정 정렬 알고리즘에서 비교연산이 몇번 수행되는지. 메모리 사용량얼마나 적은 메모리를 사용하는가? 단순성알고리즘의 정확성 등에 문제가 있을 경우 이를 고쳐야하지만, 복잡한 알고리즘은 분석하기도, 개선하기도 어렵다.그렇게 때문에 얼마나 단순한지가 중요하다. 최적성개선가능한 모든 요소(작업량, 메모리 사용량 등)에 대해 더이상 개선할 여지가 없을 만큼 최적화 되어 있는가? 알고리즘의 수행 시간 분석 방법알고리즘의 효율성을 분석하기위해, 단위 연산이 수행되는 횟수를 입력에 크기에 대한 함수로 구하는.. 더보기
Day 1: Interquartile Range HackerRank 10 days of statistics: Day 1 note taking Interquartile Range Quartiles = 3 points which divide an array into 4 equal range. quartile Q1 Q1 >= 25% of the dataQ2 Q2 >= 50% of the dataQ3 Q3 >= 75% of the data Interquartile Range Q3-Q1 Interquartile Range(사분위 범위): the difference between first(Q1) and third(Q3) quartiles. def median(arr): N = len(arr) if N%2==0: return (arr[(N//2)-1]+arr[N.. 더보기