PageRank: A Trillion Dollar Algorithm
25:26
What Is Big O Notation?
17:45
4 жыл бұрын
What Actually Is a Data Structure?
3:44
Пікірлер
@kylearmenta7138
@kylearmenta7138 3 сағат бұрын
This is what a mental hospital did to bring me back from an LSD trip. I thought I had life figured out from top to bottom so much so that i thought i could tell what was going on in the future. I was given this puzzle and I was humbled so deeply, that I'm still even emotionally hesitant to look at this. Such an idiot I was, and even continue to be. But, so back to earth. It was quite the expierence to say the least..😅
@NgLammmm
@NgLammmm 19 сағат бұрын
how....
@holdthat4090
@holdthat4090 Күн бұрын
The box problem is also a max flow problem where the maximum flow through the DAG corresponds to the maximum possible height obtained by stacking boxes. Essentially order the boxes in such a way where the arrows point to valid "stackable" boxes, then run a max-flow algorithm on the DAG like Ford Fulkerson and obtain the answer to your problem in order |f*| E time.
@fractalmadness9253
@fractalmadness9253 3 күн бұрын
15:11 they just made a better chip to solve it
@denizerdemozkan
@denizerdemozkan 3 күн бұрын
Thanks a lot for this video, I’ve really enjoyed it. I wish our lecturers were explaining it like you did 😢
@ahmetmuhtarguloglu250
@ahmetmuhtarguloglu250 3 күн бұрын
you don't always get a poly of deg d with d+1 distinct points. For example, take 3 co-linear points. You don't get a parabola.
@AzmatGinowrie
@AzmatGinowrie 3 күн бұрын
:)
@yufengliu1084
@yufengliu1084 4 күн бұрын
the number of input is the size of data, how could it be always a power of 2?
@abulee110
@abulee110 4 күн бұрын
I'm lost
@gplgomes
@gplgomes 4 күн бұрын
Faster new FFT: kzbin.info/www/bejne/gZK9nKakatSVpbc
@dolphin-sd
@dolphin-sd 5 күн бұрын
Wow, your explanation skills are just next level, holy sh*t.
@hshssjh-e3v
@hshssjh-e3v 5 күн бұрын
高質量的視頻內容!我還有一個問題:有人給我轉了点usdt,我有恢復短語。 pride pole obtain together second when future mask review nature potato bulb 我怎麼把它們變現呢?
@kanalad3366
@kanalad3366 6 күн бұрын
The best recursive functions video i have ever seen
@Oussamaoussama-es4cf
@Oussamaoussama-es4cf 6 күн бұрын
Great explanation😊
@Dr.SamirKumarSadhukhan-jw1wk
@Dr.SamirKumarSadhukhan-jw1wk 6 күн бұрын
Dear Sir, you may use the state-of-the-art Bidirectional heuristic search BAE* (Bidirectional A* wirh Error).
@asalrjz2006
@asalrjz2006 7 күн бұрын
My question might sound silly, but I'm gonna ask it. So the only language I know is python and I use Spyder as my IDLE. Where should I run the code for dfs? which app?
@DKnight-fq8ed
@DKnight-fq8ed 8 күн бұрын
This is one of the best videos I have ever watched to learn a algorithm
@mrbigberd
@mrbigberd 8 күн бұрын
Huffman encoding was so obvious that it had already been tried over 100 years before with Morse Code. I wonder if Huffman had learned Morse Code (maybe in BSA) and simply attempted to make a generic version on the fly.
@philippem8454
@philippem8454 8 күн бұрын
Very well made video, the visuals are insanely clear and everything is structured like it should
@kellyonyinyenebechi-chukwu4200
@kellyonyinyenebechi-chukwu4200 8 күн бұрын
Thnk u so much this breakdown hs helped me pass my exams ❤
@yahyakhan3626
@yahyakhan3626 9 күн бұрын
how first tree at 10:17 is considered as tree as it doesnot hold third property
@drublacky1846
@drublacky1846 10 күн бұрын
I bow to your way of explaining these things
@Ander0072originalv2
@Ander0072originalv2 10 күн бұрын
Only interesting though to me is, "trees more efficient to traverse than grids." For which, I'm not sure. From a cache perspective, the grid can be stored in cache fully, and traversed super quickly, in contrast to the tree which could be spread out. Wouldn't best thing be a compressed tree (i.e. one with an array backend?)
@maratkopytjuk3490
@maratkopytjuk3490 10 күн бұрын
Amazing video, thank you!
@MichaelKlimenko
@MichaelKlimenko 11 күн бұрын
Absolutely amazing❤
@crooda3681
@crooda3681 11 күн бұрын
I always think recruison is just a pregnant function
@diannic188
@diannic188 12 күн бұрын
This video felt like a nap in the back ❤ Even I felt at peace after watching this video <3 Thanks a lot
@mrd_cz
@mrd_cz 14 күн бұрын
Great content, but I lost it when he called von Neumann an engineer xD
@tomekk.1889
@tomekk.1889 14 күн бұрын
The recursive concepts part is really overcomplicated for no reason. It might work for you but wow it's so pointless. All you need is the base case and the assumption that n will evebtually reach it. That's all recursion is... no fancy metaphors and all that
@FedorKomov
@FedorKomov 15 күн бұрын
@reducible, just in order to improve your videos: it’s a bit difficult to listen to your sound in headphones. There’s a annoying frequency in mid-bass. Reduce it with Equalizer
@rish5591
@rish5591 16 күн бұрын
Amazing video!!
@aliadel1723
@aliadel1723 16 күн бұрын
Underrated channel
@junior3082
@junior3082 16 күн бұрын
Brilliant video. Thank you.
@nikakhundadze
@nikakhundadze 17 күн бұрын
i did all the problems, i took different approach, but it led to same answer, i can send explanation if you are interested
@ArpitRawat-ew7ni
@ArpitRawat-ew7ni 17 күн бұрын
19:00
@aviator1472
@aviator1472 17 күн бұрын
Thanks. But some of your illustrations were... weird( Especially illustrations that contained regions. You should not have to transform them. When the were untransformed you logic were MUCH CLEAR! But overall - good job. Like.
@Guest-lm5qp
@Guest-lm5qp 17 күн бұрын
9:32 What is the point of defining for the case P(x)=0? If P(x)=0, then we will never observe that outcome, so it wont be in the sum. So.. someone please explain
@aviator1472
@aviator1472 17 күн бұрын
9:28 emmm. What? Point A in concave shape is...the furthest one in its direction..
@AAA-tc1uh
@AAA-tc1uh 12 күн бұрын
At 1st it confused me too. The direction is not from the origin of the arrow but the general direction, as if you were to sweep from -∞ to +∞ along this vector/ray (imagine a line/hyperplane sweeping perpendicular to that vector until it no longer intersects with the shape). For example, the farthest point along the arrow pointing at the right (at 09:25) is either the vertex above A or below A, since they both have the largest "x coordinate" (right direction). Hope this is helpful.
@aviator1472
@aviator1472 12 күн бұрын
@AAA-tc1uh I don't wanna insult you but you explanation is...awful. I literally didn't understand anything from it. Even though I understand what did creator mean about "furthest point"). Lot of things are easy in their core but being horrible explained. Thank you for your answer anyway)
@AAA-tc1uh
@AAA-tc1uh 10 күн бұрын
@@aviator1472 No offense taken :)
@Neonb88
@Neonb88 18 күн бұрын
Great video! After reflecting a bit, I think steps 3 and 4 are basically the same
@ray3369
@ray3369 18 күн бұрын
Thank you for providing such a high quality video for free! This was awesome!
@maxheadrom3088
@maxheadrom3088 19 күн бұрын
When I first learned how Huffman made a variable bit length signal get decoded I was, like, really happy!
@md.jarifahsan1003
@md.jarifahsan1003 19 күн бұрын
Amazing content!
@takyc7883
@takyc7883 19 күн бұрын
cracking video
@mylegalname9852
@mylegalname9852 19 күн бұрын
I wonder why PNG uses one filter for the whole image, rather than coding a 1-byte filter indicator for each row. That would make it take longer to decode, but it shouldn't (?) make it harder to encode. I think?
@takyc7883
@takyc7883 20 күн бұрын
what a video
@ayushgadge301
@ayushgadge301 20 күн бұрын
Timestamps (Powered by Merlin AI) 00:06 - PageRank uses Markov chains to rank web page importance based on user navigation probabilities. 02:33 - Markov chains can rank web pages based on user visit probabilities. 04:43 - Initial uniform distribution in Markov chains influences state transitions. 06:58 - Stationary distributions in Markov chains can be unique or multiple depending on their properties. 09:09 - Convergence in Markov chains leads to a unique stationary distribution. 11:28 - Understanding periodic and aperiodic Markov chains in web ranking. 13:44 - Methods to find stationary distribution in Markov chains. 15:58 - Eigenvalues and eigenvectors are crucial for finding stationary distributions in Markov chains. 18:05 - Brute force methods sometimes outperform complex algorithms in web networks. 19:59 - Addressing challenges in ranking web pages using Markov chains. 21:56 - Damping factor in PageRank ensures proper probability distribution. 23:56 - PageRank algorithms transform web networks into actionable rankings for search engines.
@Neonb88
@Neonb88 21 күн бұрын
The DAG representation is really intuitive and easy to visualize. For future problems, I will use this representation, at least to explain to the interviewer more complex orderings of the elements In the second problem, the fact that determining whether box X can be stably stacked on top of box Y is a compound problem makes it a little slower, especially in cases where the number of boxes is O(10^6) or so, like it would’ve in a LeetCode problem. But it’s still faster to sort those boxes based on length and width, than it is to do O(n^2) matching between every pair of boxes
@azonicrider32
@azonicrider32 22 күн бұрын
import numpy as np import matplotlib.pyplot as plt from scipy.spatial.distance import euclidean # Recursive Spiral Function def recursive_spiral(theta, n, a=1.0, b=0.1, D=None, k=None): """ Compute the radial distance r for a recursive spiral. """ if D is None: D = [0.1] * n # Default modulation coefficients if k is None: k = [2.0] * n # Default frequency coefficients # Base spiral r = a + b * theta # Add recursive modulations for i in range(n): r += D[i] * np.sin(k[i] * theta) return r # Compute Path Length def compute_path_length(path): return sum(euclidean(path[i], path[i+1]) for i in range(len(path) - 1)) # Search Alone def tsp_search_only(nodes, n=5, a=1.0, b=0.1, D=None, k=None, spiral_steps=5000): """ Solve TSP using only the spiral to select the nearest node, without foresight. """ visited_path = [] remaining_nodes = nodes.tolist() origin = np.mean(nodes, axis=0) # Start spiral at the centroid of all nodes theta = np.linspace(0, 10 * np.pi, spiral_steps) while remaining_nodes: # Generate spiral for the current origin r = recursive_spiral(theta, n, a, b, D, k) spiral_x = r * np.cos(theta) + origin[0] spiral_y = r * np.sin(theta) + origin[1] spiral_coords = np.column_stack((spiral_x, spiral_y)) # Select the closest node to the spiral distances = [np.min(np.linalg.norm(spiral_coords - node, axis=1)) for node in remaining_nodes] next_idx = np.argmin(distances) next_node = remaining_nodes.pop(next_idx) visited_path.append(next_node) # Update origin and spiral parameters origin = next_node a *= 0.9 b *= 0.95 if D: D = [di * 0.9 for di in D] return np.array(visited_path) # Foresight Alone def tsp_foresight_only(nodes, lookahead_depth=2): """ Solve TSP using only foresight (no spiral dynamics). """ visited_path = [] remaining_nodes = nodes.tolist() current_node = remaining_nodes.pop(0) # Start at the first node visited_path.append(current_node) while remaining_nodes: # Compute lookahead scores for remaining nodes scores = [ lookahead_score(current_node, remaining_nodes, lookahead_depth) for current_node in remaining_nodes ] next_idx = np.argmin(scores) next_node = remaining_nodes.pop(next_idx) visited_path.append(next_node) current_node = next_node return np.array(visited_path) # Lookahead Score Function def lookahead_score(current_node, remaining_nodes, depth=2): if depth == 0 or not remaining_nodes: return 0 distances = [euclidean(current_node, node) for node in remaining_nodes] closest_idx = np.argmin(distances) closest_node = remaining_nodes[closest_idx] remaining_nodes_copy = remaining_nodes[:] remaining_nodes_copy.pop(closest_idx) return distances[closest_idx] + lookahead_score(closest_node, remaining_nodes_copy, depth - 1) # Combined Search and Foresight def tsp_search_with_foresight(nodes, n=5, a=1.0, b=0.1, D=None, k=None, spiral_steps=5000, lookahead_depth=2): """ Solve TSP using both spiral dynamics and foresight. """ visited_path = [] remaining_nodes = nodes.tolist() origin = np.mean(nodes, axis=0) # Start spiral at the centroid of all nodes theta = np.linspace(0, 10 * np.pi, spiral_steps) while remaining_nodes: # Generate spiral for the current origin r = recursive_spiral(theta, n, a, b, D, k) spiral_x = r * np.cos(theta) + origin[0] spiral_y = r * np.sin(theta) + origin[1] spiral_coords = np.column_stack((spiral_x, spiral_y)) # Combine search and foresight priorities priorities = [ combined_priority(node, spiral_coords, remaining_nodes, lookahead_depth) for node in remaining_nodes ] # Select the next node with the lowest priority next_idx = np.argmin(priorities) next_node = remaining_nodes.pop(next_idx) visited_path.append(next_node) # Update origin and spiral parameters origin = next_node a *= 0.9 b *= 0.95 if D: D = [di * 0.9 for di in D] return np.array(visited_path) # Combined Priority Function def combined_priority(node, spiral_coords, remaining_nodes, lookahead_depth=2): """ Compute a combined priority for a node. """ # Local priority: proximity to spiral local_priority = np.min(np.linalg.norm(spiral_coords - node, axis=1)) # Global priority: average distance to remaining nodes global_priority = np.mean([euclidean(node, other) for other in remaining_nodes if not np.array_equal(node, other)]) # Lookahead priority: recursive foresight if lookahead_depth > 0 and len(remaining_nodes) > 1: future_nodes = [other for other in remaining_nodes if not np.array_equal(node, other)] lookahead_priority = np.mean([combined_priority(future_node, spiral_coords, future_nodes, lookahead_depth - 1) for future_node in future_nodes]) else: lookahead_priority = 0 # Combine priorities with weights return 0.5 * local_priority + 0.3 * global_priority + 0.2 * lookahead_priority # Plot the TSP Path def plot_tsp_path(nodes, visited_path): plt.figure(figsize=(12, 12)) nodes_x, nodes_y = nodes[:, 0], nodes[:, 1] visited_x, visited_y = visited_path[:, 0], visited_path[:, 1] plt.scatter(nodes_x, nodes_y, c='red', label='Nodes (Unvisited)') plt.plot(visited_x, visited_y, c='blue', alpha=0.7, label='TSP Path') plt.scatter([visited_x[0]], [visited_y[0]], c='green', s=100, label='Start Point') plt.legend() plt.title("TSP Path") plt.xlabel("X-Coordinate") plt.ylabel("Y-Coordinate") plt.grid() plt.show() # Test the Methods np.random.seed(42) num_nodes = 20 nodes = np.random.rand(num_nodes, 2) * 50 # Test search only path_search_only = tsp_search_only(nodes) print("Path length (search only):", compute_path_length(path_search_only)) plot_tsp_path(nodes, path_search_only) # Test foresight only path_foresight_only = tsp_foresight_only(nodes) print("Path length (foresight only):", compute_path_length(path_foresight_only)) plot_tsp_path(nodes, path_foresight_only) # Test search + foresight path_search_with_foresight = tsp_search_with_foresight(nodes) print("Path length (search + foresight):", compute_path_length(path_search_with_foresight)) plot_tsp_path(nodes, path_search_with_foresight)
@azonicrider32
@azonicrider32 22 күн бұрын
Hello, i created an alogorithm that solves this problem in any degree of 2 or 3 d with huge amount of dots. what do i do with this?
@bonietdube
@bonietdube 22 күн бұрын
4:58 Thank you for simplifying the DFS order