전체 글
-
최소 신장 트리 (Minimum Spanning Tree)자료구조 2024. 10. 1. 19:03
Q. 그래프의 최소 신장 트리 (Minimum Spanning Tree) 알고리즘 중 프림 (Prim) 알고리즘과 크루스칼 (Kruskal) 알고리즘의 차이점과 사용 사례에 대해 설명해 주세요•임의의 Undirected 그래프에서, 모든 Vertex를 최소한의 Edge를 사용해 연결하는 것•이때 Cycle이 있으면 안됨 (특정 지점에서 시작해서, 길을 따라가다 보니 시작 지점으로 돌아왔다 -> Cycle)•이때 N개의 Vertex가 있다면, 임의의 신장 트리(= 최소연결트리) 는 N – 1개의 Edge를 사용했을 것•DFS, BFS 등으로 모든 Vertex(정점,노드)를 탐색하고, 그 도중에 사용된 Edge(간선)만 모으면 만들 수 있음•신장 트리는 통신망, 도로망 구축 등에 유용함아래그림) 신장 트리..
-
확률론에서 베이즈 정리(Bayes' Theorem)의 기본 개념과 활용 예시practice_선형대수 2024. 10. 1. 18:22
Q. 확률론에서 베이즈 정리(Bayes' Theorem)의 기본 개념과 활용 예시에 대해 설 명해 주세요. •주어진 사건의 조건 하에서 다른 사건의 확률을 계산하는 데 사용됩니다.•여러가지 용도가 있지만, 일반적으로 P(A|B)를 통해 P(B|A)를 추정할때 사용한다전제조건이 P(A), P(B)를 알아야된다. •일반적으로, P(A|B)와 P(B|A)는 같지 않다 -> 다른거로 바꾸기 위해 사용한다. •예시•코로나 검사 키트가 있다. 만약 실제 코로나에 걸린 사람이 이 키트를 사용하면, 90%의 확률로 양성이 나온다.•만약 어떤 사람이 이 검사를 해서 양성이 나왔다면, 이 사람이 90%의 확률로 코로나에 걸려 있다고 할 수 있을까? 아래그림•코로나 검사 키트는 실제로 코로나에 걸린 사람이 검사를 ..
-
통계적 가설 검정practice_선형대수 2024. 10. 1. 11:44
Q. 통계적 가설 검정(Hypothesis Testing)의 기본 과정과 주요 개념에 대해 설명 해 주세요. A. 가설 검정은 가설이 데이터에(실험결과) 적합한지를 검토하는 과정입니다.먼저 귀무가설과 대립가설 설정을 하고귀무가설은 효과가 없다고 가설설정하고, 반대로 대립가설은 효과가 있다고 가정 실험을 진행하고, 실험결과와 귀무가설이 얼마나 일치하는지 분석했는데만약 귀무가설이 실험결과와 일치할확률이 5%이하면, 귀무가설을 기각하고, (항상 귀무가설이 참인것으로 설정하고 시작)대립가설을 참인것으로 (95%이상) 결론을 내림. - 귀무가설과 대립가설 설정 -> 동전은 조작되지 않았다. VS 조작되었다.- 검정 통계량 계산 -> 조작되지 않은 동전의 확률계산- p-값..
-
확률변수의 조건부 확률 (Conditional Probability)과 독립성 (Independence)의 개념에 대해 설명해 주세요.practice_선형대수 2024. 10. 1. 11:18
확률이란?•어떠한 사건의 가능성의 크기•확률이 크다면, 이 사건이 일어날 가능성이 크다•반대의 경우도 성립 •확률을 계산하는 가장 직관적인 방법은, 특정 경우의수의 비율을 직접적으로 세는 것이다•주사위를 던져서 1이 나올 확률•(1이 나오는 경우의 수) ÷ (전체 경우의 수)•= 1 / 6 •어떠한 사건 A가 일어날 확률은, 전체 경우의 수 U에서, A가 차지하는 비율과 같다••주사위 예시에서•U = {1, 2, 3, 4, 5, 6}•A = {1} •주사위에서 1이 나올 확률•= (주사위에서 1이 나오는 경우의 수) ÷ (모든 경우의 수) •주사위에서 1이 나오는 경우의 수는?•(주사위: 1, 동전: 앞), (주사위: 1, 동전: 뒤)2 •모든 경우의 수는? 12로 동일•따라서 주사위에서 1이 나올 확률..
-
8. 주성분 분석 (Principal Component Analysis): 차원 축소, 설명된 분산practice_선형대수 2024. 9. 30. 15:37
Q. 주성분 분석(Principal Component Analysis, PCA)의 목적과 기본 원리에 대해 설명해 주세요. •PCA는 데이터의 차원을 축소하여 주요 성분을 추출하는 기법입니다. •데이터의 분산을 최대화하는 방향으로 새로운 축을 정의하여, 데이터의 주요 변동을 보존하면서 차원을 줄입니다.아래그림분산 최대화 - 정보보존 최대화 •집의 특징을 가지고 판매 가격을 예측하는 모델을 만들려고 함•이를 위해 다양한 집들을 돌아다니며 여러 정보를 수집함•집의 위치, 가구원 수, 방의 개수, 집의 크기 (평), 집의 크기 (제곱미터), 주변 상권, 지하철역까지의 거리 …•하지만 이때 몇몇 데이터는 서로 매우 큰 상관관계를 가짐 •집의 크기를 평으로 나타낸 것과, 제곱미터로 나타낸 것은 사실상 같은 정보로..
-
확률분포practice_선형대수 2024. 9. 30. 14:51
Q. 확률분포의 기초 개념과 주요 종류에 대해 설명해 주세요.A. •어떠한 확률 변수 X가 있을때, 이 변수의 값들이 가지는 확률을 나타내는0 함수•간단히 말하자면, X의 여러 값들이 발생할 확률을 나타낸 것•크게 이산 (Discrete)(떨어져있음.셀수있음) 확률 분포와 연속 (Continuous)(셀수있음) 확률 분포로 나뉜다 이산 (Discrete)(떨어져있음.셀수있음) - 모든 경우의 수를 전부 적을수 있음. - 다 더하면 1연속 (Continuous)(셀수있음) 확률 분포 - 경우의 수가 무한하여 전부(하나하나) 적을수 없다. Q 확률 분포란?•확률분포는 확률 변수의 값이 가질 수 있는 확률을 나타내는 함수입니다. •주요 종류로는 정규 분포, 이항 분포, 포아송 분포 등이 있으며, 각각은 특정..
-
행렬이란?practice_선형대수 2024. 9. 30. 14:40
Q. 선형대수에서 행렬의 역행렬(Inverse Matrix)의 정의와 계산 방법에 대해 설명 해 주세요.A. 역행렬은 주어진 행렬과 곱했을 때 단위 행렬이 되는 행렬입니다. 역행렬을 계산하기 위해서는 주어진 행렬이 정방행렬이어야 하며, 주로 가우스-조르당 소거법 또는 수식적인 방법을 사용하여 계산합니다. 행렬이란?•1개 이상의 수를 직사각형의 배열로 나열한 것•한 개의 행만 가지는 행렬을 (1 x N) 행벡터로, 비슷하게 한 개의 열만 가지는 행렬을 (N x 1) 열벡터라고도 한다•행렬 중에서 행과 열의 개수가 동일한 것들을 정방행렬 (Square matrix)라고 한다 (4x4, 3x3 등)•또한, 정방행렬 중 대각선 (Diagonal)만 1이고, 나머지는 모두 0인 행렬을 단위행렬 (I..