HelloandwelcometothecodingtrainwithWhoa, Thatwaslike I hadmyfingeroverthislittleairholehereand I got a higherpitchsoundAmazingscience.
MynameisDanielSchiffman, and I'llbeyourhostthismorningon a Wednesday, whichiseveryWednesday.
I willsaythankyouforbeinghereatthisregularlyscheduledtime.
I havebeensoconsistentaboutthis, even I'm amazingmyself.
However, I willreporttoyouthattherewillbenolivestreamnextWednesday.
I'llbebacktwoweeksfromtoday.
Soletmejustsaythatfromtheoutset.
I have a tripplantogotsomestuffgoingon.
Butdon't worry.
Underneathhereinmycodingtrainoveniscooking a wholesetofvideosaboutworkingwithdataandAPeyesthatyou I havenotseenyetbecause I havebeenrecording a bunchofvideos, notduring a livestreamasanexperiment.
Butthat's mylittlepitch.
Ifyouwanttojointhecodingtrainas a patronorYouTubemember, yougetsomesneakpreviewsofthatstuff.
Onbrilliantdotorg's homepage, youwillsee a challengeaboutrelativity.
Classicalrelativity.
Wealsohavethetermspecialrelativity.
Generalrelativity.
Oh, mygoodness, mymindsincelastWednesday, I think, waslastWednesday, rightwhenthefirstimageoftheblackholecameouthasjustexplodedwithwonderandaweattheuniversewelivein.
And I'vebeenspending a lotoftimereadingsomepapers, watchingsomeYouTubevideos.
I amnot a physicist.
I donothave a backgroundinthat, but I havebeensentdown.
I wasgonnasayRabbithole, but I thinktheappropriatetermherewouldbemanyblackholesnotemerged.
Bytheway, Onceyou'reinit, there's nowaytogetout.
I ampasttheeventhorizon.
Getmeout.
Butthat's what I wanttodointhefirstsegmentoftoday.
Sothefirstsegmenttoday, I'm gonnatalk a littlebitabouttherecentblackholeimageanddo a verycrudekindofnatureofcodestylephysics, simulationoflightapproaching a blackhole, but I willbeusingNewtonianphysicsuntilwon't actuallybeaccurate.
But I willtalkabout, um, what's missingthereand a littlebitaboutrelativityandthenkindoflikeposedthatas a challengetoyoutothinkaboutit.
Maybenextweek, after I'vehadmoretimetoreadthesepapersandcrunchsomeofthesenumbers, maybe I couldcomebackandmakeitmoreaccurateorororsuchthesound.
Onceagain, I takeoverthethechat.
I seethesoundSyncisoff.
I don't know.
Someday I'llfixthat.
I apologize.
Umoh, also.
Sothensegmenttwooftoday's Lifestream.
Lookatthis.
I have a planandeverything, and I'm sureitwillgohaywire.
Butthisismyplansegmentto I amgoingtoprogramthedatastructure a stackandlookat a quizthat's actuallyifyougotobrilliantdotorg's slashcoatingtrainrightnow, it'lltakeyouto a page, whichis a quizonstacks, andthere's also a quizoncues.
Andthisispartofsomenewcomputersciencecoursematerialsthatbrillianthas, whichhasbeenreallyterrificformetoreview a lotofthestuffthatmaybe I did 15 yearsago.
Soit's wonderfulforbothkindofcontinuingeducationforme, like I can, like, lookatthisstuffagainor, uh, verywellwhat I wassayingontheslackchatthismorninginthecodingtrainpatrongroupthatthelasttime I think I hadtoimplement a stacklikeactuallyimplementedwithoutjustusing a kindofusinganarrayas a standinfor a stackororsomeotherstackfrom a librarywasprobably 15 years.
So I'm gonnahavetodothattodayandlook, ATT.
Programmingmyownstackdatastructureinthecontextofthatquizandkindofleavethatas a challengeforyoutotakethequizonDhe.
Thenpendingtime, I willhavetosaythatitisinthetitleofthisvideo, which I probablyshouldn't haveputitthere, butat a minimum I willshowyousomenewexamplesthat I'm workingonthatdoneuroevolutionwithtensorflowJs.
I wouldlovetodo a codingchallengearoundthatthatmightcomethenexttime.
Butat a minimum, I dohave a few, likefinishedexamplesthatarebasicallyportsofsomeofmypreviousexamples.
There's a steeringofsteeringoneand a flappybirdonethat I willshowyou, Huh?
Thereasonwhy I'm thankingChrisinparticularisChriswroteupthiswonderfulguide, which I justit's actuallycalledsimulating a blackhole.
TheoneofthecodingchallengesonthestemcoatingYouTubechannelis a codingchallengecalledslingshotwithgravity, andit's verysimilartosomeexamples I haveinthenatureofcodebookaboutlookingatgravitationalattractionandsimulatingthatin a two D worldusingOilerintegrationandkindofsimple I don't wantamusing.
I hopehewas a fancyterm.
Usingsomebasically X equals X plusspeedkindofcodethiosimulatehowbodiesinteractwithgravity.
So, Chris, uh, modifiedthecodetwokindoftalkaboutblackholes a littlebitandthere's someniceinformationinhereand a lotofexplanation.
Reallyniceformulahere, which I willtalkaboutfortheradiusoftheevent.
Eventhorizon.
Um, yeah.
Swartzyeah.
Sootherwiseknown.
Sorry.
It's a shortstealsrateradius.
I wasliketryingtothinkHowdoyoupronouncethat?
It's likespelledshortchild.
I thinkshortsshieldsveryhardtosayitlikeit's undermister.
Umso I wanttocome.
I'm gonnacomebacktothiswhen I dothevideo, butso I alsowantedtojustplugifyouare a teacher.
Ah, wonderfulthingthatishappeningthissummeriscalledthePathfinderSummerInstitute, whichis a professionaldevelopmentincomputerscienceandmakingatIndianaUniversityBloomingtonfromJuly 14th 2/19.
Soifyou're a teacherandyou'reinterestedinthis, pleaseapply.
Um, and I'm happytohelp.
Youcanreachouttome, but I wouldsuggestreachingouttostemcodingorChrisorbondonTwittertoaskanyquestionsabouthowthisworks.
I'm gonnatalkaboutwhat I'velearnedintermsoflookingatsomeoftheseresourceis, and I'm basicallygoingtojustdo a Newtoniangravitationattractionexample, butkindofconsideronebodytobetheblackholeandonetheotherbodytobe a singlephotonsor a beamoflight.
And I needtothink I needto, like, lookataparttowouldbetorevisethistobeMaurtoeactuallybeaccurate.
I thinktheideacanbethestorycanbetoldandit'llbeaninterestingkindofpromptfortheaudiencewas, um, ormaybe a rigorousscientificbackgroundtocontributehere, Sothat's kindofmyplan.
Youpressthebutton a littleglistening, winking, but I cannotwink, cannotwinkofmyrighteye.
Myfamilyfindsthishysterical.
Thisismeinfrontof a blackholeimage, uh, attemptingtowinkwithmyrighteye.
If I wereinside a blackhole, youwouldnotbeabletoseemedoingthat, Norwould I beabletocommunicatewithyou.
Itwouldalsobevery, very, very, very, verydead.
Ormaybenot.
Maybe I wouldjustbemillionsofyearsinthefuture, and I wouldbeMatthewMcConaughey.
Hey, yeah.
Okay, letmecyclethekid.
Hello.
Andwhat?
Hello?
Welcometo a codingchallenge.
Simple, verycrude.
Notsoactiveitto t blackoldsimulation.
So I'm fascinatedbythisimage.
ThisimagewhichappearedontheInternet a weekagofromtheEventHorizonTelescopegroupofscientistswhoproducedthisimagewithmanydifferenttelescopesaltogethertimedwithsomekindoflikeNanoBaz N Ow, BrazilianoldsTimeprecisionTocreatethisimage, there's over 1000 peoplewatching.
That's not a record.
I haveneverbroken 2000 but, umoh, it's notclassicalrelativespywaySimonisgivingNosoundeffectsare a littleholdon.
Oh, yeah, I'm sure I pronouncedwhateverhoweveryousaytheGalileoandGalileoandGalileo, Whatdid I say?
Galileo?
Oh, I thinkweshouldbeabletosayittheway.
WhatgiftgiftgiftThat's hardtosaytoyou.
YougivePhilalienmechanicspeople, I gottastartthis.
Mmm.
Everybody's tellingmeit's outofsync.
Allright, allright.
It's outofsyncforeverybody.
Umoh, rightnow.
Alright.
Herewego.
Helloandwelcometo a codingchallenge.
Simple, verysimple, verycrude.
Notsoaccurateto D blackholesimulation.
I becameinterestedinthistopicAh, weekagowhenthisimagethefirsteverimageof a blackholeproducedbythescientistsfromtheEventHorizonTelescope, madethisthing.
Andit's amazing.
And I willincludemanylinkstoexplanationsandpapersthatyoucanreadupmoreabouthowthisimagewasmade.
Andso I becamefastwiththisideaandsortoflikeinthesensethat I havethisbookcalledNatureofCode, whichhas a bunchofexamplesabouthowtolookattheformulaforgravitationalattractionandthenmake a littletoo d simulationofthat.
Couldwedemonstratesomeoftheideasinhowthisimagewasproducedinhow a blackholebehavesinhow a blackhole, Ben's spacetime, orhowspacetimeisbentaroundtheblackholeandhowlightcan't evenescapeinthespeedoflight?
Andthenthere's therelativityandthere's specialrelativityknowallthisstuffnow, asYouknow, ifyou'vewatchedthisjournalbefore, I amnot a physicist, nordo I playoneonYouTube.
Andsothisisnotsomethingthat I wouldeverevencomeremotelyclosetoclaimingtobeanexpertin.
So I amrelyingonthe, um, thegoodheartednessoftheInternetinparticular.
ChrisOrbanfromtheYouTubechannelStemcoating, whichhas a lotofwonderfulcodingchallengesandvideotutorialsrelatedtorealscienceand P five.
JessandCoteachingaboutsciencethroughcodingwith a diversesetofspeakers, graduatestudentsandvariousotherpeople.
So I highlyrecommendyoucheckoutstemcoatingandChrisOrban.
Oneofhisexamples.
Oneoftheirexampleshas a slingshotwithgravity, a demonstrationmuchlikemygravitationalattraction.
Natureofcode.
Example.
I'm sayingthat's what I'm saying.
That's what I say.
Andatthatpointpoint, don't move, Don't move.
Otherwisewehadtoedit.
Don't move.
Moving.
Uh, whatwas I gonnasaynext?
SoChris, recentlywhenthatimagecameout, made a slightlymodifiedversionofthatexampletotalkaboutsomeofthebasicmechanicsofhowblackholebehaves.
Andthere's Maurexplanationonthispageandyoucanlinkheretoseethemodifiedand P fiveGScodesohighlyrecommendedtocheckthatout.
Thereisalso a wonderfulvideobyverytasi.
Um, wait, did I saythatright?
I couldn't sayGalilean.
Wait, holdon.
Thereisalso a wonderfulvideobyVeraTasiumwhichactuallycameoutbeforetheimagewasreleased, whichiskindofamazingthatthere's also a followupvideoofwhentheimagewasreleased.
Youdon't knowtheverytasticYouTubechannelmewhat?
YouknowthisgentleYouknowthatchannel?
Probably.
Anyway, um, thathasthisimageisshowinghowthephotonspassraysoflightbendaround a blackhole.
It's, like, soinsanethattheybendaround, meaning, if I'm standing, I mean, itcouldn't havearestandingontheblackhole.
I couldseetheblackbackofmyheadbecausethelightwouldbendaroundit.
So I wanttoseeif I cancreatesomethingalongthelinesofthistodemonstratethatidea.
Thisislike a tinylittleinklingpieceofthepuzzleofallofthescienceandworkthatwentintoproducingthatimage.
I willincludelinkstootherResourceisforyou, someofwhich I gotfromtheVeritasIAMvideoaswellthatyoucanreaduponit.
I'llbereadingthese a lotoverthenextweekorsoaswell.
Soifoneis, youshouldcheckoutthishowtodrawBlackHole, whichgoesthrough a lotofthemathandthensomenicereallycomputergraphicsJaderstylethree D tricksthatyoucouldthinkaboutlookingthrough.
Andyou'vegotsomethingherethatactuallylooksquite a bitliketheartisticrenderingof a blackholeinthefilminterstellar.
Sohowtheyrecommendyoucheckoutthisarticlebyso I don't knowtheperson's namebyrocktoenailsonGetHub.
Youcanalsoreadthis 1979 paperimageof a sphericalblackholewiththin, increasingdiscs.
I'lltalkaboutwhat a Christiandiskisin a momentifyou'renotfamiliarwithit.
Thephotonsoflighttravelingatthespeedoflightdoesn't haveanymasswith a massive 00 boy.
We'regettingintorelativity, aren't we?
Butitsohappensthatat 1.5 Schwartzfieldradiusradio, I shortSowhatdoyousaythatradiusRadaatabouthalfway 1.5 iswhere a rayoflightthephoton a photonparticlewouldorbit.
I shouldalsosaythat I'm sayingthiscurves, butitdoesn't reallycurve.
Seethefabricofspaceandtimeiscurved.
Thereisthingsaren't attracted.
It's justyoucouldthinkofit.
It's likeif I had a flatsurfacehereand I put a giantbowlingballinit, itwouldpushthatflatsurfacedownand a littlelikepingpongballontheedgewouldrolltowardsitbecauseitcurvedthefabricofspacetime.
Sothisisactually a straightlinethroughthecurvedspace.
Timetogenuine.
Let's getbacktotwo D canvassofjobs, keepingthebrowsershellway.
Uhoh.
It's notthestatutoryISSgalaxy.
I don't wanttocallthesethingswithinconsistentnames.
2400 billions.
Allright, allright, Allright.
20.
I got m 87 mass.
Wrongparty.
Me.
Actually, thisisnotcorrect.
Approximately 2400 billionsuns, whichisquite a bitmorethan 2.6 millionsons.
WhynotwritesoAndnowletmealsogoandmake a shiftonthisbeforehand.
Letmealsogoandmake a, umhealsogoingmake a blackholedotJsfilelooksblackholedotJess, umand I'm goingthioAddthattomyindexofhtmlandthen I'm goingtosayglass, blackholeandoh, I need a constructordoesthenextwhyweneedups.
Weneed, uhletmeuse a P vectorforthis, so I'm gonnasayth