Question 1:
Question 1:
In question one our group was required to generate a pair of random vectors in dimensions two, three, four, and five and determine in which dimension are the vectors more likely to be perpendicular. We used the following code to generate the pair of random vectors for each dimension.
This code randomly generated 10,000 pairs of vectors with a specified number of dimensions with components ranging from -1 to 1. Maple then finds the angle between two vectors. The map function is used to convert radians into degrees. The last two lines generate a histogram based on the data.
Our group found that a pair of random vectors is most likely to be perpendicular to each other in the fifth dimension. Each of the four histograms represent the likely hood for the vectors to create a 90 degree angle. In each histogram the x-axis corresponds to the angle, and the y-angle corresponds to the frequency of the angles. Clearly, the fifth dimension has a higher percentage of 90 degree angles.
As the number dimensions increases, the number of different ways one can have a vector be perpendicular to another vector increases. When expanding the number of dimensions from two to three, the number of possible perpendicular vectors for a given vector increase. This suggests that we will be more likely to find perpendicular vectors in dimension three than in dimension two. Looking at the histogram for two dimensions, we see that all the angles form at about the same frequency. When looking at the dimension third dimension graph, we can see that the graph peaks at about 90 degrees.
The same goes for the graphs in the fourth and fifth dimension. It is easy to see that as the dimensions increase the percentage of 90 degree angles increase.
The above histograms are featured in ascending order (2 Dimensions, 3 Dimensions, 4 Dimensions, 5 Dimensions) as you scroll down. The independent axis corresponds to the angle, and the dependent axis corresponds to the frequency of the angles. As the number of dimensions increases, the odds of one vector being perpendicular to another vector also increases, forming a direct relationship. After completing this process for each specified dimension, we concluded that we are more likely to find a pair of corresponding vectors to be perpendicular to each other in the fifth dimension. As the number of dimensions increase, there is a greater probability of finding two vectors that are perpendicular to one another. When analyzing the first histogram, which depicts the angles formed by corresponding vectors in the second dimension, we can see there is a relatively modest distribution. There is no specific trend that represents the greater probability of perpendicular angles forming. However; when we look at the histogram that illustrates the results of the corresponding angles in the third dimension, we can see there is a greater probability of perpendicular angles to form. Since a third axis (in this case, a z-axis) is added to the coordinate system, there are many more opportunities for any two random vectors to form 90 degree angles.
When comparing both the second and third dimensions, it is obvious that the third dimension represents the greatest possibility of vectors forming 90 degree angles. However, as we add more dimensions, the frequency of finding 90 degree angles increases dramatically. This is represented by analyzing the histograms for both the fourth and fifth dimensions. As the number of dimensions increases, we see a peak form around the 90 degree mark, representing a greater likelihood of finding perpendicular angles. Also, if we were to increase the number of random vectors generated, we would clearly see a more accurate representation of this distinction between dimensions. We can conclude that if a sixth dimension were added to this program, we would produce a histogram with an even steeper slope around 90 degrees.
Question 2:
Question 2 asks to generate a heap of random three-dimensional vector pairs and for each pair of vectors plot the cross product versus the dot product, and discuss any apparent observations. Using maple we plugged in the following codes below: When doing this, it let us find the needed magnitude of the cross products and the dot products and divide these values by the products of the lengths of both vectors, and plot the results against each other
This code was used to generate 100 pairs of three dimensional vectors. (We originally used 10,000 but found using 100 made it easier to see the relationship. With using 10,000 a solid line was created which was each of the 10,000 points.) It then establishes a formula for the magnitude of the cross product, divided by the product of both vector lengths, and for the dot product divided by the product of both vector lengths. When trying the code for our list we chose to write it differently but still resulting in the same answer. We made it so the list would generate an “a” and a “b”, each being a random vector. We then made it so the list would generate the cross product vs. the dot product as shown above. These results were then plotted onto a graph.
The graph appears to that of a semicircle. This is because the magnitude of the cross product over the product of the two vector lengths equals , which reduces to . Similarly, the dot product over the product of the two vector lengths is , which reduces to . We can see that the graph forms a semicircle that has a radius of 1.0 and forms over the first and fourth quadrants of the coordinate system. The formulas of the dot product and the cross product would respectively reduce to cos θ and sin θ. A parametric equation, therefore, is formed when these results are plotted.
The unit circle’s appearance reinforces the link of dot products and cross products to trigonometry. When the magnitude of one is at its maximum, the magnitude of the other is always zero. We can see this at the angles of 0 and 180 degrees, where the magnitude of the dot product is maximized, and at 90 degrees, where the magnitude of the cross product is maximized.
Question 3:
The final question asks us to generate a list of triples of random vectors in 3 dimensions and find out how the volumes of parallelpipeds are distributed. The code is as followed:
Maple then records the results and generates a histogram which is shown grouping the volumes of the parallelpipeds produced by the scalar triple product. From the histogram we can coonclude that the greatest frequency of parallelpipeds is with smaller volumes. Parallelpipeds with larger volumes are much less frequent than the smaller. This is because for a large parallelpiped to be generated, the vectors must have close to 90 degree angles in between them and the vectors themselves must be long.
If the histogram was divided into smaller bins, we would probably see that there was a frequency peak shortly to the right of the y-axis, with the frequency falling off rapidly at either side, forming a skewed distribution with the tail to the right. The smallest volumes in the data set would be exceedingly unlikely, as one would require the combination of very small angles between the vectors and/or small vectors, preferably both. Seeing that the data is being randomly generated, this extreme seems that this combination would be almost as unlikely as the largest of the parallelpipeds. (This would probably still be more likely; a single vector of length zero, or and angle between the vectors of 0 degrees would yield a zero volume, while a single angle of 90 degrees or vector of maximum length would not guarantee a maximum volume. )
By examining the graph, we can see a trend in the volume with respect to frequency. As the volume of the parallelepiped decrease, the frequency increased and vice versa. This makes sense because in order to have larger volumes, the vectors forming the shape must be long and have large angles between them. Since we are randomly generating vectors, it is very unlikely to form a parallelepiped with three vectors with large magnitudes and large angles between them. Even though we are more likely to generate 90 degree angles in the third dimension, the distribution of angles over the entire shape would decrease that likelihood