Ai Cheat Sheet
  • Home
  • Statistics ↓↑
    • Types of Measure
    • Population and Sample
    • Outliers
    • Variance
    • Standard Deviation
    • Skewness
    • Percentiles
    • Deciles
    • Quartiles
    • Box and Whisker Plots
    • Correlation and Covariance
    • Hypothesis Test
    • P Value
    • Statistical Significance
    • Bootstrapping
    • Confidence Interval
    • Central Limit Theorem
    • F1 Score (F Measure)
    • ROC and AUC
    • Random Variable
    • Expected Value
    • Central Limit Theorem
  • Probability ↓↑
    • What is Probability
    • Joint Probability
    • Marginal Probability
    • Conditional Probability
    • Bayesian Statistics
    • Naive Bayes
  • Data Science ↓↑
    • Probability Distribution
    • Bernoulli Distribution
    • Uniform Distribution
    • Binomial Distribution
    • Poisson Distribution
    • Normal Distribution
    • T-SNE
  • Data Engineering ↓↑
    • Data Science vs Data Engineering
    • Data Architecture
    • Data Governance
    • Data Quality
    • Data Compliance
    • Business Intelligence
    • Data Modeling
    • Data Catalog
    • Data Cleaning
    • Data Format
      • Apache Avro
    • Tools
      • Data Fusion
      • Dataflow
      • Dataproc
      • BigQuery
    • Cloud Platforms
      • GCP
    • SQL
      • ACID
      • SQL Transaction
      • Query Optimization
    • Data Engineering Interview Questions
  • Vector and Matrix
    • Vector
    • Matrix
  • Machine Learning ↓↑
    • L1 and L2 Loss Function
    • Linear Regression
    • Logistic Regression
    • Naive Bayes Classifier
    • Resources
  • Deep Learning ↓↑
    • Neural Networks and Deep Learning
    • Improving Deep Neural Networks
    • Structuring Machine Learning Projects
    • Convolutional Neural Networks
    • Sequence Models
    • Bias
    • Activation Function
    • Softmax
    • Cross Entropy
  • Natural Language Processing ↓↑
    • Linguistics and NLP
    • Text Augmentation
    • CNN for NLP
    • Transformers
      • Implementation
  • Computer Vision ↓↑
    • Object Localization
    • Object Detection
    • Bounding Box Prediction
    • Evaluating Object Localization
    • Anchor Boxes
    • YOLO Algorithm
    • R-CNN
    • Face Recognition
  • Time Series
    • Resources
  • Reinforcement Learning
    • Reinforcement Learning
  • System Design
    • SW Diagramming
    • Feed
  • Tools
    • PyTorch
    • Tensorflow
    • Hugging Face
  • MLOps
    • Vertex AI
      • Dataset
      • Feature Store
      • Pipelines
      • Training
      • Experiments
      • Model Registry
      • Serving
        • Batch Predictions
        • Online Predictions
      • Metadata
      • Matching Engine
      • Monitoring and Alerting
  • Interview Questions ↓↑
    • Questions by Shared Experience
  • Contact
    • My Personal Website
Powered by GitBook
On this page
  • Adding Vector
  • Magnitude of a Vector
  • Multiplying a Vector by a Vector
  • Polar and Cartesian Coordinates

Was this helpful?

  1. Vector and Matrix

Vector

PreviousData Engineering Interview QuestionsNextMatrix

Last updated 4 years ago

Was this helpful?

A vector has a magnitude and direction. The length of the line shows its magnitude and the arrowhead points in the direction. We can add two vectors by joining them head-to-tail. And it doesn't matter which order we add them, we get the same result.

We can also subtract one vector from another. First, we reverse the direction of the vector we want to subtract, then add them as usual.

Adding Vector

We can add vectors by adding the x parts and adding the y parts.

a=(8,13),b=(26,7),c=(8,13)+(26,7)=(8+26,13+7)=(34,20)a = (8,13), b = (26,7), c = (8, 13) + (26, 7) = (8+26, 13+7) = (34, 20)a=(8,13),b=(26,7),c=(8,13)+(26,7)=(8+26,13+7)=(34,20)

Magnitude of a Vector

∣a∣=(x2+y2)|a| = \sqrt( x^2 + y^2 )∣a∣=(​x2+y2)

Magnitude of the vector,∣b∣=(6,8)=(62+82)=(36+64)=100=10|b| = (6,8) = \sqrt( 6^2 + 8^2) = \sqrt( 36+64) = \sqrt100 = 10∣b∣=(6,8)=(​62+82)=(​36+64)=1​00=10

Multiplying a Vector by a Vector

  • Dot Product - Result is a Scaler

    • a⋅b=∣a∣×∣b∣×cos(θ)a \cdot b = \lvert a \lvert \times \lvert b \lvert \times cos (\theta)a⋅b=∣a∣×∣b∣×cos(θ)

    • Multiply the length of a times the length of b, then multiply by the cosine of the angle between a and b.

    • Or, we can use the formula a⋅b=ax×bx+ay×bya \cdot b = a_x \times b_x + a_y \times b_ya⋅b=ax​×bx​+ay​×by​

    • Multiply the x's, multiply the y's, then add.

  • Cross Product - Results a Vector

    • Cross Product a × b of two vectors is another vector that is at right angles to both.

    • a×b=∣a∣×∣b∣×sin(θ)×na \times b = \lvert a \lvert \times \lvert b \lvert \times sin (\theta) \times na×b=∣a∣×∣b∣×sin(θ)×n

Polar and Cartesian Coordinates

LogoVectors
LogoDot Product
LogoCross Product