Тёмный

I (poorly) simulated the infinite monkey theorem in python 

rooben
Подписаться 698
Просмотров 12 тыс.
50% 1

the infinite monkey theorem goes as follows: a monkey hitting random keys on a typewriter, given an infinite amount of time, will at some point type out the entire works of William Shakespeare, along with every other possible combination of characters. It's one of the best examples of the nature of infinity - so I decided to put it to the test using my limited python knowledge and my laptop.
there is a very good chance that I messed up some of the maths and the coding tutorial part of this video, so please don't take it as fact. If you notice any mistakes let me know!
SOURCES, LINKS & OTHER INTERESTING TIDBITS
romeo and juliet: shakespeare.mit...
python code: coming soon!

Опубликовано:

 

12 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 101   
@christianmetzger540
@christianmetzger540 Год назад
Theres still no explanation as to why the conclusion is that he would write a cohesive novel even if he has infinite time?
@sjey8665
@sjey8665 Год назад
There is and the answer is no, A lot of people think that the monkey can write everything because he has infinite time, But if the monkey is typing randomly there will be things that he will never write even with infinite time, For example: A hundred page book of filled with letter 'a', it's impossible because the random typing, And just like that any human book will be impossible too.
@TheOriginalArchivist
@TheOriginalArchivist Год назад
@@sjey8665 A book filled with the letter a is most certainly not impossible. Just unlikely.
@TheOriginalArchivist
@TheOriginalArchivist Год назад
Given infinite time you wind up with every combination of characters that could exist. By necessity this would include every human text ever written.
@sjey8665
@sjey8665 Год назад
@@TheOriginalArchivist Think carefully and answer me this, What is the probability that a letter other than 'a' will appear on every page? If the letters are typed totally randomly.
@TheOriginalArchivist
@TheOriginalArchivist Год назад
​@@sjey8665The probability would asymptotically approach 1; however, it would never be 1. The alternative (all a's) is certainly extraordinarily unlikely, but the probability is not 0 (just extremely close to 0).
@sweetmesaJS
@sweetmesaJS 6 месяцев назад
Another flaw is that you have all of the characters weighted the same, a monkey wouldn’t be delicately typing one key at a time and consequently any key press would be highly likely to be immediately followed by key presses of adjacent keys
@aybekabdullaev8901
@aybekabdullaev8901 2 года назад
Thank you for this. I'm a python learning student and i came up to this video to find out about the theorem about monkeys, suddenly i find about it with python code which makes me mess around with that code too
@roobenn
@roobenn 2 года назад
thank you for watching & glad I could be helpful! :)
@solarkiddoo
@solarkiddoo 2 года назад
very well done,you greatly simulated it actually and explained it thoroughly and it's also similar to library of babel, it's interesting how much information it is all poems, conversations and this comment and all that has been and all that will be written has already exist there in the library waiting to be found.
@NotReallyACardFan
@NotReallyACardFan 3 года назад
I cannot express how underrated and awesome this channel is. This is my new favorite channel. Watch out VSauce, rooben is coming for you.
@roobenn
@roobenn 3 года назад
thanks so much! Hoping to make more videos soon :) if you have any ideas they’re always welcome!
@NotReallyACardFan
@NotReallyACardFan 3 года назад
A video about something related to the Library of Babel would be interesting! It kinda has the same feel as the infinite monkey theorem.
@silly.VR.1231
@silly.VR.1231 22 дня назад
I wonder if it will do better then twitch chat! edit : it did better somehow SKULLEMOJIIIIIIIIII💀💀💀💀💀💀
@bobbobsson1885
@bobbobsson1885 2 года назад
3:14 HOLY SHIT I SEE IT
@megutrp
@megutrp 2 года назад
WYSI
@sbf5914misterfeikecksdeeeeee
@sbf5914misterfeikecksdeeeeee 2 года назад
WHEN
@pinruihuang8463
@pinruihuang8463 Год назад
osu brain rot
@johnodonnell4593
@johnodonnell4593 Год назад
Enjoyed this video. Thanks very much. A few comments. 1. It doesn't count as progress unless the Monkey/computer types out the first 8 letters (as opposed to 8 characters from anywhere in the middle) so that's what I'd have been on the lookout for. 2. In the context of this scenario, a computer simulation is only marginally faster than using a real monkey. For example, I did a rough calculation of how many years it would take the monkey to type the works of Shakespeare and got to something like 10 raised to the power of 3 million. Assuming the computer can "type" a billion times faster than a monkey, it would still take 10 to the power of approximately 3 million for your computer to achieve the same task. (i.e., when the exponent is of the order of millions, an acceleration of a billion or so is immaterial). You've prompted me to back and redo the calculation - thanks for that!
@johnnydickson670
@johnnydickson670 Год назад
well the theorem says that the number of monkeys typing is also infinite. It's kinda pointless to calculate how long it would take when we have an infinite amount of monkeys.
@johnodonnell4593
@johnodonnell4593 Год назад
@@johnnydickson670 That would be pointless - but the theorem has always stated "one monkey", "infinite time". Where did you see otherwise?
@nishishishir1729
@nishishishir1729 3 года назад
Don't be shy, add all of the works of Shakespeare
@roobenn
@roobenn 3 года назад
but….. that’s effort
@nishishishir1729
@nishishishir1729 3 года назад
@@roobenn for science
@nishishishir1729
@nishishishir1729 3 года назад
HOW DID YOUR BRAIN COME UP WITH THIS???
@Bonzorio
@Bonzorio 3 года назад
But... not Shakespeare
@roobenn
@roobenn 3 года назад
infinity sorts it out for you
@Bonzorio
@Bonzorio 3 года назад
Have they read Shakespeare?
@SlimThrull
@SlimThrull 5 месяцев назад
So... Bogo sort until you hit Romeo and Juliet? Grab some food and drink. You're gonna be here for a while.
@robinlinh
@robinlinh 2 года назад
isn't this similar to the Library of babel?
@roobenn
@roobenn 2 года назад
yep (although obviously at a much much smaller scale)!! somehow i didn’t have any knowledge of the library of babel before creating this video
@KarlBonde
@KarlBonde Год назад
I absolutely loved this video!
@miltonpool
@miltonpool 2 года назад
Romeo and Juliop
@PeteyX
@PeteyX 3 года назад
Monke write literature
@distritofederal7187
@distritofederal7187 2 года назад
This deserves more views
@roobenn
@roobenn 2 года назад
it seems to be getting quite a few lately, not sure why
@distritofederal7187
@distritofederal7187 2 года назад
@@roobenn Might be because of this short, i think ru-vid.comRvHMOwi-ks4?feature=share
@strigon012
@strigon012 Год назад
hehe virtual monke type 'boi' ohh ohh banana
@darrelmasterson5850
@darrelmasterson5850 6 месяцев назад
"i got bored after a minute"...."after waiting an hour and a half"... yeah I really don't think you understand
@habillik
@habillik Год назад
can you send me this py folder? i tried this with my friend but we can't :(
@sterrikx3680
@sterrikx3680 2 года назад
your range is very small considering the amount of combinations that we can get from the list of letters
@aze4308
@aze4308 8 месяцев назад
nice
@nishishishir1729
@nishishishir1729 3 года назад
Brain large
@Greenscreenmemez
@Greenscreenmemez 8 месяцев назад
Imagine a monkey ended up typing "sigma ohio skibidi rizz"
@futabasakurairl
@futabasakurairl Год назад
wysi
@vprithviraj175
@vprithviraj175 2 года назад
Nice sim
@roobenn
@roobenn 3 года назад
spot the obvious mistake in my code
@highplayz5369
@highplayz5369 2 года назад
No can
@MrLimon27
@MrLimon27 8 месяцев назад
There's another problem. A monkey typing is not a random input.
@sjey8665
@sjey8665 Год назад
Can the infinite monkeys write a hundred-page book containing only the letter 'a', No it's impossible, Why? The same reason if you flipped a coin a 100 times you will have roughly 50 heads and tails. And just like that it's impossible too to write the works of Shakespeare.
@TheOriginalArchivist
@TheOriginalArchivist Год назад
Given infinite iterations, it's not only possible, but guaranteed to have a result of all heads.
@sjey8665
@sjey8665 Год назад
@@TheOriginalArchivist You are focusing on the infinity part and forgetting the mechanism which is randomly typing.
@TheOriginalArchivist
@TheOriginalArchivist Год назад
@@sjey8665 Because infinity is the crux of the equation. Both events you've posited (flipping a heads, and typing an a) have probabilities greater than 0. Given an infinite number of trials we will get all possible results. Therefore, it's not only possible, but guaranteed to get an entire book of all 'a's, or flip 100 heads in a row.
@sjey8665
@sjey8665 Год назад
@@TheOriginalArchivist I really don't know how can I simplify it more. The probability that a letter other than 'a' will appear on every page is 100%, Not only on every page but every line, because the letter 'a' is competing in a way against more than 30 other characters that have the same probability to being typed just like letter ''a'. a vs bcdefghi...etc It's just like a dice that have more than 30 sides and you are saying if we roll it 100 times there is a possibility that the same side will appear the 100 times, That is just impossible.
@TheOriginalArchivist
@TheOriginalArchivist Год назад
@@sjey8665 That's correct. Given an infinite amount of rolls, we will eventually achieve a result in which your 30 sided die lands on a 1 100 times in a row. The chance is not 0, it simply trends TOWARDS 0. I don't mean this in an ad hominem sort of way, but I think you have a fundamental misunderstanding of probabilities. Rolling a 30 on the die does not preclude further rolls of 30.
Далее
How to train simple AIs to balance a double pendulum
24:59
The "Just One More" Paradox
9:13
Просмотров 3 млн
What P vs NP is actually about
17:58
Просмотров 87 тыс.
The hidden beauty of the A* algorithm
19:22
Просмотров 861 тыс.
Every Paradox in 8 Minutes
8:05
Просмотров 4,2 млн
25 nooby Python habits you need to ditch
9:12
Просмотров 1,7 млн
The Canvas of Babel
12:37
Просмотров 2,6 млн