Counting down the days, and learning Artificial Intelligence

by shiningsunnyday, Nov 22, 2017, 4:05 PM

So my first college interview was today.

It went okay, I guess - apart from talking about math, I mostly talked about being grateful and AoPS. The only downside was that since I've been feeling a bit weak the past few weeks on the Keto diet, I decided last minute to load up on carbs the day before. Unexpectedly, my body didn't adjust to well and the result was two trips to the bathroom this morning but hopefully the interviewer mistook me sitting on the edge of my seat as being enthusiastic so hopefully all is good.

Anyways, let's talk about school.

School is mostly dull, as is to be expected. In retrospect, I realize that high-intensity math training has made me more inclined to be interested in studying things that deliver a sense of thrill rather than being a well-rounded academic (the kind who strokes his beard and says hmmmm a lot) person, kind of like how a competitive swimmer may find it hard to swim at leisure. My grades apart from English are all A's (though most are borderline), but nevertheless I don't have much motivation to try to hard (talked about this many times on my blog before). In fact, I think I've reached the part where cynicism has been replaced by nonchalance - where I just don't really care but still do it anyways cause whatever.

Having 3 free periods has been sort of a blessing - I've had the chance to sleep in, manage two classes on AI (Machine Learning & Deep Learning and Neural Networks) on Coursera and my university-level online math course, and watch YouTube hours a day. This, I realize, has been really conducive to my creative energies - most nights I put myself to sleep listening to some talk by Elon Musk or some other tech magnate on space exploration, AI, self-driving cars, startups, bitcoin and blockchain, quantum computing, blah blah, and I feel never have I learned so much with such little effort.

I've also gotten a bit into competitive programming (USACO, CodeForces and TopCoder) for fun. I kind of bombed my debuts on the latter two so let's not about that...

Learning about AI has been so fascinating. Though most people envision a future where robots rule the world, we don't realize how prevalent machine learning has already become in our lives. From ads to recommendation systems (music, YouTube, Amazon), Uber, prices, machine learning is really about optimizing algorithms based on past experiences. A Chess-playing AI, for example, functions by associating a probability of winning with each position of the board, so that whatever state the game is in, it evaluate the moves it can make with the highest associated probability of winning. How it does so is complex, but the concept is pretty amazing - essentially, the output (probability) is a function of many factors, such as the level of threat by the queen, how far the game has been played, possible number of attacks. Each in turn is the composition of another layer of data - number of targets the queen can take out, the number of pieces left on the board, other combinations,etc. Basically, we can organize these data into layers of abstraction and show the interdependence of one layer on the other by a neural network until at the bottommost layer we have the input - the current position of the board. Essentially a neural network is represented by a weighted-edge graph, and the edge shows how heavily one factor is dependent on another, such as how much is the level of threat by the queen dependent on the number of pieces in its line of attack. By using supervised learning, we can train the AI over pre-played game move sequences, or better yet, by making it play against itself to optimize its strategy. With data mining (millions of inputted or self-generated data sets), the weight of the edges (and thus the neural network as a whole) adjusts to become the most accurate by the regression to the mean. This is akin to optimizing multivariable functions with partial derivatives, still mostly basic math, which is what I've been exposed to so far.

What I find more interesting is unsupervised learning - the basis behind some recent tech perks like iPhoneX's face recognition. Essentially, an AI is given some examples, and teaches itself to organize, distinguish, and excavate the data that users can make use of. For example, AI can recognize cats from images based on only the pixels of the image - RGB values, or can separate out the singing and non-singing voice from an audio file, recognize spam e-mails from non-spam. A cool article recently shows how an AI can come up with one-sentence descriptions of any image it sees - like "The bright-colored sunflower plant in a garden." Specifically what features the AI does and looks for with the data its given isn't the result of hard-coded algorithms, but, referring to above, neural networks.

There's really infinite applications one can think of, so learning about it has been really fun.

Since I'll have plenty of time in second semester, perhaps I can design a neural network to make a virtual AI girlfriend texting app to keep me company (I'm only half-joking).

Anyhoo, only 12 more days before finals week (the same week early app comes out) when I'll hopefully be done submitting all my apps, then the gooooood life begins.

Anyhow let's finish with a CodeForces I solved but haven't implemented up yet (the sol is different from the official but I proved it works yay):
Slightly harder than CodeForces Round 447 Div. 2 C wrote:
In a dream Marco met an elderly man with a pair of black glasses. The man told him the key to immortality and then disappeared with the wind of time.

When he woke up, he only remembered that the key was a sequence of positive integers of some length n, but forgot the exact sequence. Let the elements of the sequence be $a_1, a_2, \ldots, a_n.$ He remembered that he calculated $\gcd(a_i, a_{i+1}, \ldots, a_j)$ for every $1 \le i \le j \le n$ and put it into a set $S$.

Note that even if a number is put into the set $S$ twice or more, it only appears once in the set.

Now Marco gives you the set $S$ and asks you to help him figure out the initial sequence. If there are many solutions, print any of the smallest of them. It is also possible that there are no sequences that produce the set $S$, in this case print $-1.$

Solution
This post has been edited 3 times. Last edited by shiningsunnyday, Nov 23, 2017, 1:31 AM

Comment

2 Comments

The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
That CF problem annoyed me a lot because for some reason I assumed the terms of the original sequence had to be distinct and my solution was hacked 5 minutes before the end of the round. I ended up with a $-106$ rating change. The official solution was extremely trivial. :furious:

Also, I'm not completely sure if I have understood your solution. Given the set $S = \{2, 30, 42 \}$ then in the third part of the step where you have $\text{cur} = 30$, you compute $\gcd(30, 42) = 6$ which is not in $S$, but there exists a valid sequence.

Sorry, I mean't that $\gcd(\text{cur}, \text{subset from O})$ doesn't have to be in $S,$ but if it was, it clears that element from having to be added later.
This post has been edited 2 times. Last edited by shiningsunnyday, Nov 23, 2017, 12:06 AM

by Sumgato, Nov 22, 2017, 5:07 PM

The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
My own opinion (stolen from other people of course) is that we will never recognize when "artificial intelligence" is truly implemented: since tech development of all those amazing machines we see all around us, we will never truly reach "artificial intelligence" or something like that. The bar will keep getting raised higher and higher.

I had a college interview too 2 weeks ago! He was a friendly guy.

Well it depends on what you define AI. By literal means it's already achieved since we already have many tasks automated, and many amazing functions. Yes, I think bar will keep getting raised higher and higher - as there're always more tasks to automate, and in a consumer-based society we all have incentive to facilitate what we know into a product.
This post has been edited 1 time. Last edited by shiningsunnyday, Nov 23, 2017, 1:29 AM

by jonlin1000, Nov 22, 2017, 8:25 PM

The ones who are crazy enough to think they can change the world are the ones who do.

avatar

shiningsunnyday
Archives
+ January 2018
Shouts
Submit
  • The blog is locked right?

    by First, Apr 14, 2018, 6:00 PM

  • Great, amazing, inspiring blog. Good luck in life, and just know I aspire to succeed as you will in the future.

    by mgrimalo, Apr 7, 2018, 6:19 PM

  • Yesyesyes

    by shiningsunnyday, Mar 29, 2018, 5:30 PM

  • :O a new background picture

    by MathAwesome123, Mar 29, 2018, 3:39 PM

  • did you get into MIT?

    by 15Pandabears, Mar 15, 2018, 10:42 PM

  • wait what new site?

    by yegkatie, Feb 11, 2018, 1:49 AM

  • Yea, doing a bit of cleaning before migrating to new site

    by shiningsunnyday, Jan 21, 2018, 2:43 PM

  • Were there posts made in December 2017 for this blog and then deleted?

    I ask because I was purging my thunderbird inbox and I found emails indicating new blog posts of yours.

    email do not lie

    by jonlin1000, Jan 21, 2018, 12:12 AM

  • @below sorry not accepting contribs

    by shiningsunnyday, Dec 11, 2017, 11:15 AM

  • contrib plez?
    also wow this blog is very popular

    by DavidUsa, Dec 10, 2017, 7:53 PM

  • @First: lol same

    first shout of december

    by coolmath34, Dec 6, 2017, 2:32 PM

  • XD this blog is hilarious

    by Mitsuku, Nov 21, 2017, 7:40 PM

  • @wu2481632: stop encouraging SSD to procrastinate(blog entries are fun but procrastination isn't).

    by First, Aug 7, 2017, 5:02 PM

  • 3.5 weeks without a post :o

    by Flash12, Aug 4, 2017, 8:10 AM

  • First august shout!!

    by adik7, Aug 1, 2017, 6:52 AM

416 shouts
Tags
About Owner
  • Posts: 1350
  • Joined: Dec 19, 2014
Blog Stats
  • Blog created: Nov 10, 2015
  • Total entries: 153
  • Total visits: 45242
  • Total comments: 1089
Search Blog
a