2022年8月4日 星期四

swarm intelligence 群體智慧- 托福 聽力46-2 部分內容

Swarm intelligence is a collective behavior that emerges from a group of animals, like a colony of termites, a school of fish, or a flock of birds.

群體智能是一群動物的集體行為,如白蟻群、魚群或鳥群。

Let's first consider the principles behind swarm intelligence, and we'll use the ant as our model.

Now, an ant on its own is not that smart. When you have a group of ants, however, there you have efficiency in action.

You see, there's no leader running an ant colony.

讓我們首先考慮群體智能背後的原理,我們將使用螞蟻作為我們的模型。

現在,一隻螞蟻本身並不那麼聰明。 然而,當你有一群螞蟻時,你就有了行動的效率。你看,沒有領導者管理蟻群。

Each individual, each individual ant operates by instinctively following a simple set of rules when foraging for food.

Rule number 1: Deposit a chemical marker... called a pheromone. And rule 2: Follow the strongest pheromone path.

The strongest pheromone path is advantageous to ants seeking food.

So, for example, when ants leave the nest, they deposit a pheromone trail along the route they take.

If they find food, they return to the nest on the same path and the pheromone trail gets stronger—it's doubled in strength.

Because an ant that took a shorter path returns first, its pheromone trail is stronger, and other ants will follow it, according to rule 2.

And as more ants travel that path, the pheromone trail gets even stronger.

每個個體,每個個體的螞蟻在覓食時都本能地遵循一套簡單的規則。規則 1:存放一種化學標記物……稱為信息素。 規則 2:遵循最強的信息素路徑。最強的信息素路徑有利於螞蟻尋找食物。因此,例如,當螞蟻離開巢穴時,它們會沿著它們所走的路線放置一條信息素軌跡。如果它們找到食物,它們會沿著同一條路徑返回巢穴,並且信息素痕跡會變得更強——它的強度會增加一倍。因為根據規則 2,走較短路徑的螞蟻首先返回,它的信息素軌跡更強,其他螞蟻會跟隨它。隨著越來越多的螞蟻在這條路上旅行,信息素的踪跡變得更加強大。

So, what's happening here?

Each ant follows two very basic rules, and each ant acts on information it finds in its immediate local environment.

And it's important to note: Even though none of the individual ants is aware of the bigger plan, they collectively choose the shortest path between the nest and a food source because it's the most reinforced path.

By the way, a-a few of you have asked me about the relevance of what we're studying to everyday life.

And swarm intelligence offers several good examples of how concepts in biology can be applied to other fields.

Well, businesses have been able to use this approach of following simple rules when designing complex systems, for instance, in telephone networks.

When a call is placed from one city to another, it has to connect through a number of nodes along the way.

那麼,這裡發生了什麼?

每隻螞蟻都遵循兩條非常基本的規則,每隻螞蟻都根據在其直接本地環境中找到的信息採取行動。重要的是要注意:即使沒有一隻螞蟻知道更大的計劃,它們也會集體選擇巢穴和食物來源之間的最短路徑,因為它是最堅固的路徑。順便說一句,你們中的一些人問過我我們正在學習的內容與日常生活的相關性。群體智能提供了幾個很好的例子,說明生物學中的概念如何應用於其他領域。好吧,在設計複雜系統時,例如在電話網絡中,企業已經能夠使用這種遵循簡單規則的方法。當從一個城市向另一個城市撥打電話時,它必須通過沿途的多個節點進行連接。

At each point, a decision has to be made: Which direction does the call go from here?

Well, a computer program was developed to answer this question based on rules that are similar to the ones that ants use to find food.

Remember, individual ants deposit pheromones, and they follow the path that is most reinforced.

Now, in the phone network, a computer monitors the connection speed of each path, and identifies the paths that are currently the fastest—the least crowded parts of the network.

And this information, converted into a numeric code, is deposited at the network nodes.

This reinforces the paths that are least crowded at the moment.

The rule the telephone network follows is to always select the path that is most reinforced.

So, similar to the ant's behavior, at each intermediate node, the call follows the path that is most reinforced.

This leads to an outcome which is beneficial to the network as a whole, and calls get through faster.

在每一點上,都必須做出決定:呼叫從這裡往哪個方向進行?

嗯,開發了一個計算機程序來回答這個問題,其規則類似於螞蟻用來尋找食物的規則。請記住,個體螞蟻會沉積信息素,它們會遵循最強化的路徑。現在,在電話網絡中,計算機監控每條路徑的連接速度,並識別當前最快的路徑——網絡中最不擁擠的部分。這些信息,轉換成數字代碼,存放在網絡節點上。這加強了目前最不擁擠的路徑。電話網絡遵循的規則是始終選擇最強化的路徑。因此,類似於螞蟻的行為,在每個中間節點,調用遵循最強化的路徑。這導致對整個網絡有利的結果,並且呼叫更快地通過。

[leetcode] [KMP] KMP

ABCDABD... ABCDABF... 簡單的說, 傳統解兩字串匹配部分 可能會來個雙迴圈, 哀個比對, 當不匹配的時候, 會將下方列再後移1位 然後不匹配再後移 然而 如果像上放已經有4個屬於匹配的字串, 她就應該直接往後移四位來匹配, 而不是只移動1位 隱藏的思維是, 當...